Skip to content

Commit 5030fe1

Browse files
authored
Merge pull request #44 from scalableminds/rocksdbjni8
Upgrade to rocksdbjni 8.10
2 parents f84d442 + da5480e commit 5030fe1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ libraryDependencies ++= Seq(
3030
"io.grpc" % "grpc-netty" % scalapb.compiler.Version.grpcJavaVersion,
3131
"io.grpc" % "grpc-services" % scalapb.compiler.Version.grpcJavaVersion,
3232
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
33-
"org.rocksdb" % "rocksdbjni" % "7.10.2",
33+
"org.rocksdb" % "rocksdbjni" % "8.10.0",
3434
"com.github.scopt" %% "scopt" % "4.1.0"
3535
)
3636

src/main/scala/com/scalableminds/fossildb/db/RocksDBStore.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class RocksDBManager(dataDir: Path, columnFamilies: List[String], optionsFilePat
2626
val cfListRef: mutable.Buffer[ColumnFamilyDescriptor] = mutable.Buffer()
2727
optionsFilePathOpt.foreach { optionsFilePath =>
2828
try {
29-
org.rocksdb.OptionsUtil.loadOptionsFromFile(optionsFilePath, Env.getDefault, options, cfListRef.asJava)
29+
val configOptions = new ConfigOptions()
30+
org.rocksdb.OptionsUtil.loadOptionsFromFile(configOptions, optionsFilePath, options, cfListRef.asJava)
3031
logger.info("successfully loaded rocksdb options from " + optionsFilePath)
3132
} catch {
3233
case e: Exception =>

src/test/scala/com/scalableminds/fossildb/RocksOptionsSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.scalableminds.fossildb
33
import java.io.File
44
import java.nio.file.Paths
55
import com.scalableminds.fossildb.db.StoreManager
6-
import org.rocksdb.{ColumnFamilyDescriptor, DBOptions, Env}
6+
import org.rocksdb.{ColumnFamilyDescriptor, ConfigOptions, DBOptions, Env}
77
import org.scalatest.BeforeAndAfterEach
88
import org.scalatest.flatspec.AnyFlatSpec
99

@@ -42,9 +42,10 @@ class RocksOptionsSuite extends AnyFlatSpec with BeforeAndAfterEach with TestHel
4242
val options = new DBOptions()
4343
.setStatsDumpPeriodSec(100)
4444
val cfListRef: mutable.Buffer[ColumnFamilyDescriptor] = mutable.Buffer()
45+
val configOptions = new ConfigOptions()
4546
// if successful, the rocksdb writes the loaded options to a file that can then be retreived with loadLatestOptions
4647
// we test that that one now includes the value 700 from the file above, rather than the 100 specified as a default
47-
org.rocksdb.OptionsUtil.loadLatestOptions(dataDir.toString, Env.getDefault, options, cfListRef.asJava)
48+
org.rocksdb.OptionsUtil.loadLatestOptions(configOptions, dataDir.toString, options, cfListRef.asJava)
4849
assert(options.statsDumpPeriodSec() == 700)
4950
storeManager.close
5051
}

0 commit comments

Comments
 (0)