44import lombok .extern .slf4j .Slf4j ;
55
66@ Slf4j
7- public class DBSettings {
7+ public class RocksDbSettings {
88
9- private static DBSettings settings ;
9+ private static RocksDbSettings settings ;
1010
1111 @ Getter
1212 private int levelNumber ;
@@ -29,29 +29,31 @@ public class DBSettings {
2929 @ Getter
3030 private boolean enableStatistics ;
3131
32- private DBSettings () {
32+ private RocksDbSettings () {
3333
3434 }
3535
36- public static DBSettings getDefaultSettings () {
37- DBSettings defaultSettings = new DBSettings ();
36+ public static RocksDbSettings getDefaultSettings () {
37+ RocksDbSettings defaultSettings = new RocksDbSettings ();
3838 return defaultSettings .withLevelNumber (7 ).withBlockSize (64 ).withCompactThreads (32 )
39- .withTargetFileSizeBase (256 ).withMaxBytesForLevelMultiplier (10 ).withTargetFileSizeMultiplier (1 )
39+ .withTargetFileSizeBase (256 ).withMaxBytesForLevelMultiplier (10 )
40+ .withTargetFileSizeMultiplier (1 )
4041 .withMaxBytesForLevelBase (256 ).withMaxOpenFiles (-1 ).withEnableStatistics (false );
4142 }
4243
43- public static DBSettings getSettings () {
44+ public static RocksDbSettings getSettings () {
4445 if (settings == null ) {
4546 return getDefaultSettings ();
4647 }
4748 return settings ;
4849 }
4950
50- public static DBSettings initCustomSettings (int levelNumber , int compactThreads , int blocksize ,
51- long maxBytesForLevelBase ,
52- double maxBytesForLevelMultiplier , int level0FileNumCompactionTrigger , long targetFileSizeBase ,
51+ public static RocksDbSettings initCustomSettings (int levelNumber , int compactThreads ,
52+ int blocksize , long maxBytesForLevelBase ,
53+ double maxBytesForLevelMultiplier , int level0FileNumCompactionTrigger ,
54+ long targetFileSizeBase ,
5355 int targetFileSizeMultiplier ) {
54- settings = new DBSettings ()
56+ settings = new RocksDbSettings ()
5557 .withMaxOpenFiles (-1 )
5658 .withEnableStatistics (false )
5759 .withLevelNumber (levelNumber )
@@ -66,60 +68,62 @@ public static DBSettings initCustomSettings(int levelNumber, int compactThreads,
6668 }
6769
6870
69- public DBSettings withMaxOpenFiles (int maxOpenFiles ) {
71+ public RocksDbSettings withMaxOpenFiles (int maxOpenFiles ) {
7072 this .maxOpenFiles = maxOpenFiles ;
7173 return this ;
7274 }
7375
74- public DBSettings withCompactThreads (int compactThreads ) {
76+ public RocksDbSettings withCompactThreads (int compactThreads ) {
7577 this .compactThreads = compactThreads ;
7678 return this ;
7779 }
7880
79- public DBSettings withBlockSize (long blockSize ) {
81+ public RocksDbSettings withBlockSize (long blockSize ) {
8082 this .blockSize = blockSize * 1024 ;
8183 return this ;
8284 }
8385
84- public DBSettings withMaxBytesForLevelBase (long maxBytesForLevelBase ) {
86+ public RocksDbSettings withMaxBytesForLevelBase (long maxBytesForLevelBase ) {
8587 this .maxBytesForLevelBase = maxBytesForLevelBase * 1024 * 1024 ;
8688 return this ;
8789 }
8890
89- public DBSettings withMaxBytesForLevelMultiplier (double maxBytesForLevelMultiplier ) {
91+ public RocksDbSettings withMaxBytesForLevelMultiplier (double maxBytesForLevelMultiplier ) {
9092 this .maxBytesForLevelMultiplier = maxBytesForLevelMultiplier ;
9193 return this ;
9294 }
9395
94- public DBSettings withLevel0FileNumCompactionTrigger (int level0FileNumCompactionTrigger ) {
96+ public RocksDbSettings withLevel0FileNumCompactionTrigger (int level0FileNumCompactionTrigger ) {
9597 this .level0FileNumCompactionTrigger = level0FileNumCompactionTrigger ;
9698 return this ;
9799 }
98100
99- public DBSettings withEnableStatistics (boolean enable ) {
101+ public RocksDbSettings withEnableStatistics (boolean enable ) {
100102 this .enableStatistics = enable ;
101103 return this ;
102104 }
103105
104- public DBSettings withLevelNumber (int levelNumber ) {
106+ public RocksDbSettings withLevelNumber (int levelNumber ) {
105107 this .levelNumber = levelNumber ;
106108 return this ;
107109 }
108110
109111
110- public DBSettings withTargetFileSizeBase (long targetFileSizeBase ) {
112+ public RocksDbSettings withTargetFileSizeBase (long targetFileSizeBase ) {
111113 this .targetFileSizeBase = targetFileSizeBase * 1024 * 1024 ;
112114 return this ;
113115 }
114116
115- public DBSettings withTargetFileSizeMultiplier (int targetFileSizeMultiplier ) {
117+ public RocksDbSettings withTargetFileSizeMultiplier (int targetFileSizeMultiplier ) {
116118 this .targetFileSizeMultiplier = targetFileSizeMultiplier ;
117119 return this ;
118120 }
119121
120122 public static void loggingSettings () {
121123 logger .info (String .format (
122- "level number: %d, CompactThreads: %d, Blocksize: %d, maxBytesForLevelBase: %d, withMaxBytesForLevelMultiplier: %f, level0FileNumCompactionTrigger: %d, withTargetFileSizeBase: %d, withTargetFileSizeMultiplier: %d" ,
124+ "level number: %d, CompactThreads: %d, Blocksize: %d, maxBytesForLevelBase: %d,"
125+ + " withMaxBytesForLevelMultiplier: %f, level0FileNumCompactionTrigger: %d, "
126+ + "withTargetFileSizeBase: %d, withTargetFileSizeMultiplier: %d" ,
123127 settings .getLevelNumber (),
124128 settings .getCompactThreads (), settings .getBlockSize (), settings .getMaxBytesForLevelBase (),
125129 settings .getMaxBytesForLevelMultiplier (), settings .getLevel0FileNumCompactionTrigger (),
0 commit comments