7
7
8
8
/**
9
9
* Options to control the behavior of a database. It will be used
10
- * during the creation of a RocksDB (i.e., RocksDB::Open ()).
10
+ * during the creation of a RocksDB (i.e., RocksDB.open ()).
11
11
*
12
12
* Note that dispose() must be called before an Options instance
13
13
* become out-of-scope to release the allocated memory in c++.
@@ -26,23 +26,25 @@ public Options() {
26
26
27
27
/**
28
28
* If this value is set to true, then the database will be created
29
- * if it is missing during RocksDB::Open ().
29
+ * if it is missing during RocksDB.open ().
30
30
* Default: false
31
31
*
32
32
* @param flag a flag indicating whether to create a database the
33
- * specified database in RocksDB::Open() operation is missing.
34
- * @see RocksDB::Open()
33
+ * specified database in RocksDB.open() operation is missing.
34
+ * @return the instance of the current Options.
35
+ * @see RocksDB.open()
35
36
*/
36
- public void setCreateIfMissing (boolean flag ) {
37
+ public Options setCreateIfMissing (boolean flag ) {
37
38
assert (isInitialized ());
38
39
setCreateIfMissing (nativeHandle_ , flag );
40
+ return this ;
39
41
}
40
42
41
43
/**
42
44
* Return true if the create_if_missing flag is set to true.
43
45
* If true, the database will be created if it is missing.
44
46
*
45
- * @return return true if the create_if_missing flag is set to true.
47
+ * @return true if the createIfMissing option is set to true.
46
48
* @see setCreateIfMissing()
47
49
*/
48
50
public boolean createIfMissing () {
@@ -63,12 +65,14 @@ public boolean createIfMissing() {
63
65
* the next time the database is opened.
64
66
*
65
67
* Default: 4MB
66
- * @param size of write buffer.
67
- * @see RocksDB::Open()
68
+ * @param writeBufferSize the size of write buffer.
69
+ * @return the instance of the current Options.
70
+ * @see RocksDB.open()
68
71
*/
69
- public void setWriteBufferSize (int writeBufferSize ) {
72
+ public Options setWriteBufferSize (int writeBufferSize ) {
70
73
assert (isInitialized ());
71
74
setWriteBufferSize (nativeHandle_ , writeBufferSize );
75
+ return this ;
72
76
}
73
77
74
78
/**
@@ -88,12 +92,14 @@ public int writeBufferSize() {
88
92
* storage, new writes can continue to the other write buffer.
89
93
* Default: 2
90
94
*
91
- * @param maximum number of write buffers.
92
- * @see RocksDB::Open()
95
+ * @param maxWriteBufferNumber maximum number of write buffers.
96
+ * @return the instance of the current Options.
97
+ * @see RocksDB.open()
93
98
*/
94
- public void setMaxWriteBufferNumber (int maxWriteBufferNumber ) {
99
+ public Options setMaxWriteBufferNumber (int maxWriteBufferNumber ) {
95
100
assert (isInitialized ());
96
101
setMaxWriteBufferNumber (nativeHandle_ , maxWriteBufferNumber );
102
+ return this ;
97
103
}
98
104
99
105
/**
@@ -115,16 +121,18 @@ public int maxWriteBufferNumber() {
115
121
*
116
122
* Default: 4K
117
123
*
118
- * @param block size.
119
- * @see RocksDB::Open()
124
+ * @param blockSize the size of each block in bytes.
125
+ * @return the instance of the current Options.
126
+ * @see RocksDB.open()
120
127
*/
121
- public void setBlockSize (int blockSize ) {
128
+ public Options setBlockSize (int blockSize ) {
122
129
assert (isInitialized ());
123
130
setBlockSize (nativeHandle_ , blockSize );
131
+ return this ;
124
132
}
125
133
126
134
/*
127
- * Returns block size.
135
+ * Returns the size of a block in bytes .
128
136
*
129
137
* @return block size.
130
138
* @see setBlockSize()
@@ -141,12 +149,15 @@ public int blockSize() {
141
149
* (which is true if max_open_files is large).
142
150
* Default: true
143
151
*
144
- * @param disable seek compaction.
145
- * @see RocksDB::Open()
152
+ * @param disableSeekCompaction a boolean value to specify whether
153
+ * to disable seek compaction.
154
+ * @return the instance of the current Options.
155
+ * @see RocksDB.open()
146
156
*/
147
- public void setDisableSeekCompaction (boolean disableSeekCompaction ) {
157
+ public Options setDisableSeekCompaction (boolean disableSeekCompaction ) {
148
158
assert (isInitialized ());
149
159
setDisableSeekCompaction (nativeHandle_ , disableSeekCompaction );
160
+ return this ;
150
161
}
151
162
152
163
/*
@@ -165,12 +176,15 @@ public boolean disableSeekCompaction() {
165
176
* the default LOW priority thread pool.
166
177
* Default: 1
167
178
*
168
- * @param maximum number of concurrent background jobs.
169
- * @see RocksDB::Open()
179
+ * @param maxBackgroundCompactions the maximum number of concurrent
180
+ * background jobs.
181
+ * @return the instance of the current Options.
182
+ * @see RocksDB.open()
170
183
*/
171
- public void setMaxBackgroundCompactions (int maxBackgroundCompactions ) {
184
+ public Options setMaxBackgroundCompactions (int maxBackgroundCompactions ) {
172
185
assert (isInitialized ());
173
186
setMaxBackgroundCompactions (nativeHandle_ , maxBackgroundCompactions );
187
+ return this ;
174
188
}
175
189
176
190
/*
0 commit comments