org.apache.hadoop.hbase.io.hfile
Class FixedFileTrailer
java.lang.Object
org.apache.hadoop.hbase.io.hfile.FixedFileTrailer
public class FixedFileTrailer
- extends Object
The HFile
has a fixed trailer which contains offsets to other
variable parts of the file. Also includes basic metadata on this file. The
trailer size is fixed within a given HFile
format version only, but
we always store the version number as the last four-byte integer of the file.
getTrailerSize
public int getTrailerSize()
toString
public String toString()
- Overrides:
toString
in class Object
readFromStream
public static FixedFileTrailer readFromStream(org.apache.hadoop.fs.FSDataInputStream istream,
long fileSize)
throws IOException
- Reads a file trailer from the given file.
- Parameters:
istream
- the input stream with the ability to seek. Does not have to
be buffered, as only one read operation is made.fileSize
- the file size. Can be obtained using
FileSystem.getFileStatus(
org.apache.hadoop.fs.Path)
.
- Returns:
- the fixed file trailer read
- Throws:
IOException
- if failed to read from the underlying stream, or the
trailer is corrupted, or the version of the trailer is
unsupported
expectVersion
public void expectVersion(int expected)
expectAtLeastVersion
public void expectAtLeastVersion(int lowerBound)
getFileInfoOffset
public long getFileInfoOffset()
setFileInfoOffset
public void setFileInfoOffset(long fileInfoOffset)
getLoadOnOpenDataOffset
public long getLoadOnOpenDataOffset()
setLoadOnOpenOffset
public void setLoadOnOpenOffset(long loadOnOpenDataOffset)
getDataIndexCount
public int getDataIndexCount()
setDataIndexCount
public void setDataIndexCount(int dataIndexCount)
getMetaIndexCount
public int getMetaIndexCount()
setMetaIndexCount
public void setMetaIndexCount(int metaIndexCount)
getTotalUncompressedBytes
public long getTotalUncompressedBytes()
setTotalUncompressedBytes
public void setTotalUncompressedBytes(long totalUncompressedBytes)
getEntryCount
public long getEntryCount()
setEntryCount
public void setEntryCount(long newEntryCount)
getCompressionCodec
public Compression.Algorithm getCompressionCodec()
setCompressionCodec
public void setCompressionCodec(Compression.Algorithm compressionCodec)
getNumDataIndexLevels
public int getNumDataIndexLevels()
setNumDataIndexLevels
public void setNumDataIndexLevels(int numDataIndexLevels)
getLastDataBlockOffset
public long getLastDataBlockOffset()
setLastDataBlockOffset
public void setLastDataBlockOffset(long lastDataBlockOffset)
getFirstDataBlockOffset
public long getFirstDataBlockOffset()
setFirstDataBlockOffset
public void setFirstDataBlockOffset(long firstDataBlockOffset)
getVersion
public int getVersion()
setComparatorClass
public void setComparatorClass(Class<? extends org.apache.hadoop.io.RawComparator> klass)
createComparator
public static org.apache.hadoop.io.RawComparator<byte[]> createComparator(String comparatorClassName)
throws IOException
- Throws:
IOException
getUncompressedDataIndexSize
public long getUncompressedDataIndexSize()
setUncompressedDataIndexSize
public void setUncompressedDataIndexSize(long uncompressedDataIndexSize)
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.