You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "shekhars-li (via GitHub)" <gi...@apache.org> on 2024/03/26 20:11:57 UTC
[PR] Create store directory paths in CSM constructor for disk space monitor [samza]
shekhars-li opened a new pull request, #1697:
URL: https://github.com/apache/samza/pull/1697
Fix for the bug: https://issues.apache.org/jira/browse/SAMZA-2752
What:
Set durable store names in a set in the ContainerStorageManager constructor
Why:
During previous refractoring, the createStore for durable stores was moved outside of constructor. However, the store directory paths are required to be set in constructor so that SamzaContainer class can set monitors for them. This patch sets the store names without creating the stores, so that monitoring can be set properly.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@samza.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create store directory paths in CSM constructor for disk space monitor [samza]
Posted by "dxichen (via GitHub)" <gi...@apache.org>.
dxichen commented on code in PR #1697:
URL: https://github.com/apache/samza/pull/1697#discussion_r1543808370
##########
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManager.java:
##########
@@ -192,6 +193,21 @@ public ContainerStorageManager(
this.storeConsumers = ContainerStorageManagerUtil.createStoreChangelogConsumers(
activeTaskChangelogSystemStreams, systemFactories, samzaContainerMetrics.registry(), config);
+ // The store directory paths are used by SamzaContainer to add a metric to watch the disk space usage of the store
+ // directories. The stores itself does not need to be created but the store directory paths need to be set to be
+ // able to monitor them, once they're created and in use.
+ Set<String> storesToCreate =
+ ContainerStorageManagerUtil.getNonSideInputNonInMemoryStores(storageEngineFactories, sideInputStoreNames, config);
+ for (String storeName : storesToCreate) {
+ for (Map.Entry<TaskName, TaskModel> task : containerModel.getTasks().entrySet()) {
+ File storeDirPath =
+ ContainerStorageManagerUtil.getStoreDirPath(storeName, config, activeTaskChangelogSystemStreams,
+ sideInputStoreNames, task.getKey(), task.getValue(), storageManagerUtil, loggedStoreBaseDirectory,
+ nonLoggedStoreBaseDirectory);
+ storeDirectoryPaths.add(storeDirPath.toPath());
Review Comment:
As discussed oflfine, lets refactor `ContainerStorageManagerUtil.createInMemoryStores` and similar to accept the `storeDirectoryPaths` instead of relying on pass-by-reference to mutate `this. storeDirectoryPaths` in order to clarify that this field is updated. Furthermore, instead of keeping this path creation in the ctor I would prefer a static helper function like `getStoreDirPathsForStoreNames` run or each types of stores
--
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.
To unsubscribe, e-mail: commits-unsubscribe@samza.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create store directory paths in CSM constructor for disk space monitor [samza]
Posted by "dxichen (via GitHub)" <gi...@apache.org>.
dxichen merged PR #1697:
URL: https://github.com/apache/samza/pull/1697
--
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.
To unsubscribe, e-mail: commits-unsubscribe@samza.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create store directory paths in CSM constructor for disk space monitor [samza]
Posted by "dxichen (via GitHub)" <gi...@apache.org>.
dxichen commented on code in PR #1697:
URL: https://github.com/apache/samza/pull/1697#discussion_r1543808370
##########
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManager.java:
##########
@@ -192,6 +193,21 @@ public ContainerStorageManager(
this.storeConsumers = ContainerStorageManagerUtil.createStoreChangelogConsumers(
activeTaskChangelogSystemStreams, systemFactories, samzaContainerMetrics.registry(), config);
+ // The store directory paths are used by SamzaContainer to add a metric to watch the disk space usage of the store
+ // directories. The stores itself does not need to be created but the store directory paths need to be set to be
+ // able to monitor them, once they're created and in use.
+ Set<String> storesToCreate =
+ ContainerStorageManagerUtil.getNonSideInputNonInMemoryStores(storageEngineFactories, sideInputStoreNames, config);
+ for (String storeName : storesToCreate) {
+ for (Map.Entry<TaskName, TaskModel> task : containerModel.getTasks().entrySet()) {
+ File storeDirPath =
+ ContainerStorageManagerUtil.getStoreDirPath(storeName, config, activeTaskChangelogSystemStreams,
+ sideInputStoreNames, task.getKey(), task.getValue(), storageManagerUtil, loggedStoreBaseDirectory,
+ nonLoggedStoreBaseDirectory);
+ storeDirectoryPaths.add(storeDirPath.toPath());
Review Comment:
As discussed offline, lets refactor `ContainerStorageManagerUtil.createInMemoryStores` and similar to accept the `storeDirectoryPaths` instead of relying on pass-by-reference to mutate `this.storeDirectoryPaths` in order to clarify that this field is updated. Furthermore, instead of keeping this path creation in the ctor I would prefer a static helper function like `getStoreDirPathsForStoreNames` run or each types of stores
--
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.
To unsubscribe, e-mail: commits-unsubscribe@samza.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create store directory paths in CSM constructor for disk space monitor [samza]
Posted by "dxichen (via GitHub)" <gi...@apache.org>.
dxichen commented on code in PR #1697:
URL: https://github.com/apache/samza/pull/1697#discussion_r1543808370
##########
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManager.java:
##########
@@ -192,6 +193,21 @@ public ContainerStorageManager(
this.storeConsumers = ContainerStorageManagerUtil.createStoreChangelogConsumers(
activeTaskChangelogSystemStreams, systemFactories, samzaContainerMetrics.registry(), config);
+ // The store directory paths are used by SamzaContainer to add a metric to watch the disk space usage of the store
+ // directories. The stores itself does not need to be created but the store directory paths need to be set to be
+ // able to monitor them, once they're created and in use.
+ Set<String> storesToCreate =
+ ContainerStorageManagerUtil.getNonSideInputNonInMemoryStores(storageEngineFactories, sideInputStoreNames, config);
+ for (String storeName : storesToCreate) {
+ for (Map.Entry<TaskName, TaskModel> task : containerModel.getTasks().entrySet()) {
+ File storeDirPath =
+ ContainerStorageManagerUtil.getStoreDirPath(storeName, config, activeTaskChangelogSystemStreams,
+ sideInputStoreNames, task.getKey(), task.getValue(), storageManagerUtil, loggedStoreBaseDirectory,
+ nonLoggedStoreBaseDirectory);
+ storeDirectoryPaths.add(storeDirPath.toPath());
Review Comment:
As discussed offline, lets refactor `ContainerStorageManagerUtil.createInMemoryStores` and similar to accept the `storeDirectoryPaths` instead of relying on pass-by-reference to mutate `this. storeDirectoryPaths` in order to clarify that this field is updated. Furthermore, instead of keeping this path creation in the ctor I would prefer a static helper function like `getStoreDirPathsForStoreNames` run or each types of stores
--
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.
To unsubscribe, e-mail: commits-unsubscribe@samza.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org