public static class FileHandle.Builder
extends java.lang.Object
implements java.lang.AutoCloseable
Constructor and Description |
---|
Builder(ChannelProxy channel) |
Builder(java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
FileHandle.Builder |
bufferSize(int bufferSize)
Set the buffer size to use (if appropriate).
|
FileHandle.Builder |
bufferType(BufferType bufferType)
Set the buffer type (on heap or off heap) to use (if appropriate).
|
void |
close() |
java.lang.Throwable |
close(java.lang.Throwable accumulate) |
FileHandle |
complete()
Complete building
FileHandle without overriding file length. |
FileHandle |
complete(long overrideLength)
Complete building
FileHandle with the given length, which overrides the file length. |
FileHandle.Builder |
compressed(boolean compressed) |
FileHandle.Builder |
mmapped(boolean mmapped)
Set whether to use mmap for reading
|
FileHandle.Builder |
withChunkCache(ChunkCache chunkCache)
Set
ChunkCache to use. |
FileHandle.Builder |
withCompressionMetadata(CompressionMetadata metadata)
Provide
CompressionMetadata to use when reading compressed file. |
public Builder(java.lang.String path)
public Builder(ChannelProxy channel)
public FileHandle.Builder compressed(boolean compressed)
public FileHandle.Builder withChunkCache(ChunkCache chunkCache)
ChunkCache
to use.chunkCache
- ChunkCache object to use for cachingpublic FileHandle.Builder withCompressionMetadata(CompressionMetadata metadata)
CompressionMetadata
to use when reading compressed file.metadata
- CompressionMetadata to usepublic FileHandle.Builder mmapped(boolean mmapped)
mmapped
- true if using mmappublic FileHandle.Builder bufferSize(int bufferSize)
bufferSize
- Buffer size in bytespublic FileHandle.Builder bufferType(BufferType bufferType)
bufferType
- Buffer type to usepublic FileHandle complete()
FileHandle
without overriding file length.complete(long)
public FileHandle complete(long overrideLength)
FileHandle
with the given length, which overrides the file length.overrideLength
- Override file length (in bytes) so that read cannot go further than this value.
If the value is less than or equal to 0, then the value is ignored.public java.lang.Throwable close(java.lang.Throwable accumulate)
public void close()
close
in interface java.lang.AutoCloseable
Copyright © 2009-2021 The Apache Software Foundation