Interface RemoteBundle
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
SdkHarnessClient.BundleProcessor.ActiveBundle
public interface RemoteBundle extends java.lang.AutoCloseableA bundle capable of handling input data elements for abundle descriptorby forwarding them to a remote environment for processing.When a RemoteBundle is closed, it will block until bundle processing is finished on remote resources, and throw an exception if bundle processing has failed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes this bundle.java.lang.StringgetId()Get an id used to represent this bundle.java.util.Map<java.lang.String,org.apache.beam.sdk.fn.data.FnDataReceiver>getInputReceivers()Get a map of PCollection ids toreceivers which consume input elements, forwarding them to the remote environment.java.util.Map<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>,org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.construction.Timer>>getTimerReceivers()Get a map of (transform id, timer id) toreceivers which consume timers, forwarding them to the remote environment.voidrequestProgress()Ask the remote bundle for progress.voidsplit(double fractionOfRemainder)Ask the remote bundle to split its current processing based upon its knowledge of remaining work.
-
-
-
Method Detail
-
getId
java.lang.String getId()
Get an id used to represent this bundle.
-
getInputReceivers
java.util.Map<java.lang.String,org.apache.beam.sdk.fn.data.FnDataReceiver> getInputReceivers()
Get a map of PCollection ids toreceivers which consume input elements, forwarding them to the remote environment.
-
getTimerReceivers
java.util.Map<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>,org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.construction.Timer>> getTimerReceivers()
Get a map of (transform id, timer id) toreceivers which consume timers, forwarding them to the remote environment.
-
requestProgress
void requestProgress()
Ask the remote bundle for progress.This method is a no-op if the bundle is complete otherwise it will return after the request has been issued. Any progress reports will be forwarded to the
BundleProgressHandler.All
BundleProgressHandler.onProgress(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleProgressResponse)calls are guaranteed to be called before anyBundleProgressHandler.onCompleted(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleResponse).
-
split
void split(double fractionOfRemainder)
Ask the remote bundle to split its current processing based upon its knowledge of remaining work. A fraction of 0, is equivalent to asking the SDK to checkpoint.This method is a no-op if the bundle is complete otherwise it will return after the request has been issued. Any splits will be forwarded to the
BundleSplitHandler.All
BundleSplitHandler.split(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleSplitResponse)calls are guaranteed to be called before anyBundleCheckpointHandler.onCheckpoint(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleResponse).
-
close
void close() throws java.lang.ExceptionCloses this bundle. This causes the inputFnDataReceiverto be closed (future calls to thatFnDataReceiverwill throw an exception), and causes theRemoteBundleto produce any buffered outputs. The call toclose()will block until all of the outputs produced by this bundle have been received and all outstanding progress and split requests have been handled.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-