You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/11/07 23:17:59 UTC

[GitHub] [samza] shanthoosh commented on a change in pull request #1125: SAMZA-2286: Integrate MetadataStore#putAll for improved startup time.

shanthoosh commented on a change in pull request #1125: SAMZA-2286: Integrate MetadataStore#putAll for improved startup time.
URL: https://github.com/apache/samza/pull/1125#discussion_r317416413
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/storage/ChangelogStreamManager.java
 ##########
 @@ -90,18 +90,23 @@ public ChangelogStreamManager(MetadataStore metadataStore) {
    */
   public void writePartitionMapping(Map<TaskName, Integer> changelogEntries) {
     LOG.debug("Updating changelog information with: ");
+    HashMap<String, byte[]> changelogEntriesToStore = new HashMap<>();
     for (Map.Entry<TaskName, Integer> entry : changelogEntries.entrySet()) {
       Preconditions.checkNotNull(entry.getKey());
       String taskName = entry.getKey().getTaskName();
       if (entry.getValue() != null) {
         String changeLogPartitionId = String.valueOf(entry.getValue());
         LOG.debug("TaskName: {} to Partition: {}", taskName, entry.getValue());
-        metadataStore.put(taskName, valueSerde.toBytes(changeLogPartitionId));
+        changelogEntriesToStore.put(taskName, valueSerde.toBytes(changeLogPartitionId));
       } else {
         LOG.debug("Deleting the TaskName: {}", taskName);
         metadataStore.delete(taskName);
 
 Review comment:
   Not related to this change. But it would be beneficial to add a deleteAll  API in `MetadataStore` (synonymous to putAll API). `deleteAll` API would simplify the iterative delete API invocations. If you agree, then it would be great to create a follow-up ticket and add a todo here.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services