Package org.apache.beam.sdk.fn.stream
Class DataStreams
- java.lang.Object
-
- org.apache.beam.sdk.fn.stream.DataStreams
-
public class DataStreams extends java.lang.ObjectDataStreams.DataStreamDecodertreats multipleByteStrings as a single input stream decoding values with the supplied iterator.outbound(OutputChunkConsumer)treats a singleOutputStreamas multipleByteStrings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataStreams.DataStreamDecoder<T>An adapter which converts anInputStreamto aPrefetchableIteratorofTvalues using the specifiedCoder.static classDataStreams.ElementDelimitedOutputStreamAn adapter which wraps anDataStreams.OutputChunkConsumeras anOutputStream.static interfaceDataStreams.OutputChunkConsumer<T>A callback which is invoked whenever theoutbound(org.apache.beam.sdk.fn.stream.DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString>)OutputStreambecomes full.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_OUTBOUND_BUFFER_LIMIT_BYTES
-
Constructor Summary
Constructors Constructor Description DataStreams()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataStreams.ElementDelimitedOutputStreamoutbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString> consumer)Converts a single element delimitedOutputStreaminto multipleByteStrings.static DataStreams.ElementDelimitedOutputStreamoutbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString> consumer, int maximumChunkSize)Converts a single element delimitedOutputStreaminto multipleByteStringsusing the specified maximum chunk size.
-
-
-
Field Detail
-
DEFAULT_OUTBOUND_BUFFER_LIMIT_BYTES
public static final int DEFAULT_OUTBOUND_BUFFER_LIMIT_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
outbound
public static DataStreams.ElementDelimitedOutputStream outbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString> consumer)
Converts a single element delimitedOutputStreaminto multipleByteStrings.Note that users must call
DataStreams.ElementDelimitedOutputStream.delimitElement()after each element.Note that this
OutputStreamfollows the Beam Fn API specification for forcing values that encode producing zero bytes to produce exactly one byte.
-
outbound
public static DataStreams.ElementDelimitedOutputStream outbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString> consumer, int maximumChunkSize)
Converts a single element delimitedOutputStreaminto multipleByteStringsusing the specified maximum chunk size.Note that users must call
DataStreams.ElementDelimitedOutputStream.delimitElement()after each element.Note that this
OutputStreamfollows the Beam Fn API specification for forcing values that encode producing zero bytes to produce exactly one byte.
-
-