public class CompressionMetadata
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CompressionMetadata.Chunk
Holds offset and length of the file chunk
|
static class |
CompressionMetadata.Writer |
Modifier and Type | Field and Description |
---|---|
ChecksumType |
checksumType |
long |
compressedFileLength |
long |
dataLength |
java.lang.String |
indexFilePath |
CompressionParams |
parameters |
Constructor and Description |
---|
CompressionMetadata(java.lang.String indexFilePath,
long compressedLength,
ChecksumType checksumType) |
Modifier and Type | Method and Description |
---|---|
void |
addTo(Ref.IdentityCollection identities) |
CompressionMetadata.Chunk |
chunkFor(long position)
Get a chunk of compressed data (offset, length) corresponding to given position
|
int |
chunkLength() |
void |
close() |
ICompressor |
compressor() |
static CompressionMetadata |
create(java.lang.String dataFilePath)
Create metadata about given compressed file including uncompressed data length, chunk size
and list of the chunk offsets of the compressed data.
|
CompressionMetadata.Chunk[] |
getChunksForSections(java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections) |
long |
getTotalSizeForSections(java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections) |
long |
offHeapSize()
Returns the amount of memory in bytes used off heap.
|
public final long dataLength
public final long compressedFileLength
public final java.lang.String indexFilePath
public final CompressionParams parameters
public final ChecksumType checksumType
public CompressionMetadata(java.lang.String indexFilePath, long compressedLength, ChecksumType checksumType)
public static CompressionMetadata create(java.lang.String dataFilePath)
dataFilePath
- Path to the compressed filepublic ICompressor compressor()
public int chunkLength()
public long offHeapSize()
public void addTo(Ref.IdentityCollection identities)
public CompressionMetadata.Chunk chunkFor(long position)
position
- Position in the file.public long getTotalSizeForSections(java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections)
sections
- Collection of sections in uncompressed file. Should not contain sections that overlap each other.public CompressionMetadata.Chunk[] getChunksForSections(java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections)
sections
- Collection of sections in uncompressed filepublic void close()
Copyright © 2017 The Apache Software Foundation