Compare commits
2 Commits
0caffbfa79
...
3b35c18517
Author | SHA1 | Date |
---|---|---|
Andrea Cavalli | 3b35c18517 | |
Andrea Cavalli | e4ec49e9aa |
2
pom.xml
2
pom.xml
|
@ -388,7 +388,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.11.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<release>17</release>
|
<release>17</release>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class RocksIteratorObj extends SimpleResource {
|
||||||
|
|
||||||
public synchronized void seek(byte[] seekArray) throws RocksDBException {
|
public synchronized void seek(byte[] seekArray) throws RocksDBException {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
|
rocksIterator.status();
|
||||||
startedIterSeek.increment();
|
startedIterSeek.increment();
|
||||||
try {
|
try {
|
||||||
iterSeekTime.record(() -> rocksIterator.seek(seekArray));
|
iterSeekTime.record(() -> rocksIterator.seek(seekArray));
|
||||||
|
@ -84,10 +85,14 @@ public class RocksIteratorObj extends SimpleResource {
|
||||||
/**
|
/**
|
||||||
* Useful for reverse iterations
|
* Useful for reverse iterations
|
||||||
*/
|
*/
|
||||||
public synchronized void seekFrom(Buf key) {
|
public synchronized void seekFrom(Buf key) throws RocksDBException {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
var keyArray = LLUtils.asArray(key);
|
var keyArray = LLUtils.asArray(key);
|
||||||
rocksIterator.seekForPrev(keyArray);
|
try {
|
||||||
|
rocksIterator.seekForPrev(keyArray);
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
rocksIterator.status();
|
||||||
// This is useful to retain the key buffer in memory and avoid deallocations
|
// This is useful to retain the key buffer in memory and avoid deallocations
|
||||||
this.seekingFrom = keyArray;
|
this.seekingFrom = keyArray;
|
||||||
}
|
}
|
||||||
|
@ -95,12 +100,17 @@ public class RocksIteratorObj extends SimpleResource {
|
||||||
/**
|
/**
|
||||||
* Useful for forward iterations
|
* Useful for forward iterations
|
||||||
*/
|
*/
|
||||||
public synchronized void seekTo(Buf key) {
|
public synchronized void seekTo(Buf key) throws RocksDBException {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
|
rocksIterator.status();
|
||||||
var keyArray = LLUtils.asArray(key);
|
var keyArray = LLUtils.asArray(key);
|
||||||
startedIterSeek.increment();
|
startedIterSeek.increment();
|
||||||
iterSeekTime.record(() -> rocksIterator.seek(keyArray));
|
try {
|
||||||
endedIterSeek.increment();
|
iterSeekTime.record(() -> rocksIterator.seek(keyArray));
|
||||||
|
} finally {
|
||||||
|
endedIterSeek.increment();
|
||||||
|
}
|
||||||
|
rocksIterator.status();
|
||||||
// This is useful to retain the key buffer in memory and avoid deallocations
|
// This is useful to retain the key buffer in memory and avoid deallocations
|
||||||
this.seekingTo = keyArray;
|
this.seekingTo = keyArray;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue