java.lang.Object
com.pervasive.datarush.io.FileSplit
com.pervasive.datarush.io.SplittableCompressedFileSplit
- All Implemented Interfaces:
DataSplit,Serializable
Represents a file split for a compression format that supports splitting. The
CompressedFileSplit only works with formats that do not support
splitting (i.e. one split is used that represents the whole file).- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSplittableCompressedFileSplit(Path path, long startOffset, long length, CompressionFormat format) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionauthorize(FileClient client) Creates an identical split which will use the specified authorization context for access.Get the compression format.Opens the underlying source for access.openSplit(int buffer) Opens the split for reading using the specified size for the read buffer.Methods inherited from class com.pervasive.datarush.io.FileSplit
getEndOffset, getFileClient, getLength, getPath, getStartOffset, toString
-
Constructor Details
-
SplittableCompressedFileSplit
public SplittableCompressedFileSplit(Path path, long startOffset, long length, CompressionFormat format) Construct an instance.- Parameters:
path- path to the file to readstartOffset- starting offset of this split within the filelength- length (in bytes) of the splitformat- compression format (must support splitting)
-
-
Method Details
-
authorize
Description copied from interface:DataSplitCreates an identical split which will use the specified authorization context for access.This method is used by clients of the IO APIs which want to provide an alternative to the OS-level authorization inherited from the JVM's execution environment. Data access methods for the split will use the supplied context.
The authorization context is not a serializable attribute of a data split, as it represents the environment in which the data in accesses, not a property of the data itself. The context is associated with the split as a matter of convenience.
-
openSource
Description copied from interface:DataSplitOpens the underlying source for access. Initially, the stream is positioned at the first byte of the source. UnlikeDataSplit.openSplit(int), the caller is responsible for making sure accesses are aligned to split boundaries. The stream is also unbuffered.This method may be required for dealing with formats which store metadata at the beginning of the file.
- Specified by:
openSourcein interfaceDataSplit- Overrides:
openSourcein classFileSplit- Returns:
- a reader of the data in the underlying source
- Throws:
IOException- if an I/O error occurs opening the underlying source
-
openSplit
Description copied from interface:DataSplitOpens the split for reading using the specified size for the read buffer. The reader will initially be positioned at the first byte of the split. The reader will indicate when the last byte of the split has been read viaSplitInputStreamImpl.hasOverrun().- Specified by:
openSplitin interfaceDataSplit- Overrides:
openSplitin classFileSplit- Parameters:
buffer- the size of the buffer to use for reads, in bytes- Returns:
- a reader of the data in the split
- Throws:
IOException- if an I/O error occurs opening the underlying source
-
getCompressionFormat
Get the compression format.- Returns:
- compressionFormat
-