|
|
|
@ -8,12 +8,12 @@ package org.rocksdb; |
|
|
|
|
/** |
|
|
|
|
* An iterator yields a sequence of key/value pairs from a source. |
|
|
|
|
* The following class defines the interface. Multiple implementations |
|
|
|
|
* are provided by this library. In particular, iterators are provided |
|
|
|
|
* 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 Iterator without |
|
|
|
|
* |
|
|
|
|
* Multiple threads can invoke const methods on an Iterator without |
|
|
|
|
* external synchronization, but if any of the threads may call a |
|
|
|
|
* non-const method, all threads accessing the same Iterator must use |
|
|
|
|
* non-const method, all threads accessing the same Iterator must use |
|
|
|
|
* external synchronization. |
|
|
|
|
*/ |
|
|
|
|
public class Iterator { |
|
|
|
@ -50,7 +50,7 @@ public class Iterator { |
|
|
|
|
assert(isInitialized()); |
|
|
|
|
seekToLast0(nativeHandle_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Moves to the next entry in the source. After this call, Valid() is |
|
|
|
|
* true iff the iterator was not positioned at the last entry in the source. |
|
|
|
@ -60,7 +60,7 @@ public class Iterator { |
|
|
|
|
assert(isInitialized()); |
|
|
|
|
next0(nativeHandle_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Moves to the previous entry in the source. After this call, Valid() is |
|
|
|
|
* true iff the iterator was not positioned at the first entry in source. |
|
|
|
@ -73,7 +73,7 @@ public class Iterator { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Return the key for the current entry. The underlying storage for |
|
|
|
|
* the returned slice is valid only until the next modification of |
|
|
|
|
* the returned slice is valid only until the next modification of |
|
|
|
|
* the iterator. |
|
|
|
|
* REQUIRES: Valid() |
|
|
|
|
* @return key for the current entry. |
|
|
|
@ -84,9 +84,9 @@ public class Iterator { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Return the value for the current entry. The underlying storage for |
|
|
|
|
* the returned slice is valid only until the next modification of |
|
|
|
|
* the iterator. |
|
|
|
|
* 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() |
|
|
|
|
* @return value for the current entry. |
|
|
|
|
*/ |
|
|
|
@ -106,11 +106,12 @@ public class Iterator { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* If an error has occurred, return it. Else return an ok status. |
|
|
|
|
* If non-blocking IO is requested and this operation cannot be |
|
|
|
|
* If an error has occurred, return it. Else return an ok status. |
|
|
|
|
* If non-blocking IO is requested and this operation cannot be |
|
|
|
|
* satisfied without doing some IO, then this returns Status::Incomplete(). |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
public void status(){ |
|
|
|
|
public void status() throws RocksDBException { |
|
|
|
|
assert(isInitialized()); |
|
|
|
|
status0(nativeHandle_); |
|
|
|
|
} |
|
|
|
|