[
https://issues.apache.org/jira/browse/BEAM-5865?focusedWorklogId=239753&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-239753
]
ASF GitHub Bot logged work on BEAM-5865:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/May/19 14:01
Start Date: 09/May/19 14:01
Worklog Time Spent: 10m
Work Description: JozoVilcek commented on pull request #8499: [BEAM-5865]
Create optional auto-balancing sharding function for Flink
URL: https://github.com/apache/beam/pull/8499#discussion_r282498981
##########
File path:
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkStreamingPipelineTranslator.java
##########
@@ -211,6 +261,20 @@ boolean canTranslate(T transform,
FlinkStreamingTranslationContext context) {
if (WriteFilesTranslation.isWindowedWrites(transform)) {
replacement = replacement.withWindowedWrites();
}
+
+ if (options.isAutoBalanceWriteFilesShardingEnabled()) {
+ Preconditions.checkArgument(
+ options.getParallelism() > 0,
+ "Parallelism is required to be set in FlinkPipelineOptions when
isAutoBalanceWriteFilesShardingEnabled");
+
+ replacement =
+ replacement.withShardingFunction(
+ new FlinkAutoBalancedShardKeyShardingFunction<>(
+ options.getParallelism(),
+ options.getMaxParallelism(),
+ sink.getDynamicDestinations().getDestinationCoder()));
+ }
+
return PTransformReplacement.of(
PTransformReplacements.getSingletonMainInput(transform),
replacement.withNumShards(numShards));
Review comment:
Never mind. I talked with @mxm and noticed that overrides have access to
proto and WriteFiles transform. I got derailed by runner determined sharding
code and thought that accessing stuff from proto is the only way. But it seems
it is now so I should be good 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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 239753)
Time Spent: 5h 20m (was: 5h 10m)
> Auto sharding of streaming sinks in FlinkRunner
> -----------------------------------------------
>
> Key: BEAM-5865
> URL: https://issues.apache.org/jira/browse/BEAM-5865
> Project: Beam
> Issue Type: Improvement
> Components: runner-flink
> Reporter: Maximilian Michels
> Assignee: Jozef Vilcek
> Priority: Major
> Time Spent: 5h 20m
> Remaining Estimate: 0h
>
> The Flink Runner should do auto-sharding of streaming sinks, similar to
> BEAM-1438. That way, the user doesn't have to set shards manually which
> introduces additional shuffling and might cause skew in the distribution of
> data.
> As per discussion:
> https://lists.apache.org/thread.html/7b92145dd9ae68da1866f1047445479f51d31f103d6407316bb4114c@%3Cuser.beam.apache.org%3E
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)