From 591963f630d0c2ab1ab03caf2189af8cd092aafd Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Wed, 2 Oct 2024 00:15:07 +0200 Subject: [PATCH] Check status unsafe --- .../java/it/cavallium/dbengine/database/disk/RocksDBFile.java | 1 + .../dbengine/database/disk/rocksdb/RocksIteratorObj.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/it/cavallium/dbengine/database/disk/RocksDBFile.java b/src/main/java/it/cavallium/dbengine/database/disk/RocksDBFile.java index 8dd4376..a3c3acc 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/RocksDBFile.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/RocksDBFile.java @@ -225,6 +225,7 @@ public class RocksDBFile implements Comparable { } return new RocksDBFileIterationStateBegin(meta); } else { + rocksIterator.statusUnsafe(); rawKey = rocksIterator.keyBuf().copy(); rawValue = rocksIterator.valueBuf().copy(); rocksIterator.next(); diff --git a/src/main/java/it/cavallium/dbengine/database/disk/rocksdb/RocksIteratorObj.java b/src/main/java/it/cavallium/dbengine/database/disk/rocksdb/RocksIteratorObj.java index b77122c..15693b9 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/rocksdb/RocksIteratorObj.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/rocksdb/RocksIteratorObj.java @@ -168,6 +168,10 @@ public abstract class RocksIteratorObj extends SimpleResource { rocksIterator.next(); } + public synchronized void statusUnsafe() throws RocksDBException { + rocksIterator.status(); + } + public synchronized void seekToLast() throws RocksDBException { ensureOpen(); startedIterSeek.increment();