Skip to content

Commit

Permalink
fix: 修复 RocksMap.startWith 一致迭代到尾部的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
helyho committed Mar 25, 2020
1 parent a085ca0 commit 971c18a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
<version>6.2.4</version>
<version>6.6.4</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,8 @@ public Map<K,V> startWith(K key, int skipSize, int size) {
iterator.directNext();
if (TByte.byteArrayStartWith(iterator.keyBytes(), keyBytes)) {
entryMap.put((K) iterator.key(), (V) iterator.value());
} else {
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void testWal() throws RocksDBException {
// columnFamilyOptions.setWriteBufferSize(1024*1024*512);

RocksMap rocksMap = new RocksMap("waltest", "cfname", columnFamilyOptions, dbOptions, readOptions, writeOptions, false);
for(int i=0;i<300000;i++){
for(int i=0;i<30;i++){
rocksMap.put(i, i);
}
rocksMap.compact();
Expand Down

0 comments on commit 971c18a

Please sign in to comment.