From 6c942435b52ab7f79ead3342e79154aab5e133bc Mon Sep 17 00:00:00 2001 From: bchambers Date: Wed, 18 May 2016 17:20:18 -0700 Subject: [PATCH] Add a compatibility stub of GABWViaWindowSetDoFn Direct calls to `org.apache.beam.sdk.util.GroupAlsoByWindowViaWindowSetDoFn#create` failed following the rename in 892ead2c. This re-introduces that method as a redirect to the new name to unbreak things while waiting for a complete fix. --- runners/google-cloud-dataflow-java/pom.xml | 5 +++ .../GroupAlsoByWindowViaWindowSetDoFn.java | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/sdk/util/GroupAlsoByWindowViaWindowSetDoFn.java diff --git a/runners/google-cloud-dataflow-java/pom.xml b/runners/google-cloud-dataflow-java/pom.xml index f7f1d8076f435..2b7b49d1bd604 100644 --- a/runners/google-cloud-dataflow-java/pom.xml +++ b/runners/google-cloud-dataflow-java/pom.xml @@ -287,6 +287,11 @@ java-sdk-all + + org.apache.beam + runners-core + + org.apache.avro avro diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/sdk/util/GroupAlsoByWindowViaWindowSetDoFn.java b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/sdk/util/GroupAlsoByWindowViaWindowSetDoFn.java new file mode 100644 index 0000000000000..42ebf94ab0658 --- /dev/null +++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/sdk/util/GroupAlsoByWindowViaWindowSetDoFn.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.util; + +import org.apache.beam.sdk.transforms.DoFn; +import org.apache.beam.sdk.transforms.windowing.BoundedWindow; +import org.apache.beam.sdk.values.KV; + +/** + * Stub class that exists for compatibility with code expecting + * {@link org.apache.beam.runners.core.GroupAlsoByWindowViaWindowSetDoFn} in the old location. + */ +public class GroupAlsoByWindowViaWindowSetDoFn { + + public static + DoFn, KV> create( + WindowingStrategy strategy, SystemReduceFn reduceFn) { + return org.apache.beam.runners.core.GroupAlsoByWindowViaWindowSetDoFn.create( + strategy, reduceFn); + } + + /** Prohibit instantiation. */ + private GroupAlsoByWindowViaWindowSetDoFn() {} +} +