bkonold commented on a change in pull request #1343:
URL: https://github.com/apache/samza/pull/1343#discussion_r429146954
##########
File path:
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManager.java
##########
@@ -239,66 +253,102 @@ public ContainerStorageManager(
this.taskStores = createTaskStores(containerModel, jobContext,
containerContext, storageEngineFactories, serdes, taskInstanceMetrics,
taskInstanceCollectors);
// create system consumers (1 per store system in changelogSystemStreams),
and index it by storeName
- Map<String, SystemConsumer> storeSystemConsumers =
createConsumers(this.changelogSystemStreams.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
- e -> Collections.singleton(e.getValue()))), systemFactories, config,
this.samzaContainerMetrics.registry());
+ Map<String, SystemConsumer> storeSystemConsumers =
createConsumers(this.changelogSystemStreams.values().stream().map(SystemStream::getSystem).collect(
+ Collectors.toSet()),
+ systemFactories, config, this.samzaContainerMetrics.registry());
+
this.storeConsumers = createStoreIndexedMap(this.changelogSystemStreams,
storeSystemConsumers);
// creating task restore managers
this.taskRestoreManagers = createTaskRestoreManagers(systemAdmins, clock,
this.samzaContainerMetrics);
// create sideInput storage managers
- sideInputStorageManagers = createSideInputStorageManagers(clock);
+ this.taskSideInputStorageManagers = createSideInputStorageManagers(clock);
+
+ this.taskSideInputHandlers = new HashMap<>();
- // create sideInput consumers indexed by systemName
- this.sideInputConsumers = createConsumers(this.sideInputSystemStreams,
systemFactories, config, this.samzaContainerMetrics.registry());
+ Set<String> sideInputSystems =
this.taskSideInputStoreSSPs.values().stream()
+ .flatMap(map -> map.values().stream())
+ .flatMap(Set::stream)
+ .map(SystemStreamPartition::getSystem)
+ .collect(Collectors.toSet());
+
+ this.sideInputSSPLocks = this.taskSideInputStoreSSPs.values().stream()
+ .flatMap(map -> map.values().stream())
+ .flatMap(Collection::stream)
Review comment:
Good point. Yes, we can extract this to a variable.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]