davehagman commented on a change in pull request #3820:
URL: https://github.com/apache/hudi/pull/3820#discussion_r735757338



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/utils/TransactionUtils.java
##########
@@ -111,16 +118,27 @@
     }
   }
 
-  // override the current metadata with the metadata from the latest instant 
for the specified key prefixes
-  private static void overrideWithLatestCommitMetadata(HoodieTableMetaClient 
metaClient, Option<HoodieCommitMetadata> thisMetadata,
-      Option<HoodieInstant> thisInstant, List<String> keyPrefixes) {
+  private static void 
mergeCheckpointStateFromPreviousCommit(HoodieTableMetaClient metaClient, 
Option<HoodieCommitMetadata> thisMetadata) {
+    overrideWithLatestCommitMetadata(metaClient, thisMetadata, 
Collections.singletonList(HoodieWriteConfig.DELTASTREAMER_CHECKPOINT_KEY));
+  }
+
+  /**
+   * Generic method allowing us to override the current metadata with the 
metadata from
+   * the latest instant for the specified key prefixes
+   * @param metaClient
+   * @param thisMetadata
+   * @param keyPrefixes The key prefixes to merge from the previous commit
+   */
+  private static void overrideWithLatestCommitMetadata(HoodieTableMetaClient 
metaClient,

Review comment:
       I only kept it because it does dry-up the solution overall since any 
metadata merge operation is going to use this same process. Merging state 
specific to the deltastreamer is just one example of this. Does that make 
sense? Should I still remove it?

##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java
##########
@@ -368,11 +372,13 @@
           + "OPTIMISTIC_CONCURRENCY_CONTROL: Multiple writers can operate on 
the table and exactly one of them succeed "
           + "if a conflict (writes affect the same file group) is detected.");
 
-  public static final ConfigProperty<String> WRITE_META_KEY_PREFIXES = 
ConfigProperty
-      .key("hoodie.write.meta.key.prefixes")
-      .defaultValue("")
-      .withDocumentation("Comma separated metadata key prefixes to override 
from latest commit "
-          + "during overlapping commits via multi writing");
+  public static final ConfigProperty<Boolean> 
WRITE_CONCURRENCY_MERGE_DELTASTREAMER_STATE = ConfigProperty
+          .key("hoodie.write.concurrency.merge.deltastreamer.state")
+          .defaultValue(false)
+          .withDocumentation("If enabled, this writer will merge Deltastreamer 
state "
+                  + "from the previous checkpoint in order to allow both 
realtime "
+                  + "and batch writers to ingest into a single table. "
+                  + "This should not be enabled on Deltastreamer writers.");

Review comment:
       Done!




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to