Update rocksdb

This commit is contained in:
Andrea Cavalli 2023-06-30 23:15:09 +02:00
parent faa15d64ce
commit 0e2b3677c4
5 changed files with 16 additions and 10 deletions

View File

@ -14,7 +14,7 @@
<dbengine.ci>false</dbengine.ci> <dbengine.ci>false</dbengine.ci>
<micrometer.version>1.10.4</micrometer.version> <micrometer.version>1.10.4</micrometer.version>
<lucene.version>9.7.0</lucene.version> <lucene.version>9.7.0</lucene.version>
<rocksdb.version>8.1.1.1</rocksdb.version> <rocksdb.version>8.3.2</rocksdb.version>
<junit.jupiter.version>5.9.0</junit.jupiter.version> <junit.jupiter.version>5.9.0</junit.jupiter.version>
<data.generator.version>1.0.10</data.generator.version> <data.generator.version>1.0.10</data.generator.version>
</properties> </properties>

View File

@ -60,7 +60,8 @@ public enum RocksDBLongProperty implements RocksDBProperty {
NUM_BLOB_FILES("num-blob-files"), NUM_BLOB_FILES("num-blob-files"),
TOTAL_BLOB_FILE_SIZE("total-blob-file-size"), TOTAL_BLOB_FILE_SIZE("total-blob-file-size"),
LIVE_BLOB_FILE_SIZE("live-blob-file-size"), LIVE_BLOB_FILE_SIZE("live-blob-file-size"),
LIVE_BLOB_FILE_GARBAGE_SIZE("live-blob-file-garbage-size") LIVE_BLOB_FILE_GARBAGE_SIZE("live-blob-file-garbage-size"),
FILE_READ_DB_OPEN_MICROS("file.read.db.open.micros")
; ;
private final String name; private final String name;

View File

@ -2,6 +2,10 @@ package it.cavallium.dbengine.database;
public interface RocksDBProperty { public interface RocksDBProperty {
/**
* Get rocksdb property name
* @return name, with the "rocksdb." prefix included
*/
String getName(); String getName();
boolean isNumeric(); boolean isNumeric();

View File

@ -28,6 +28,7 @@ import it.cavallium.dbengine.database.LLRange;
import it.cavallium.dbengine.database.LLSnapshot; import it.cavallium.dbengine.database.LLSnapshot;
import it.cavallium.dbengine.database.LLUtils; import it.cavallium.dbengine.database.LLUtils;
import it.cavallium.dbengine.database.OptionalBuf; import it.cavallium.dbengine.database.OptionalBuf;
import it.cavallium.dbengine.database.RocksDBLongProperty;
import it.cavallium.dbengine.database.SerializedKey; import it.cavallium.dbengine.database.SerializedKey;
import it.cavallium.dbengine.database.UpdateMode; import it.cavallium.dbengine.database.UpdateMode;
import it.cavallium.dbengine.database.UpdateReturnMode; import it.cavallium.dbengine.database.UpdateReturnMode;
@ -976,7 +977,7 @@ public class LLLocalDictionary implements LLDictionary {
if (USE_NUM_ENTRIES_PRECISE_COUNTER) { if (USE_NUM_ENTRIES_PRECISE_COUNTER) {
return getRocksDBNumEntries(); return getRocksDBNumEntries();
} }
return db.getLongProperty("rocksdb.estimate-num-keys"); return db.getLongProperty(RocksDBLongProperty.ESTIMATE_NUM_KEYS.getName());
} catch (RocksDBException e) { } catch (RocksDBException e) {
logger.error(MARKER_ROCKSDB, "Failed to get RocksDB estimated keys count property", e); logger.error(MARKER_ROCKSDB, "Failed to get RocksDB estimated keys count property", e);
return 0; return 0;

View File

@ -1260,13 +1260,13 @@ public class LLLocalKeyValueDatabase extends Backuppable implements LLKeyValueDa
try { try {
if (closeRequested || closed || closeReadLock == 0) return null; if (closeRequested || closed || closeReadLock == 0) return null;
ensureOpen(); ensureOpen();
return new MemoryStats(db.getAggregatedLongProperty("rocksdb.estimate-table-readers-mem"), return new MemoryStats(db.getAggregatedLongProperty(RocksDBLongProperty.ESTIMATE_TABLE_READERS_MEM.getName()),
db.getAggregatedLongProperty("rocksdb.size-all-mem-tables"), db.getAggregatedLongProperty(RocksDBLongProperty.SIZE_ALL_MEM_TABLES.getName()),
db.getAggregatedLongProperty("rocksdb.cur-size-all-mem-tables"), db.getAggregatedLongProperty(RocksDBLongProperty.CUR_SIZE_ALL_MEM_TABLES.getName()),
db.getAggregatedLongProperty("rocksdb.estimate-num-keys"), db.getAggregatedLongProperty(RocksDBLongProperty.ESTIMATE_NUM_KEYS.getName()),
db.getAggregatedLongProperty("rocksdb.block-cache-usage") / this.handles.size(), db.getAggregatedLongProperty(RocksDBLongProperty.BLOCK_CACHE_USAGE.getName()) / this.handles.size(),
db.getAggregatedLongProperty("rocksdb.block-cache-pinned-usage") / this.handles.size(), db.getAggregatedLongProperty(RocksDBLongProperty.BLOCK_CACHE_PINNED_USAGE.getName()) / this.handles.size(),
db.getAggregatedLongProperty("rocksdb.num-live-versions") / this.handles.size() db.getAggregatedLongProperty(RocksDBLongProperty.NUM_LIVE_VERSIONS.getName()) / this.handles.size()
); );
} catch (RocksDBException e) { } catch (RocksDBException e) {
throw new DBException("Failed to read memory stats", e); throw new DBException("Failed to read memory stats", e);