[
https://issues.apache.org/jira/browse/BEAM-12403?focusedWorklogId=634885&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-634885
]
ASF GitHub Bot logged work on BEAM-12403:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Aug/21 00:08
Start Date: 06/Aug/21 00:08
Worklog Time Spent: 10m
Work Description: xinyuiscool commented on a change in pull request
#15280:
URL: https://github.com/apache/beam/pull/15280#discussion_r683860922
##########
File path:
runners/samza/src/main/java/org/apache/beam/runners/samza/translation/ParDoBoundMultiTranslator.java
##########
@@ -301,12 +304,18 @@ public void translatePortable(
final RunnerApi.PCollection input =
pipeline.getComponents().getPcollectionsOrThrow(inputId);
final PCollection.IsBounded isBounded =
SamzaPipelineTranslatorUtils.isBounded(input);
+ final Coder<?> keyCoder =
+ StateUtils.isStateful(stagePayload)
Review comment:
same above. consider adding a getKeyCoder() in stateutils.
##########
File path:
runners/samza/src/main/java/org/apache/beam/runners/samza/translation/ParDoBoundMultiTranslator.java
##########
@@ -112,8 +113,10 @@ public void translate(
.collect(
Collectors.toMap(e -> e.getKey(), e -> ((PCollection<?>)
e.getValue()).getCoder()));
- boolean isStateful = DoFnSignatures.isStateful(transform.getFn());
- final Coder<?> keyCoder = isStateful ? ((KvCoder<?, ?>)
input.getCoder()).getKeyCoder() : null;
+ final Coder<?> keyCoder =
+ StateUtils.isStateful(transform.getFn())
Review comment:
I guess we might as well as a getKeyCoder() in the stateUtils to avoid
these logic.
##########
File path:
runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/SamzaStoreStateInternals.java
##########
@@ -118,27 +123,58 @@ private SamzaStoreStateInternals(
context.getStore(SamzaStoreStateInternals.BEAM_STORE);
}
- @SuppressWarnings("unchecked")
+ /**
+ * Creates non keyed state internal factory to persist states in {@link
+ * SamzaStoreStateInternals#BEAM_STORE}.
+ */
+ static <K> Factory<K> createStateInternalFactory(
Review comment:
Seems it's better to explicitly name this
createNonKeyedStateInternalFactory.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 634885)
Time Spent: 2.5h (was: 2h 20m)
> Support user states in Samza portable runner
> --------------------------------------------
>
> Key: BEAM-12403
> URL: https://issues.apache.org/jira/browse/BEAM-12403
> Project: Beam
> Issue Type: Improvement
> Components: runner-samza
> Reporter: Xinyu Liu
> Assignee: Ke Wu
> Priority: P2
> Labels: portability-samza
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> Add support of stateful ParDo in Samza portable runner.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)