Class MultiplePinotSegmentRecordReader
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.readers.MultiplePinotSegmentRecordReader
-
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,RecordReader
public class MultiplePinotSegmentRecordReader extends Object implements RecordReader
Record reader for multiple pinot segments.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiplePinotSegmentRecordReader(List<File> indexDirs)Read records using the passed in schema from multiple pinot segments.MultiplePinotSegmentRecordReader(List<File> indexDirs, Set<String> fieldsToRead, List<String> sortOrder)Read records using the passed in schema and in the order of sorted column from multiple pinot segments.
-
Method Summary
Modifier and Type Method Description voidclose()booleanhasNext()voidinit(File dataFile, Set<String> fieldsToRead, RecordReaderConfig recordReaderConfig)GenericRownext()GenericRownext(GenericRow reuse)voidrewind()
-
-
-
Constructor Detail
-
MultiplePinotSegmentRecordReader
public MultiplePinotSegmentRecordReader(List<File> indexDirs) throws Exception
Read records using the passed in schema from multiple pinot segments.Passed in schema must be a subset of the segment schema.
- Parameters:
indexDirs- a list of input segment directory paths- Throws:
Exception
-
MultiplePinotSegmentRecordReader
public MultiplePinotSegmentRecordReader(List<File> indexDirs, @Nullable Set<String> fieldsToRead, @Nullable List<String> sortOrder) throws Exception
Read records using the passed in schema and in the order of sorted column from multiple pinot segments.Passed in schema must be a subset of the segment schema.
If sort order is not specified, it will not attempt to sort the segments and simply concatenate the records from muiltiple segments.
- Parameters:
indexDirs- a list of input paths for the segment indicesfieldsToRead- if null or empty, reads all fieldssortOrder- a list of column names that represent the sorting order- Throws:
Exception
-
-
Method Detail
-
init
public void init(File dataFile, Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig)
- Specified by:
initin interfaceRecordReader
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceRecordReader
-
next
public GenericRow next()
- Specified by:
nextin interfaceRecordReader
-
next
public GenericRow next(GenericRow reuse)
- Specified by:
nextin interfaceRecordReader
-
rewind
public void rewind()
- Specified by:
rewindin interfaceRecordReader
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-