Class SdkHarnessClient.BundleProcessor.ActiveBundle
- java.lang.Object
-
- org.apache.beam.runners.fnexecution.control.SdkHarnessClient.BundleProcessor.ActiveBundle
-
- All Implemented Interfaces:
java.lang.AutoCloseable,RemoteBundle
- Enclosing class:
- SdkHarnessClient.BundleProcessor
public class SdkHarnessClient.BundleProcessor.ActiveBundle extends java.lang.Object implements RemoteBundle
An active bundle for a particularBeamFnApi.ProcessBundleDescriptor.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Blocks until bundle processing is finished.java.lang.StringgetId()Returns 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
public java.lang.String getId()
Returns an id used to represent this bundle.- Specified by:
getIdin interfaceRemoteBundle
-
getInputReceivers
public 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.- Specified by:
getInputReceiversin interfaceRemoteBundle
-
getTimerReceivers
public 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()
Description copied from interface:RemoteBundleGet a map of (transform id, timer id) toreceivers which consume timers, forwarding them to the remote environment.- Specified by:
getTimerReceiversin interfaceRemoteBundle
-
requestProgress
public void requestProgress()
Description copied from interface:RemoteBundleAsk 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).- Specified by:
requestProgressin interfaceRemoteBundle
-
split
public void split(double fractionOfRemainder)
Description copied from interface:RemoteBundleAsk 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).- Specified by:
splitin interfaceRemoteBundle
-
close
public void close() throws java.lang.ExceptionBlocks until bundle processing is finished. This is comprised of:- closing each
input receiver. - closing each
timer receiver. - waiting for the SDK to say that processing the bundle is finished.
- waiting for all inbound data clients to complete
This method will throw an exception if bundle processing has failed.
Throwable.getSuppressed()will return all the reasons as to why processing has failed.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceRemoteBundle- Throws:
java.lang.Exception
- closing each
-
-