Package cz.o2.proxima.direct.io.hadoop
Class HadoopBatchLogReader
- java.lang.Object
-
- cz.o2.proxima.direct.io.hadoop.HadoopBatchLogReader
-
- All Implemented Interfaces:
BatchLogReader
public class HadoopBatchLogReader extends java.lang.Object implements BatchLogReader
Reader of data stored inSequenceFiles
in HDFS.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.batch.BatchLogReader
BatchLogReader.Factory<T extends BatchLogReader>
-
-
Constructor Summary
Constructors Constructor Description HadoopBatchLogReader(HadoopDataAccessor accessor, Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchLogReader.Factory<?>
asFactory()
Convert instance of this reader toBatchLogReader.Factory
suitable for serialization.java.util.List<Partition>
getPartitions(long startStamp, long endStamp)
Retrieve list of partitions covering data from the given range.ObserveHandle
observe(java.util.List<Partition> partitions, java.util.List<AttributeDescriptor<?>> attributes, BatchLogObserver observer)
Observe data stored in given partitions.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.direct.core.batch.BatchLogReader
getPartitions, getPartitions, observeOffsets
-
-
-
-
Constructor Detail
-
HadoopBatchLogReader
public HadoopBatchLogReader(HadoopDataAccessor accessor, Context context)
-
-
Method Detail
-
getPartitions
public java.util.List<Partition> getPartitions(long startStamp, long endStamp)
Description copied from interface:BatchLogReader
Retrieve list of partitions covering data from the given range.- Specified by:
getPartitions
in interfaceBatchLogReader
- Parameters:
startStamp
- starting timestamp (inclusive)endStamp
- ending timestamp (exclusive)- Returns:
- list of partitions covering the time range
-
observe
public ObserveHandle observe(java.util.List<Partition> partitions, java.util.List<AttributeDescriptor<?>> attributes, BatchLogObserver observer)
Description copied from interface:BatchLogReader
Observe data stored in given partitions.- Specified by:
observe
in interfaceBatchLogReader
- Parameters:
partitions
- partitions to observeattributes
- attribute descriptors to filter outobserver
- the observer by which to consume the data- Returns:
- an
ObserveHandle
to control the consumption
-
asFactory
public BatchLogReader.Factory<?> asFactory()
Description copied from interface:BatchLogReader
Convert instance of this reader toBatchLogReader.Factory
suitable for serialization.- Specified by:
asFactory
in interfaceBatchLogReader
- Returns:
- the
BatchLogReader.Factory
representing this reader
-
-