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 e9928a7051a57..639d678ad038f 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 @@ * *

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 extends Closeable { void accept(T input) throws Exception; } 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 fdde79cd4869b..2a6777e4bcd4b 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 @@ * 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 { /** 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 ec4d3443ae91e..d27077fdde3f7 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.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 implements DoFnRunner { private final SdkHarnessClient sdkHarnessClient; 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 0000000000000..5573d94f769bb --- /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 extends Closeable { + void accept(T input) throws Exception; +} 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 0000000000000..4c0a269393744 --- /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;