Package cz.o2.proxima.beam.direct.io
Class DirectBatchUnboundedSource
- java.lang.Object
-
- org.apache.beam.sdk.io.Source<OutputT>
-
- org.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>
-
- cz.o2.proxima.beam.direct.io.DirectBatchUnboundedSource
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
public class DirectBatchUnboundedSource extends org.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>
Source reading fromBatchLogReaderin unbounded manner.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDirectBatchUnboundedSource.Checkpointstatic classDirectBatchUnboundedSource.CheckpointCoderUse gzip to compress the serialized checkpoint, as it might easily grow in size (batch partitions might contain many files).private static classDirectBatchUnboundedSource.StreamElementUnboundedReader
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AttributeDescriptor<?>>attributesstatic java.lang.StringCFG_ENABLE_CHECKPOINT_PARTITION_MERGEprivate booleanenableCheckpointPartitionMergeprivate longendStampprivate java.util.List<Partition>partitionsprivate BatchLogReaderreaderprivate BatchLogReader.Factory<?>readerFactoryprivate RepositoryFactoryrepositoryFactoryprivate static longserialVersionUIDprivate longstartStamp
-
Constructor Summary
Constructors Modifier Constructor Description privateDirectBatchUnboundedSource(DirectBatchUnboundedSource parent, java.util.List<Partition> partitions, long startStamp, long endStamp)privateDirectBatchUnboundedSource(RepositoryFactory repositoryFactory, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attributes, long startStamp, long endStamp, java.util.Map<java.lang.String,java.lang.Object> cfg)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>createReader(org.apache.beam.sdk.options.PipelineOptions options, DirectBatchUnboundedSource.Checkpoint checkpointMark)booleanequals(java.lang.Object o)private static booleangetBool(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> cfg)org.apache.beam.sdk.coders.Coder<DirectBatchUnboundedSource.Checkpoint>getCheckpointMarkCoder()org.apache.beam.sdk.coders.Coder<StreamElement>getOutputCoder()inthashCode()(package private) static booleanisEnableCheckpointPartitionMerge(java.util.Map<java.lang.String,java.lang.Object> cfg)(package private) static java.util.List<Partition>merge(boolean enabled, java.util.List<Partition> own, java.util.List<Partition> fromCheckpoint)static DirectBatchUnboundedSourceof(RepositoryFactory factory, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attrs, long startStamp, long endStamp, java.util.Map<java.lang.String,java.lang.Object> cfg)private BatchLogReaderreader()private voidreadObject(java.io.ObjectInputStream stream)java.util.List<? extends org.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>>split(int desiredNumSplits, org.apache.beam.sdk.options.PipelineOptions options)private voidwriteObject(java.io.ObjectOutputStream stream)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
CFG_ENABLE_CHECKPOINT_PARTITION_MERGE
public static final java.lang.String CFG_ENABLE_CHECKPOINT_PARTITION_MERGE
- See Also:
- Constant Field Values
-
repositoryFactory
private final RepositoryFactory repositoryFactory
-
readerFactory
private final BatchLogReader.Factory<?> readerFactory
-
attributes
private final java.util.List<AttributeDescriptor<?>> attributes
-
startStamp
private final long startStamp
-
endStamp
private final long endStamp
-
enableCheckpointPartitionMerge
private final boolean enableCheckpointPartitionMerge
-
reader
@Nullable private transient BatchLogReader reader
-
partitions
private transient java.util.List<Partition> partitions
-
-
Constructor Detail
-
DirectBatchUnboundedSource
private DirectBatchUnboundedSource(RepositoryFactory repositoryFactory, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attributes, long startStamp, long endStamp, java.util.Map<java.lang.String,java.lang.Object> cfg)
-
DirectBatchUnboundedSource
private DirectBatchUnboundedSource(DirectBatchUnboundedSource parent, java.util.List<Partition> partitions, long startStamp, long endStamp)
-
-
Method Detail
-
of
public static DirectBatchUnboundedSource of(RepositoryFactory factory, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attrs, long startStamp, long endStamp, java.util.Map<java.lang.String,java.lang.Object> cfg)
-
isEnableCheckpointPartitionMerge
static boolean isEnableCheckpointPartitionMerge(java.util.Map<java.lang.String,java.lang.Object> cfg)
-
getBool
private static boolean getBool(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> cfg)
-
split
public java.util.List<? extends org.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>> split(int desiredNumSplits, org.apache.beam.sdk.options.PipelineOptions options)
- Specified by:
splitin classorg.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>
-
createReader
public org.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement> createReader(org.apache.beam.sdk.options.PipelineOptions options, DirectBatchUnboundedSource.Checkpoint checkpointMark)
- Specified by:
createReaderin classorg.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>
-
merge
static java.util.List<Partition> merge(boolean enabled, java.util.List<Partition> own, java.util.List<Partition> fromCheckpoint)
-
reader
private BatchLogReader reader()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getCheckpointMarkCoder
public org.apache.beam.sdk.coders.Coder<DirectBatchUnboundedSource.Checkpoint> getCheckpointMarkCoder()
- Specified by:
getCheckpointMarkCoderin classorg.apache.beam.sdk.io.UnboundedSource<StreamElement,DirectBatchUnboundedSource.Checkpoint>
-
getOutputCoder
public org.apache.beam.sdk.coders.Coder<StreamElement> getOutputCoder()
- Overrides:
getOutputCoderin classorg.apache.beam.sdk.io.Source<StreamElement>
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-