Repository: beam Updated Branches: refs/heads/master 29399fde8 -> 727253ee3
Fork Data Service Libraries to java-fn-execution Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/70311595 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/70311595 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/70311595 Branch: refs/heads/master Commit: 70311595b37fb3dfb8c2d2c994aa2074903db3db Parents: 9ed655b Author: Thomas Groh <tg...@google.com> Authored: Mon Nov 6 15:04:33 2017 -0800 Committer: Thomas Groh <tg...@google.com> Committed: Wed Nov 8 16:43:42 2017 -0800 ---------------------------------------------------------------------- .../beam/runners/core/fn/FnDataReceiver.java | 4 +++ .../beam/runners/core/fn/FnDataService.java | 4 +++ .../runners/core/fn/SdkHarnessDoFnRunner.java | 8 +++++- .../fnexecution/data/FnDataReceiver.java | 27 ++++++++++++++++++++ .../runners/fnexecution/data/package-info.java | 23 +++++++++++++++++ 5 files changed, 65 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/70311595/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataReceiver.java ---------------------------------------------------------------------- diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataReceiver.java b/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataReceiver.java index e9928a7..639d678 100644 --- a/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataReceiver.java +++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataReceiver.java @@ -27,7 +27,11 @@ import java.io.Closeable; * * <p>Register a target with a {@link FnDataService} to gain a {@link FnDataReceiver} to which you * may write outgoing data. + * + * @deprecated Runners should depend on the beam-runners-java-fn-execution module for this + * functionality. */ +@Deprecated public interface FnDataReceiver<T> extends Closeable { void accept(T input) throws Exception; } http://git-wip-us.apache.org/repos/asf/beam/blob/70311595/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataService.java ---------------------------------------------------------------------- diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataService.java b/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataService.java index fdde79c..2a6777e 100644 --- a/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataService.java +++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/FnDataService.java @@ -27,7 +27,11 @@ import org.apache.beam.sdk.util.WindowedValue; * The {@link FnDataService} is able to forward inbound elements to a consumer and is also a * consumer of outbound elements. Callers can register themselves as consumers for inbound elements * or can get a handle for a consumer for outbound elements. + * + * @deprecated Runners should depend on the beam-runners-java-fn-execution module for this + * functionality. */ +@Deprecated public interface FnDataService { /** http://git-wip-us.apache.org/repos/asf/beam/blob/70311595/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/SdkHarnessDoFnRunner.java ---------------------------------------------------------------------- diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/SdkHarnessDoFnRunner.java b/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/SdkHarnessDoFnRunner.java index ec4d344..d27077f 100644 --- a/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/SdkHarnessDoFnRunner.java +++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/fn/SdkHarnessDoFnRunner.java @@ -29,7 +29,13 @@ import org.apache.beam.sdk.util.UserCodeException; import org.apache.beam.sdk.util.WindowedValue; import org.joda.time.Instant; -/** Processes a bundle by sending it to an SDK harness over the Fn API. */ +/** + * Processes a bundle by sending it to an SDK harness over the Fn API. + * + * @deprecated Runners should interact with the Control and Data plane directly, rather than through + * a {@link DoFnRunner}. Consider the beam-runners-java-fn-execution artifact instead. + */ +@Deprecated public class SdkHarnessDoFnRunner<InputT, OutputT> implements DoFnRunner<InputT, OutputT> { private final SdkHarnessClient sdkHarnessClient; http://git-wip-us.apache.org/repos/asf/beam/blob/70311595/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/FnDataReceiver.java ---------------------------------------------------------------------- diff --git a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/FnDataReceiver.java b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/FnDataReceiver.java new file mode 100644 index 0000000..5573d94 --- /dev/null +++ b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/FnDataReceiver.java @@ -0,0 +1,27 @@ +/* + * 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.runners.fnexecution.data; + +import java.io.Closeable; + +/** + * A receiver of streamed data. + */ +public interface FnDataReceiver<T> extends Closeable { + void accept(T input) throws Exception; +} http://git-wip-us.apache.org/repos/asf/beam/blob/70311595/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/package-info.java ---------------------------------------------------------------------- diff --git a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/package-info.java b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/package-info.java new file mode 100644 index 0000000..4c0a269 --- /dev/null +++ b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/data/package-info.java @@ -0,0 +1,23 @@ +/* + * 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. + */ + +/** + * Utilities for a Beam runner to interact with the Fn API {@link + * org.apache.beam.model.fnexecution.v1.BeamFnDataGrpc Data Service} via java abstractions. + */ +package org.apache.beam.runners.fnexecution.data;