Update dependencies, improve rocksdb loader

This commit is contained in:
Andrea Cavalli 2024-03-26 21:49:45 +01:00
parent 6cbaad6ebd
commit 34e8eb0259
2 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@
<dependency>
<groupId>com.github.seancfoley</groupId>
<artifactId>ipaddress</artifactId>
<version>5.4.0</version>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>

View File

@ -21,7 +21,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import static it.cavallium.rockserver.core.common.Utils.mapList;
import static it.cavallium.rockserver.core.common.Utils.toMemorySegmentSimple;
import static java.lang.Boolean.parseBoolean;
import static java.util.Objects.requireNonNull;
import static org.rocksdb.ColumnFamilyOptionsInterface.DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET;
@ -44,7 +43,8 @@ public class RocksDBLoader {
public static void loadLibrary() {
try {
var jniPath = Path.of(".").resolve("jni").resolve(RocksDBMetadata.getRocksDBVersionHash());
String currentUsersHomeDir = System.getProperty("user.home");
var jniPath = Path.of(currentUsersHomeDir).resolve(".jni").resolve("rocksdb").resolve(RocksDBMetadata.getRocksDBVersionHash());
if (Files.notExists(jniPath)) {
Files.createDirectories(jniPath);
}
@ -574,7 +574,7 @@ public class RocksDBLoader {
}
}
record DbPathRecord(Path path, long targetSize) {}
public record DbPathRecord(Path path, long targetSize) {}
public static boolean isDisableAutoCompactions() {
return parseBoolean(System.getProperty("it.cavallium.dbengine.compactions.auto.disable", "false"));