public class HFileReaderV1 extends AbstractHFileReader
HFile
reader for version 1. Does not support data block encoding,
even in cache only, i.e. HFile v1 blocks are always brought into cache
unencoded.Modifier and Type | Class and Description |
---|---|
protected static class |
HFileReaderV1.AbstractScannerV1 |
protected static class |
HFileReaderV1.ScannerV1
Implementation of
HFileScanner interface. |
AbstractHFileReader.BlockIndexNotLoadedException, AbstractHFileReader.NotSeekedException, AbstractHFileReader.Scanner
avgKeyLen, avgValueLen, cacheConf, closeIStream, comparator, compressAlgo, dataBlockEncoder, dataBlockIndexReader, fileInfo, fileSize, fsBlockReader, hfs, istream, istreamNoFsChecksum, lastKey, metaBlockIndexReader, name, path, trailer
SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE
Constructor and Description |
---|
HFileReaderV1(org.apache.hadoop.fs.Path path,
FixedFileTrailer trailer,
org.apache.hadoop.fs.FSDataInputStream fsdis,
long size,
boolean closeIStream,
CacheConfig cacheConf)
Opens a HFile.
|
Modifier and Type | Method and Description |
---|---|
protected int |
blockContainingKey(byte[] key,
int offset,
int length) |
void |
close() |
void |
close(boolean evictOnClose)
Close method with optional evictOnClose
|
DataInput |
getDeleteBloomFilterMetadata()
Retrieves delete family Bloom filter metadata as appropriate for each
HFile version. |
DataInput |
getGeneralBloomFilterMetadata()
Retrieves general Bloom filter metadata as appropriate for each
HFile version. |
byte[] |
getLastKey() |
ByteBuffer |
getMetaBlock(String metaBlockName,
boolean cacheBlock) |
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction)
Create a Scanner on this file.
|
boolean |
isFileInfoLoaded() |
org.apache.hadoop.hbase.io.hfile.HFile.FileInfo |
loadFileInfo()
Read in the index and file info.
|
byte[] |
midkey() |
HFileBlock |
readBlock(long offset,
long onDiskBlockSize,
boolean cacheBlock,
boolean pread,
boolean isCompaction,
BlockType expectedBlockType) |
getComparator, getCompressionAlgorithm, getDataBlockIndexReader, getEncodingOnDisk, getEntries, getFirstKey, getFirstRowKey, getLastRowKey, getName, getPath, getScanner, getTrailer, hasMVCCInfo, indexSize, length, toString, toStringFirstKey, toStringLastKey
createUnknown, getColumnFamilyName, getSchemaMetrics, getTableName, heapSize, isSchemaConfigured, passSchemaMetricsTo, resetSchemaMetricsConf, schemaConfAsJSON, schemaConfigurationChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getColumnFamilyName
getSchemaMetrics, getTableName
public HFileReaderV1(org.apache.hadoop.fs.Path path, FixedFileTrailer trailer, org.apache.hadoop.fs.FSDataInputStream fsdis, long size, boolean closeIStream, CacheConfig cacheConf) throws IOException
loadFileInfo()
.fsdis
- input stream. Caller is responsible for closing the passed
stream.size
- Length of the stream.cacheConf
- cache references and configurationIOException
public org.apache.hadoop.hbase.io.hfile.HFile.FileInfo loadFileInfo() throws IOException
loadFileInfo
in interface HFile.Reader
loadFileInfo
in class AbstractHFileReader
IOException
HFile.Writer.appendFileInfo(byte[], byte[])
public HFileScanner getScanner(boolean cacheBlocks, boolean pread, boolean isCompaction)
HFileScanner.seekTo(byte[])
to position an start the read. There is
nothing to clean up in a Scanner. Letting go of your references to the
scanner is sufficient.cacheBlocks
- True if we should cache blocks read in by this scanner.pread
- Use positional read rather than seek+read if true (pread is
better for random reads, seek+read is better scanning).isCompaction
- is scanner being used for a compaction?protected int blockContainingKey(byte[] key, int offset, int length)
key
- Key to search.public ByteBuffer getMetaBlock(String metaBlockName, boolean cacheBlock) throws IOException
metaBlockName
- cacheBlock
- Add block to cache, if foundIOException
public byte[] getLastKey()
public byte[] midkey() throws IOException
IOException
public void close() throws IOException
IOException
public void close(boolean evictOnClose) throws IOException
HFile.Reader
IOException
public HFileBlock readBlock(long offset, long onDiskBlockSize, boolean cacheBlock, boolean pread, boolean isCompaction, BlockType expectedBlockType)
public DataInput getGeneralBloomFilterMetadata() throws IOException
HFile.Reader
HFile
version.
Knows nothing about how that metadata is structured.IOException
public DataInput getDeleteBloomFilterMetadata() throws IOException
HFile.Reader
HFile
version.
Knows nothing about how that metadata is structured.IOException
public boolean isFileInfoLoaded()
isFileInfoLoaded
in class AbstractHFileReader
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.