(
&self,
nested: &mut Iterative<'b, S, u64>,
_local_arrangements: &VariableMap<Iterative<'b, S, u64>>,
context: &mut I,
)
| 493 | } |
| 494 | |
| 495 | fn implement<'b, T, I, S>( |
| 496 | &self, |
| 497 | nested: &mut Iterative<'b, S, u64>, |
| 498 | _local_arrangements: &VariableMap<Iterative<'b, S, u64>>, |
| 499 | context: &mut I, |
| 500 | ) -> (Implemented<'b, S>, ShutdownHandle) |
| 501 | where |
| 502 | T: Timestamp + Lattice, |
| 503 | I: ImplContext<T>, |
| 504 | S: Scope<Timestamp = T>, |
| 505 | { |
| 506 | if self.bindings.is_empty() { |
| 507 | panic!("No bindings passed."); |
| 508 | } else if self.variables.is_empty() { |
| 509 | panic!("No variables requested."); |
| 510 | } else if self.bindings.len() == 1 { |
| 511 | self.implement_single_binding(nested, _local_arrangements, context) |
| 512 | // } else if self.bindings.len() == 2 { |
| 513 | // Hector::two_way(nested, _local_arrangements, context, self.bindings[0].clone(), self.bindings[1].clone()) |
| 514 | } else { |
| 515 | // In order to avoid delta pipelines looking at each |
| 516 | // other's data in naughty ways, we need to run them all |
| 517 | // inside a scope with lexicographic times. |
| 518 | |
| 519 | let (joined, shutdown_handle) = nested.scoped::<AltNeu<Product<T,u64>>, _, _>("AltNeu", |inner| { |
| 520 | |
| 521 | let scope = inner.clone(); |
| 522 | |
| 523 | // We cache aggressively, to avoid importing and |
| 524 | // wrapping things more than once. |
| 525 | |
| 526 | let mut shutdown_handle = ShutdownHandle::empty(); |
| 527 | |
| 528 | let mut forward_counts = HashMap::new(); |
| 529 | let mut forward_proposes = HashMap::new(); |
| 530 | let mut forward_validates = HashMap::new(); |
| 531 | |
| 532 | let mut reverse_counts = HashMap::new(); |
| 533 | let mut reverse_proposes = HashMap::new(); |
| 534 | let mut reverse_validates = HashMap::new(); |
| 535 | |
| 536 | // Attempt to acquire a logger for tuple counts. |
| 537 | let logger = { |
| 538 | let register = scope.parent.log_register(); |
| 539 | register.get::<DeclarativeEvent>("declarative") |
| 540 | }; |
| 541 | |
| 542 | // For each AttributeBinding (only AttributeBindings |
| 543 | // actually experience change), we construct a delta query |
| 544 | // driven by changes to that binding. |
| 545 | |
| 546 | let changes = self.bindings.iter().enumerate() |
| 547 | .flat_map(|(idx, delta_binding)| match delta_binding { |
| 548 | Binding::Attribute(delta_binding) => { |
| 549 | |
| 550 | // We need to determine an order on the attributes |
| 551 | // that ensures that each is bound by preceeding |
| 552 | // attributes. For now, we will take the requested order. |
nothing calls this directly
no test coverage detected