seungjin-an commented on code in PR #24276:
URL: https://github.com/apache/beam/pull/24276#discussion_r1037465724
##########
runners/samza/src/main/java/org/apache/beam/runners/samza/translation/SamzaPipelineTranslator.java:
##########
@@ -105,6 +106,38 @@ public static void createConfig(
pipeline.traverseTopologically(visitor);
}
+ /** Rewrite user store configs if there exists same state ids with multiple
ParDos. */
+ public static void rewriteConfigWithMultiParDoStateId(
+ SamzaPipelineOptions options,
+ Map<String, String> multiParDoStateIdMap,
+ ConfigBuilder configBuilder) {
+ multiParDoStateIdMap.forEach(
+ (stateId, value) -> {
+ // rewrite single parDo state configs into multiple parDo state
+ String multiParDoStateId = String.join("-", stateId, value);
+ // replace old single parDo store configs with new storeId mapping
appended with parDo
+ // name
+ configBuilder.remove("stores." + stateId + ".factory");
+ configBuilder.remove("stores." + stateId + ".key.serde");
+ configBuilder.remove("stores." + stateId + ".msg.serde");
+ configBuilder.remove("stores." + stateId + ".rocksdb.compression");
+ // put new config with multi pardo config
+ configBuilder.put(
+ "stores." + multiParDoStateId + ".factory",
+
"org.apache.samza.storage.kv.RocksDbKeyValueStorageEngineFactory");
Review Comment:
Ah Sounds good :) Made the change to all other occurrences.
--
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]