@InterfaceAudience.Private public class HFileInfo extends Object implements SortedMap<byte[],byte[]>
append(byte[], byte[], boolean) and they'll be persisted and available at read time.
Reader creates the HFileInfo on open by reading the tail of the HFile. The parse of the HFile
trailer also creates a HFileContext, a read-only data structure that includes bulk of the
HFileInfo and extras that is safe to pass around when working on HFiles.HFileContext| Modifier and Type | Field and Description |
|---|---|
static byte[] |
MAX_TAGS_LEN |
| Constructor and Description |
|---|
HFileInfo() |
HFileInfo(ReaderContext context,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
HFileInfo |
append(byte[] k,
byte[] v,
boolean checkPrefix)
Append the given key/value pair to the file info, optionally checking the key prefix.
|
void |
clear() |
void |
close() |
Comparator<? super byte[]> |
comparator() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<byte[],byte[]>> |
entrySet() |
boolean |
equals(Object o) |
byte[] |
firstKey() |
byte[] |
get(Object key) |
int |
getAvgKeyLen() |
int |
getAvgValueLen() |
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.CellBasedKeyBlockIndexReader |
getDataBlockIndexReader() |
HFileContext |
getHFileContext() |
Cell |
getLastKeyCell() |
List<HFileBlock> |
getLoadOnOpenBlocks() |
int |
getMajorVersion() |
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.ByteArrayKeyBlockIndexReader |
getMetaBlockIndexReader() |
FixedFileTrailer |
getTrailer() |
int |
hashCode() |
SortedMap<byte[],byte[]> |
headMap(byte[] toKey) |
void |
initMetaAndIndex(HFile.Reader reader)
should be called after initTrailerAndContext
|
void |
initTrailerAndContext(ReaderContext context,
org.apache.hadoop.conf.Configuration conf) |
boolean |
isDecodeMemstoreTS() |
boolean |
isEmpty() |
static boolean |
isReservedFileInfoKey(byte[] key)
Return true if the given file info key is reserved for internal use.
|
Set<byte[]> |
keySet() |
byte[] |
lastKey() |
byte[] |
put(byte[] key,
byte[] value) |
void |
putAll(Map<? extends byte[],? extends byte[]> m) |
byte[] |
remove(Object key) |
void |
setTrailer(FixedFileTrailer trailer) |
boolean |
shouldIncludeMemStoreTS() |
int |
size() |
SortedMap<byte[],byte[]> |
subMap(byte[] fromKey,
byte[] toKey) |
SortedMap<byte[],byte[]> |
tailMap(byte[] fromKey) |
Collection<byte[]> |
values() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic HFileInfo()
public HFileInfo(ReaderContext context, org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionpublic HFileInfo append(byte[] k, byte[] v, boolean checkPrefix) throws IOException
k - key to addv - value to addcheckPrefix - whether to check that the provided key does not start with the reserved
prefixIOException - if the key or value is invalidpublic static boolean isReservedFileInfoKey(byte[] key)
public Comparator<? super byte[]> comparator()
comparator in interface SortedMap<byte[],byte[]>public boolean containsKey(Object key)
containsKey in interface Map<byte[],byte[]>public boolean containsValue(Object value)
containsValue in interface Map<byte[],byte[]>public boolean equals(Object o)
public int hashCode()
public SortedMap<byte[],byte[]> headMap(byte[] toKey)
public Set<byte[]> keySet()
public void putAll(Map<? extends byte[],? extends byte[]> m)
public SortedMap<byte[],byte[]> subMap(byte[] fromKey, byte[] toKey)
public SortedMap<byte[],byte[]> tailMap(byte[] fromKey)
public Collection<byte[]> values()
public void initTrailerAndContext(ReaderContext context, org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionpublic void initMetaAndIndex(HFile.Reader reader) throws IOException
IOExceptionpublic void close()
public int getMajorVersion()
public void setTrailer(FixedFileTrailer trailer)
public FixedFileTrailer getTrailer()
public org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.CellBasedKeyBlockIndexReader getDataBlockIndexReader()
public org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.ByteArrayKeyBlockIndexReader getMetaBlockIndexReader()
public HFileContext getHFileContext()
public List<HFileBlock> getLoadOnOpenBlocks()
public Cell getLastKeyCell()
public int getAvgKeyLen()
public int getAvgValueLen()
public boolean shouldIncludeMemStoreTS()
public boolean isDecodeMemstoreTS()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.