mynameborat commented on a change in pull request #912: SEP-19 : Refactoring
sideInputs from SamzaContainer to ContainerStorageManager
URL: https://github.com/apache/samza/pull/912#discussion_r260976980
##########
File path:
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManager.java
##########
@@ -407,14 +789,33 @@ public void stopStores() {
}
public void shutdown() {
- this.taskRestoreManagers.forEach((taskInstance, taskRestoreManager) -> {
- if (taskRestoreManager != null) {
- LOG.debug("Shutting down task storage manager for taskName: {} ",
taskInstance);
- taskRestoreManager.stop();
- } else {
- LOG.debug("Skipping task storage manager shutdown for taskName: {}",
taskInstance);
- }
- });
+ // stop all nonsideinputstores including persistent and non-persistent
stores
+ this.containerModel.getTasks().forEach((taskName, taskModel) ->
+ getNonSideInputStores(taskName).forEach((storeName, store) ->
store.stop())
+ );
+
+ // stop reading sideInputs
+ this.shutDownSideInputRead = true;
+
+ // stop all sideinput consumers and stores
+ if (sideInputSystemConsumers != null) {
Review comment:
Can we simplify these nulls checks and instead have one state that denotes
if side inputs are present or absent? I noticed in some places you check if the
`sideInputConsumers` are non-empty and some of them checks for null and some
use `sideInputSystemStreams` is non-empty.
Lets just have one place and one logic to determine the presence of side
inputs and if its present then the invariant of some of the variables being
non-null should hold since you create empty maps or collection for the most
part.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services