public class RocksIterator extends AbstractRocksIterator<RocksDB>
An iterator that yields a sequence of key/value pairs from a source. Multiple implementations are provided by this library. In particular, iterators are provided to access the contents of a Table or a DB.
Multiple threads can invoke const methods on an RocksIterator without external synchronization, but if any of the threads may call a non-const method, all threads accessing the same RocksIterator must use external synchronization.
RocksObject
nativeHandle_
owningHandle_
Modifier | Constructor and Description |
---|---|
protected |
RocksIterator(RocksDB rocksDB,
long nativeHandle) |
Modifier and Type | Method and Description |
---|---|
protected void |
disposeInternal(long handle) |
byte[] |
key()
Return the key for the current entry.
|
int |
key(byte[] key)
Return the key for the current entry.
|
int |
key(byte[] key,
int offset,
int len)
Return the key for the current entry.
|
int |
key(java.nio.ByteBuffer key)
Return the key for the current entry.
|
byte[] |
value()
Return the value for the current entry.
|
int |
value(byte[] value)
Return the value for the current entry.
|
int |
value(byte[] value,
int offset,
int len)
Return the value for the current entry.
|
int |
value(java.nio.ByteBuffer value)
Return the value for the current entry.
|
disposeInternal, isValid, next, prev, refresh, refresh, seek, seek, seekForPrev, seekForPrev, seekToFirst, seekToLast, status
getNativeHandle
close, disOwnNativeHandle, isOwningHandle
protected RocksIterator(RocksDB rocksDB, long nativeHandle)
public byte[] key()
Return the key for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
public int key(byte[] key)
Return the key for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
key
- the out-value to receive the retrieved key.key
, then it indicates that the size of the
input buffer key
is insufficient and partial result will
be returned.public int key(byte[] key, int offset, int len)
Return the key for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
key
- the out-value to receive the retrieved key.offset
- in key
at which to place the retrieved keylen
- limit to length of received key returnedlen
, then it indicates that the size of the
input buffer key
is insufficient and partial result will
be returned.public int key(java.nio.ByteBuffer key)
Return the key for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
key
- the out-value to receive the retrieved key.
It is using position and limit. Limit is set according to key size.key
, then it indicates that the size of the
input buffer key
is insufficient and partial result will
be returned.public byte[] value()
Return the value for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: !AtEnd() && !AtStart()
public int value(java.nio.ByteBuffer value)
Return the value for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
value
- the out-value to receive the retrieved value.
It is using position and limit. Limit is set according to value size.value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned.public int value(byte[] value)
Return the value for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
value
- the out-value to receive the retrieved value.value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned.public int value(byte[] value, int offset, int len)
Return the value for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.
REQUIRES: AbstractRocksIterator.isValid()
value
- the out-value to receive the retrieved value.offset
- the offset within value at which to place the resultlen
- the length available in value after offset, for placing the resultlen
,
then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned.protected final void disposeInternal(long handle)
disposeInternal
in class RocksObject