Skip to content

Commit

Permalink
Fix the repeatively calling toProto() when creating ReduceFniRunner (#…
Browse files Browse the repository at this point in the history
…122)

* Fix the repeatively calling toProto() when creating ReduceFniRunner

* Update beam version

* Fix avro plugin repo

---------

Co-authored-by: Xinyu Liu <[email protected]>
  • Loading branch information
xinyuiscool and Xinyu Liu authored Jul 31, 2024
1 parent 1de86e6 commit 10074a9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
7 changes: 6 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ repositories {
url = uri("https://repo.spring.io/plugins-release/")
content { includeGroup("io.spring.gradle") }
}
// For obsolete Avro plugin
maven {
url = uri("https://jitpack.io")
content { includeGroup("com.github.davidmc24.gradle-avro-plugin") }
}
}

// Dependencies on other plugins used when this plugin is invoked
Expand All @@ -40,7 +45,7 @@ dependencies {
implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.3")

runtimeOnly("com.google.protobuf:protobuf-gradle-plugin:0.8.13") // Enable proto code generation
runtimeOnly("com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0") // Enable Avro code generation
runtimeOnly("com.github.davidmc24.gradle-avro-plugin:gradle-avro-plugin:0.16.0") // Enable Avro code generation
runtimeOnly("com.diffplug.spotless:spotless-plugin-gradle:5.6.1") // Enable a code formatting plugin
runtimeOnly("gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.22.0") // Enable building Docker containers
runtimeOnly("gradle.plugin.com.dorongold.plugins:task-tree:1.5") // Adds a 'taskTree' task to print task dependency tree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class BeamModulePlugin implements Plugin<Project> {

// Automatically use the official release version if we are performing a release
// otherwise append '-SNAPSHOT'
project.version = '2.45.23'
project.version = '2.45.24'
if (isLinkedin(project)) {
project.ext.mavenGroupId = 'com.linkedin.beam'
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ signing.gnupg.useLegacyGpg=true
# buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy.
# To build a custom Beam version make sure you change it in both places, see
# https://github.com/apache/beam/issues/21302.
version=2.45.23
sdk_version=2.45.23
version=2.45.24
sdk_version=2.45.24

javaVersion=1.8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ DoFn<KeyedWorkItem<K, InputT>, KV<K, OutputT>> create(
private transient SideInputReader sideInputReader;
private transient DoFnRunners.OutputManager outputManager;
private TupleTag<KV<K, OutputT>> mainTag;
private ExecutableTriggerStateMachine triggerStateMachine;

public GroupAlsoByWindowViaWindowSetNewDoFn(
WindowingStrategy<?, W> windowingStrategy,
Expand All @@ -86,6 +87,10 @@ public GroupAlsoByWindowViaWindowSetNewDoFn(
this.windowingStrategy = noWildcard;
this.reduceFn = reduceFn;
this.stateInternalsFactory = stateInternalsFactory;
this.triggerStateMachine =
ExecutableTriggerStateMachine.create(
TriggerStateMachines.stateMachineForTrigger(
TriggerTranslation.toProto(windowingStrategy.getTrigger())));
}

private OutputWindowedValue<KV<K, OutputT>> outputWindowedValue() {
Expand Down Expand Up @@ -123,9 +128,7 @@ public void processElement(ProcessContext c) throws Exception {
new ReduceFnRunner<>(
key,
windowingStrategy,
ExecutableTriggerStateMachine.create(
TriggerStateMachines.stateMachineForTrigger(
TriggerTranslation.toProto(windowingStrategy.getTrigger()))),
triggerStateMachine,
stateInternals,
timerInternals,
outputWindowedValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.apache.datasketches.quantiles.UpdateDoublesSketch;
import org.checkerframework.checker.nullness.qual.Nullable;


/**
* Data describing the the distribution. This should retain enough detail that it can be combined
* with other {@link DistributionData}.
Expand Down

0 comments on commit 10074a9

Please sign in to comment.