Skip to content

Commit 780a32f

Browse files
[kv] Upgrade rocksdb to community version 10.2.1 (#1338)
Co-authored-by: ocean.wy <[email protected]>
1 parent d695d7b commit 780a32f

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

fluss-client/src/main/resources/META-INF/NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ The Apache Software Foundation (http://www.apache.org/).
77
This project bundles the following dependencies under the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
88

99
- com.google.code.findbugs:jsr305:1.3.9
10-
- com.ververica:frocksdbjni:6.20.3-ververica-2.0
1110
- org.apache.commons:commons-lang3:3.18.0
1211
- org.apache.commons:commons-math3:3.6.1
12+
- org.rocksdb:rocksdbjni:10.2.1
1313
- org.lz4:lz4-java:1.8.0
1414

1515
This project bundles the following dependencies under the MIT (https://opensource.org/licenses/MIT)

fluss-common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
the rocksdb should be provided as a kv plugin to used by client & server.
8181
-->
8282
<dependency>
83-
<groupId>com.ververica</groupId>
84-
<artifactId>frocksdbjni</artifactId>
83+
<groupId>org.rocksdb</groupId>
84+
<artifactId>rocksdbjni</artifactId>
8585
</dependency>
8686

8787
<!-- test dependencies -->

fluss-common/src/main/java/com/alibaba/fluss/rocksdb/RocksIteratorWrapper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.rocksdb.RocksDBException;
2121
import org.rocksdb.RocksIterator;
2222
import org.rocksdb.RocksIteratorInterface;
23+
import org.rocksdb.Snapshot;
2324

2425
import javax.annotation.Nonnull;
2526

@@ -126,4 +127,10 @@ public byte[] value() {
126127
public void close() {
127128
iterator.close();
128129
}
130+
131+
@Override
132+
public void refresh(Snapshot snapshot) throws RocksDBException {
133+
iterator.refresh(snapshot);
134+
status();
135+
}
129136
}

fluss-server/src/main/java/com/alibaba/fluss/server/kv/snapshot/RocksIncrementalSnapshot.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public class RocksIncrementalSnapshot implements AutoCloseable {
5858
/** File suffix of sstable files. */
5959
public static final String SST_FILE_SUFFIX = ".sst";
6060

61+
/** File suffix of wal files. */
62+
public static final String WAL_FILE_SUFFIX = ".log";
63+
6164
/** RocksDB instance from the backend. */
6265
@Nonnull protected RocksDB db;
6366

@@ -293,7 +296,8 @@ private void createUploadFilePaths(
293296
} else {
294297
sstFilePaths.add(filePath); // re-upload
295298
}
296-
} else {
299+
} else if (!fileName.endsWith(WAL_FILE_SUFFIX)) {
300+
// the wal files are always empty and should be ignored
297301
miscFilePaths.add(filePath);
298302
}
299303
}

fluss-server/src/main/resources/META-INF/NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ This project bundles the following dependencies under the Apache Software Licens
99
- com.github.ben-manes.caffeine:caffeine:2.9.3
1010
- com.google.code.findbugs:jsr305:1.3.9
1111
- com.google.errorprone:error_prone_annotations:2.10.0
12-
- com.ververica:frocksdbjni:6.20.3-ververica-2.0
1312
- commons-cli:commons-cli:1.5.0
1413
- org.apache.commons:commons-lang3:3.18.0
1514
- org.apache.commons:commons-math3:3.6.1
1615
- org.lz4:lz4-java:1.8.0
16+
- org.rocksdb:rocksdbjni:10.2.1
1717
- org.xerial.snappy:snappy-java:1.1.10.4
1818

1919
This project bundles the following dependencies under the MIT (https://opensource.org/licenses/MIT)

fluss-server/src/test/java/com/alibaba/fluss/server/kv/rocksdb/RocksDBOperationsUtilsTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.junit.jupiter.api.Test;
2323
import org.junit.jupiter.api.io.TempDir;
24+
import org.rocksdb.ColumnFamilyDescriptor;
2425
import org.rocksdb.DBOptions;
2526
import org.rocksdb.RocksDB;
2627
import org.rocksdb.RocksDBException;
@@ -48,7 +49,9 @@ void testOpenDBFail(@TempDir Path temporaryFolder) throws Exception {
4849
RocksDB rocks =
4950
RocksDBOperationUtils.openDB(
5051
rocksDir.getAbsolutePath(),
51-
Collections.emptyList(),
52+
Collections.singletonList(
53+
new ColumnFamilyDescriptor(
54+
RocksDB.DEFAULT_COLUMN_FAMILY)),
5255
Collections.emptyList(),
5356
dbOptions,
5457
false);

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<paimon.version>1.0.1</paimon.version>
102102

103103
<fluss.hadoop.version>2.10.2</fluss.hadoop.version>
104-
<frocksdb.version>6.20.3-ververica-2.0</frocksdb.version>
104+
<rocksdb.version>10.2.1</rocksdb.version>
105105
<slf4j.version>1.7.36</slf4j.version>
106106
<log4j.version>2.17.1</log4j.version>
107107
<jaxb.api.version>2.3.1</jaxb.api.version>
@@ -342,9 +342,9 @@
342342
</dependency>
343343

344344
<dependency>
345-
<groupId>com.ververica</groupId>
346-
<artifactId>frocksdbjni</artifactId>
347-
<version>${frocksdb.version}</version>
345+
<groupId>org.rocksdb</groupId>
346+
<artifactId>rocksdbjni</artifactId>
347+
<version>${rocksdb.version}</version>
348348
</dependency>
349349

350350
<dependency>

0 commit comments

Comments
 (0)