@InterfaceAudience.Private public class HStoreFile extends Object implements StoreFile
StoreFileWriter.Builder
and append data. Be sure to add any metadata before calling close on the
Writer (Use the appendMetadata convenience methods). On close, a StoreFile
is sitting in the Filesystem. To refer to it, create a StoreFile instance
passing filesystem and path. To read, call initReader()
StoreFiles may also reference store files in another Store. The reason for this weird pattern where you use a different instance for the writer and a reader is that we write once but read a lot more.
BLOOM_FILTER_TYPE_KEY, BULKLOAD_TASK_KEY, BULKLOAD_TIME_KEY, DELETE_FAMILY_COUNT, EARLIEST_PUT_TS, EXCLUDE_FROM_MINOR_COMPACTION_KEY, LAST_BLOOM_KEY, MAJOR_COMPACTION_KEY, MAX_SEQ_ID_KEY, MOB_CELLS_COUNT, SKIP_RESET_SEQ_ID, STORE_FILE_READER_NO_READAHEAD, TIMERANGE_KEY| Constructor and Description |
|---|
HStoreFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType cfBloomType)
Deprecated.
Now we will specific whether the StoreFile is for primary replica when
constructing, so please use
HStoreFile(FileSystem, Path, Configuration,
CacheConfig, BloomType, boolean) directly. |
HStoreFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType cfBloomType,
boolean primaryReplica)
Constructor, loads a reader and it's indices, etc.
|
HStoreFile(org.apache.hadoop.fs.FileSystem fs,
StoreFileInfo fileInfo,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType cfBloomType)
Deprecated.
Now we will specific whether the StoreFile is for primary replica when
constructing, so please use
HStoreFile(FileSystem, StoreFileInfo,
Configuration, CacheConfig, BloomType, boolean) directly. |
HStoreFile(org.apache.hadoop.fs.FileSystem fs,
StoreFileInfo fileInfo,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType cfBloomType,
boolean primaryReplica)
Constructor, loads a reader and it's indices, etc.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeReader(boolean evictOnClose) |
void |
deleteReader()
Delete this file
|
boolean |
excludeFromMinorCompaction() |
OptionalLong |
getBulkLoadTimestamp()
Return the timestamp at which this bulk load file was generated.
|
CacheConfig |
getCacheConf() |
Comparator<Cell> |
getComparator() |
StoreFileInfo |
getFileInfo() |
Cell |
getFirstKey() |
HDFSBlocksDistribution |
getHDFSBlockDistribution() |
Cell |
getLastKey() |
OptionalLong |
getMaximumTimestamp() |
long |
getMaxMemstoreTS() |
long |
getMaxSequenceId() |
byte[] |
getMetadataValue(byte[] key)
Only used by the Striped Compaction Policy
|
OptionalLong |
getMinimumTimestamp() |
long |
getModificationTimeStamp() |
org.apache.hadoop.fs.Path |
getPath() |
StoreFileScanner |
getPreadScanner(boolean cacheBlocks,
long readPt,
long scannerOrder,
boolean canOptimizeForNonNullColumn)
Must be called after initReader.
|
org.apache.hadoop.fs.Path |
getQualifiedPath() |
StoreFileReader |
getReader() |
int |
getRefCount() |
StoreFileScanner |
getStreamScanner(boolean canUseDropBehind,
boolean cacheBlocks,
boolean isCompaction,
long readPt,
long scannerOrder,
boolean canOptimizeForNonNullColumn) |
void |
initReader()
Initialize the reader used for pread.
|
boolean |
isBulkLoadResult()
Check if this storefile was created by bulk load.
|
boolean |
isCompactedAway() |
boolean |
isHFile() |
boolean |
isMajorCompactionResult() |
boolean |
isReference() |
boolean |
isReferencedInReads() |
void |
markCompactedAway()
Marks the status of the file as compactedAway.
|
String |
toString() |
String |
toStringDetailed() |
@Deprecated public HStoreFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, BloomType cfBloomType) throws IOException
HStoreFile(FileSystem, Path, Configuration,
CacheConfig, BloomType, boolean) directly.fs - The current file system to use.p - The path of the file.conf - The current configuration.cacheConf - The cache configuration and block cache reference.cfBloomType - The bloom type to use for this store file as specified by column family
configuration. This may or may not be the same as the Bloom filter type actually
present in the HFile, because column family configuration might change. If this is
BloomType.NONE, the existing Bloom filter is ignored.IOExceptionpublic HStoreFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType cfBloomType,
boolean primaryReplica)
throws IOException
fs - The current file system to use.p - The path of the file.conf - The current configuration.cacheConf - The cache configuration and block cache reference.cfBloomType - The bloom type to use for this store file as specified by column family
configuration. This may or may not be the same as the Bloom filter type actually
present in the HFile, because column family configuration might change. If this is
BloomType.NONE, the existing Bloom filter is ignored.primaryReplica - true if this is a store file for primary replica, otherwise false.IOException@Deprecated public HStoreFile(org.apache.hadoop.fs.FileSystem fs, StoreFileInfo fileInfo, org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, BloomType cfBloomType) throws IOException
HStoreFile(FileSystem, StoreFileInfo,
Configuration, CacheConfig, BloomType, boolean) directly.fs - The current file system to use.fileInfo - The store file information.conf - The current configuration.cacheConf - The cache configuration and block cache reference.cfBloomType - The bloom type to use for this store file as specified by column family
configuration. This may or may not be the same as the Bloom filter type actually
present in the HFile, because column family configuration might change. If this is
BloomType.NONE, the existing Bloom filter is ignored.IOExceptionpublic HStoreFile(org.apache.hadoop.fs.FileSystem fs,
StoreFileInfo fileInfo,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType cfBloomType,
boolean primaryReplica)
fs - fs The current file system to use.fileInfo - The store file information.conf - The current configuration.cacheConf - The cache configuration and block cache reference.cfBloomType - The bloom type to use for this store file as specified by column
family configuration. This may or may not be the same as the Bloom filter type
actually present in the HFile, because column family configuration might change. If
this is BloomType.NONE, the existing Bloom filter is ignored.primaryReplica - true if this is a store file for primary replica, otherwise false.public CacheConfig getCacheConf()
getCacheConf in interface StoreFilepublic Cell getFirstKey()
getFirstKey in interface StoreFilepublic Cell getLastKey()
getLastKey in interface StoreFilepublic Comparator<Cell> getComparator()
getComparator in interface StoreFilepublic long getMaxMemstoreTS()
getMaxMemstoreTS in interface StoreFilepublic StoreFileInfo getFileInfo()
getFileInfo in interface StoreFilepublic org.apache.hadoop.fs.Path getPath()
public org.apache.hadoop.fs.Path getQualifiedPath()
getQualifiedPath in interface StoreFilepublic boolean isReference()
isReference in interface StoreFilepublic boolean isHFile()
public boolean isMajorCompactionResult()
isMajorCompactionResult in interface StoreFilepublic boolean excludeFromMinorCompaction()
excludeFromMinorCompaction in interface StoreFilepublic long getMaxSequenceId()
getMaxSequenceId in interface StoreFilepublic long getModificationTimeStamp()
throws IOException
getModificationTimeStamp in interface StoreFileIOExceptionpublic byte[] getMetadataValue(byte[] key)
StoreFilegetMetadataValue in interface StoreFilepublic boolean isBulkLoadResult()
StoreFile'_SeqId_<id-when-loaded>' to the hfile name, unless
"hbase.mapreduce.bulkload.assign.sequenceNumbers" is explicitly turned off. If
"hbase.mapreduce.bulkload.assign.sequenceNumbers" is turned off, fall back to
BULKLOAD_TIME_KEY.isBulkLoadResult in interface StoreFilepublic boolean isCompactedAway()
isCompactedAway in interface StoreFilepublic int getRefCount()
public boolean isReferencedInReads()
isReferencedInReads in interface StoreFilepublic OptionalLong getBulkLoadTimestamp()
StoreFilegetBulkLoadTimestamp in interface StoreFilepublic HDFSBlocksDistribution getHDFSBlockDistribution()
getHDFSBlockDistribution in interface StoreFilepublic void initReader()
throws IOException
StoreFileinitReader in interface StoreFileIOExceptionpublic StoreFileScanner getPreadScanner(boolean cacheBlocks, long readPt, long scannerOrder, boolean canOptimizeForNonNullColumn)
StoreFilegetPreadScanner in interface StoreFilepublic StoreFileScanner getStreamScanner(boolean canUseDropBehind, boolean cacheBlocks, boolean isCompaction, long readPt, long scannerOrder, boolean canOptimizeForNonNullColumn) throws IOException
getStreamScanner in interface StoreFileIOExceptionpublic StoreFileReader getReader()
getReader in interface StoreFileStoreFile.initReader()public void closeReader(boolean evictOnClose)
throws IOException
closeReader in interface StoreFileevictOnClose - whether to evict blocks belonging to this fileIOExceptionpublic void markCompactedAway()
StoreFilemarkCompactedAway in interface StoreFilepublic void deleteReader()
throws IOException
StoreFiledeleteReader in interface StoreFileIOExceptionpublic String toStringDetailed()
toStringDetailed in interface StoreFilepublic OptionalLong getMinimumTimestamp()
getMinimumTimestamp in interface StoreFilepublic OptionalLong getMaximumTimestamp()
getMaximumTimestamp in interface StoreFileCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.