public class BeamFnDataBufferingOutboundObserver<T> extends java.lang.Object implements CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>>
FnDataReceiver for the Beam Fn Data API.
 Encodes individually consumed elements with the provided Coder producing a single
 BeamFnApi.Elements message when the buffer threshold is surpassed.
 
The default buffer threshold can be overridden by specifying the experiment beam_fn_api_data_buffer_limit=<bytes>
 
TODO: Handle outputting large elements (> 2GiBs). Note that this also applies to the input side as well.
TODO: Handle outputting elements that are zero bytes by outputting a single byte as a marker, detect on the input side that no bytes were read and force reading a single byte.
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
BEAM_FN_API_DATA_BUFFER_LIMIT  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
accept(org.apache.beam.sdk.util.WindowedValue<T> t)  | 
void | 
close()
. 
 | 
void | 
flush()
Eagerly flushes any data that is buffered in this channel. 
 | 
static <T> BeamFnDataBufferingOutboundObserver<T> | 
forLocation(LogicalEndpoint endpoint,
           Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder,
           org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundObserver)  | 
static <T> BeamFnDataBufferingOutboundObserver<T> | 
forLocationWithBufferLimit(int bufferLimit,
                          LogicalEndpoint endpoint,
                          Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder,
                          org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundObserver)  | 
public static final java.lang.String BEAM_FN_API_DATA_BUFFER_LIMIT
public static <T> BeamFnDataBufferingOutboundObserver<T> forLocation(LogicalEndpoint endpoint, Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder, org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundObserver)
public static <T> BeamFnDataBufferingOutboundObserver<T> forLocationWithBufferLimit(int bufferLimit, LogicalEndpoint endpoint, Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder, org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundObserver)
public void close()
           throws java.lang.Exception
CloseableFnDataReceiverDoes nothing if this CloseableFnDataReceiver is already closed.
close in interface java.lang.AutoCloseableclose in interface CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>>java.lang.Exceptionpublic void flush()
           throws java.io.IOException
CloseableFnDataReceiverflush in interface CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>>java.io.IOExceptionpublic void accept(org.apache.beam.sdk.util.WindowedValue<T> t) throws java.io.IOException
accept in interface FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>>java.io.IOException