You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/12/01 18:10:55 UTC
[GitHub] [beam] dxichen commented on a diff in pull request #24276: Samza runner support for same stateId with multiple ParDos
dxichen commented on code in PR #24276:
URL: https://github.com/apache/beam/pull/24276#discussion_r1037425664
##########
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:
Oh I just mean something like `RocksDbKeyValueStorageEngineFactory.class.getName()`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org