Class RocksIterator
- All Implemented Interfaces:
AutoCloseable,RocksIteratorInterface
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.
- See Also:
-
Field Summary
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voiddisposeInternal(long handle) byte[]key()Return the key for the current entry.intkey(byte[] key) Return the key for the current entry.intkey(byte[] key, int offset, int len) Return the key for the current entry.intkey(ByteBuffer key) Return the key for the current entry.byte[]value()Return the value for the current entry.intvalue(byte[] value) Return the value for the current entry.intvalue(byte[] value, int offset, int len) Return the value for the current entry.intvalue(ByteBuffer value) Return the value for the current entry.Methods inherited from class org.rocksdb.AbstractRocksIterator
disposeInternal, isValid, next, prev, refresh, refresh, seek, seek, seekForPrev, seekForPrev, seekToFirst, seekToLast, statusMethods inherited from class org.rocksdb.RocksObject
getNativeHandleMethods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Constructor Details
-
RocksIterator
-
-
Method Details
-
key
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()- Returns:
- key for the current entry.
-
key
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()- Parameters:
key- the out-value to receive the retrieved key.- Returns:
- The size of the actual key. If the return key is greater than
the length of the buffer
key, then it indicates that the size of the input bufferkeyis insufficient and partial result will be returned.
-
key
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()- Parameters:
key- the out-value to receive the retrieved key.offset- inkeyat which to place the retrieved keylen- limit to length of received key returned- Returns:
- The size of the actual key. If the return key is greater than
len, then it indicates that the size of the input bufferkeyis insufficient and partial result will be returned.
-
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()- Parameters:
key- the out-value to receive the retrieved key. It is using position and limit. Limit is set according to key size.- Returns:
- The size of the actual key. If the return key is greater than the
length of
key, then it indicates that the size of the input bufferkeyis insufficient and partial result will be returned.
-
value
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()
- Returns:
- value for the current entry.
-
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()- Parameters:
value- the out-value to receive the retrieved value. It is using position and limit. Limit is set according to value size.- Returns:
- The size of the actual value. If the return value is greater than the
length of
value, then it indicates that the size of the input buffervalueis insufficient and partial result will be returned.
-
value
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()- Parameters:
value- the out-value to receive the retrieved value.- Returns:
- The size of the actual value. If the return value is greater than the
length of
value, then it indicates that the size of the input buffervalueis insufficient and partial result will be returned.
-
value
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()- Parameters:
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 result- Returns:
- The size of the actual value. If the return value is greater than
len, then it indicates that the size of the input buffervalueis insufficient and partial result will be returned.
-
disposeInternal
protected final void disposeInternal(long handle) - Specified by:
disposeInternalin classRocksObject
-