rmatharu commented on a change in pull request #1145: Emitting 
numPersistentStores instead of num stores with changelog from DiagnosticsManager
URL: https://github.com/apache/samza/pull/1145#discussion_r317370784
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/config/StorageConfig.java
 ##########
 @@ -225,10 +226,13 @@ public boolean hasDurableStores() {
   }
 
   /**
-   * Helper method to get the number of stores configured with a changelog.
+   * Helper method to get the number of persistent stores.
    */
-  public int getNumStoresWithChangelog() {
-    Config subConfig = subset(STORE_PREFIX, true);
-    return new Long(subConfig.keySet().stream().filter(key -> 
key.endsWith(CHANGELOG_SUFFIX)).count()).intValue();
+  public int getNumPersistentStores() {
+    return (int) getStoreNames().stream()
+        .map(storeName -> getStorageFactoryClassName(storeName))
+        .filter(factoryName -> factoryName.isPresent())
+        .filter(factoryName -> 
factoryName.get().equals(PERSISTENT_STORE_FACTORY))
 
 Review comment:
   Ah, yes, I was looking for exactly that. 
   Had to add a constant because of the module dependency.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to