public interface HFileReader extends Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
SEEK_TO_BEFORE_FIRST_KEY |
static int |
SEEK_TO_EOF |
static int |
SEEK_TO_FOUND |
static int |
SEEK_TO_IN_RANGE |
| Modifier and Type | Method and Description |
|---|---|
Option<KeyValue> |
getKeyValue() |
Option<ByteBuffer> |
getMetaBlock(String metaBlockName)
Gets the content of a meta block from HFile.
|
Option<byte[]> |
getMetaInfo(UTF8StringKey key)
Gets info entry from file info block of a HFile.
|
long |
getNumKeyValueEntries() |
void |
initializeMetadata()
Initializes metadata based on a HFile before other read operations.
|
boolean |
isSeeked() |
boolean |
next()
Scans to the next entry in the file.
|
boolean |
seekTo()
Positions this reader at the start of the file.
|
int |
seekTo(Key key)
seekTo or just before the passed
Key. |
static final int SEEK_TO_BEFORE_FIRST_KEY
static final int SEEK_TO_FOUND
static final int SEEK_TO_IN_RANGE
static final int SEEK_TO_EOF
void initializeMetadata()
throws IOException
IOException - upon read errors.Option<byte[]> getMetaInfo(UTF8StringKey key) throws IOException
key - meta key.IOException - upon read errors.Option<ByteBuffer> getMetaBlock(String metaBlockName) throws IOException
metaBlockName - meta block name.IOException - upon read errors.long getNumKeyValueEntries()
int seekTo(Key key) throws IOException
Key. Examine the return code to figure whether we
found the key or not. Consider the key-value pairs in the file,
kv[0] .. kv[n-1], where there are n KV pairs in the file.
The position only moves forward so the caller has to make sure the keys are sorted before making multiple calls of this method.
key - Key to seek to.false when it is called.IOException - upon read errors.boolean seekTo()
throws IOException
false if empty file; i.e. a call to next would return false and
the current key and value are undefined.IOException - upon read errors.boolean next()
throws IOException
false if the current position is at the end;
otherwise true if more in file.IOException - upon read errors.Option<KeyValue> getKeyValue() throws IOException
KeyValue instance at current position.IOExceptionboolean isSeeked()
true if the reader has had one of the seek calls invoked; i.e.
seekTo() or seekTo(Key).
Otherwise, false.Copyright © 2024 The Apache Software Foundation. All rights reserved.