public class SplittableCompressedFileSplit extends FileSplit
CompressedFileSplit
only works with formats that do not support
splitting (i.e. one split is used that represents the whole file).Constructor and Description |
---|
SplittableCompressedFileSplit(Path path,
long startOffset,
long length,
CompressionFormat format)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
FileSplit |
authorize(FileClient client)
Creates an identical split which will use the specified authorization
context for access.
|
CompressionFormat |
getCompressionFormat()
Get the compression format.
|
InputStream |
openSource()
Opens the underlying source for access.
|
SplitInputStream |
openSplit(int buffer)
Opens the split for reading using the specified
size for the read buffer.
|
getEndOffset, getFileClient, getLength, getPath, getStartOffset, toString
public SplittableCompressedFileSplit(Path path, long startOffset, long length, CompressionFormat format)
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)public FileSplit authorize(FileClient client)
DataSplit
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.
public InputStream openSource() throws IOException
DataSplit
DataSplit.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.
openSource
in interface DataSplit
openSource
in class FileSplit
IOException
- if an I/O error occurs opening
the underlying sourcepublic SplitInputStream openSplit(int buffer) throws IOException
DataSplit
SplitInputStreamImpl.hasOverrun()
.openSplit
in interface DataSplit
openSplit
in class FileSplit
buffer
- the size of the buffer to use for reads,
in bytesIOException
- if an I/O error occurs opening
the underlying sourcepublic CompressionFormat getCompressionFormat()
Copyright © 2016 Actian Corporation. All rights reserved.