Class SequenceFileBatchReader
java.lang.Object
org.apache.drill.exec.store.easy.sequencefile.SequenceFileBatchReader
- All Implemented Interfaces:
ManagedReader
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.physical.impl.scan.v3.ManagedReader
ManagedReader.EarlyEofException
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSequenceFileBatchReader
(SequenceFileFormatConfig config, EasySubScan scan, FileSchemaNegotiator negotiator) -
Method Summary
-
Field Details
-
KEY_SCHEMA
- See Also:
-
VALUE_SCHEMA
- See Also:
-
-
Constructor Details
-
SequenceFileBatchReader
public SequenceFileBatchReader(SequenceFileFormatConfig config, EasySubScan scan, FileSchemaNegotiator negotiator)
-
-
Method Details
-
next
public boolean next()Description copied from interface:ManagedReader
Read the next batch. Reading continues until either EOF, or until the mutator indicates that the batch is full. The batch is considered valid if it is non-empty. Returning true with an empty batch is valid, and is helpful on the very first batch (returning schema only.) An empty batch with a false return code indicates EOF and the batch will be discarded. A non-empty batch along with a false return result indicates a final, valid batch, but that EOF was reached and no more data is available.This somewhat complex protocol avoids the need to allocate a final batch just to find out that no more data is available; it allows EOF to be returned along with the final batch.
- Specified by:
next
in interfaceManagedReader
- Returns:
- true if more data may be available (and so next() should be called again, false to indicate that EOF was reached
-
close
public void close()Description copied from interface:ManagedReader
Release resources. Called just after a failure, when the scanner is cancelled, or after next() returns EOF. Release all resources and close files. Guaranteed to be called if open() returns normally; will not be called if open() throws an exception.- Specified by:
close
in interfaceManagedReader
-