@InterfaceAudience.Private public interface HFileScanner extends Shipper, Closeable
A scanner doesn't always have a key/value that it is pointing to when it is first created and
before seekTo()/seekTo(Cell) are called. In this case,
getKey()/getValue() returns null. At most other times, a key and value will be
available. The general pattern is that you position the Scanner using the seekTo variants and
then getKey and getValue.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this HFile scanner and do necessary cleanup.
|
Cell |
getCell()
Returns Instance of
Cell. |
Cell |
getKey()
Gets the current key in the form of a cell.
|
String |
getKeyString()
Deprecated.
Since hbase-2.0.0
|
Cell |
getNextIndexedKey()
Returns the next key in the index (the key to seek to the next block)
|
HFile.Reader |
getReader()
Returns Reader that underlies this Scanner instance.
|
ByteBuffer |
getValue()
Gets a buffer view to the current value.
|
String |
getValueString()
Deprecated.
Since hbase-2.0.0
|
boolean |
isSeeked() |
boolean |
next()
Scans to the next entry in the file.
|
int |
reseekTo(Cell cell)
Reseek to or just before the passed
cell. |
boolean |
seekBefore(Cell cell)
Consider the cell stream of all the cells in the file,
c[0] .. |
boolean |
seekTo()
Positions this scanner at the start of the file.
|
int |
seekTo(Cell cell)
SeekTo or just before the passed
cell. |
int seekTo(Cell cell) throws IOException
cell. Examine the return code to figure whether
we found the cell or not. Consider the cell stream of all the cells in the file,
c[0] .. c[n], where there are n cells in the file.IOExceptionint reseekTo(Cell cell) throws IOException
cell. Similar to seekTo except that this can
be called even if the scanner is not at the beginning of a file. This can be used to seek only
to cells which come after the current position of the scanner. Consider the cell stream of all
the cells in the file, c[0] .. c[n], where there are n cellc in the file after
current position of HFileScanner. The scanner will position itself between c[i] and c[i+1]
where c[i] < cell <= c[i+1]. If there is no cell c[i+1] greater than or equal to the
input cell, then the scanner will position itself at the end of the file and next() will return
false when it is called.cell - Cell to find (should be non-null)IOExceptionboolean seekBefore(Cell cell) throws IOException
c[0] .. c[n], where there
are n cells in the file.cell - Cell to findIOExceptionboolean seekTo()
throws IOException
IOExceptionboolean next()
throws IOException
IOExceptionCell getKey()
seekTo(Cell) before this
method.ByteBuffer getValue()
seekTo(Cell) before this
method.@Deprecated String getKeyString()
seekTo(Cell) before this method.@Deprecated String getValueString()
seekTo(Cell) before this method.HFile.Reader getReader()
boolean isSeeked()
seekBefore(Cell)
or seekTo() or seekTo(Cell). Otherwise returns false.Cell getNextIndexedKey()
void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.