Merge pull request #508 from fyrz/RocksJava-Final-Patch

[RocksJava] Final usage correction
main
Adam Retter 9 years ago
commit b74ad66320
  1. 3
      java/src/main/java/org/rocksdb/AbstractRocksIterator.java
  2. 4
      java/src/main/java/org/rocksdb/BackupInfo.java
  3. 8
      java/src/main/java/org/rocksdb/BackupableDB.java
  4. 12
      java/src/main/java/org/rocksdb/BackupableDBOptions.java
  5. 38
      java/src/main/java/org/rocksdb/BlockBasedTableConfig.java
  6. 6
      java/src/main/java/org/rocksdb/BloomFilter.java
  7. 6
      java/src/main/java/org/rocksdb/Checkpoint.java
  8. 3
      java/src/main/java/org/rocksdb/ColumnFamilyHandle.java
  9. 110
      java/src/main/java/org/rocksdb/ColumnFamilyOptions.java
  10. 109
      java/src/main/java/org/rocksdb/DBOptions.java
  11. 2
      java/src/main/java/org/rocksdb/FlushOptions.java
  12. 6
      java/src/main/java/org/rocksdb/GenericRateLimiterConfig.java
  13. 12
      java/src/main/java/org/rocksdb/HashLinkedListMemTableConfig.java
  14. 8
      java/src/main/java/org/rocksdb/HashSkipListMemTableConfig.java
  15. 5
      java/src/main/java/org/rocksdb/HistogramData.java
  16. 161
      java/src/main/java/org/rocksdb/Options.java
  17. 9
      java/src/main/java/org/rocksdb/ReadOptions.java
  18. 18
      java/src/main/java/org/rocksdb/RestoreBackupableDB.java
  19. 2
      java/src/main/java/org/rocksdb/RestoreOptions.java
  20. 217
      java/src/main/java/org/rocksdb/RocksDB.java
  21. 2
      java/src/main/java/org/rocksdb/RocksDBException.java
  22. 8
      java/src/main/java/org/rocksdb/RocksEnv.java
  23. 2
      java/src/main/java/org/rocksdb/SkipListMemTableConfig.java
  24. 2
      java/src/main/java/org/rocksdb/Snapshot.java
  25. 4
      java/src/main/java/org/rocksdb/Statistics.java
  26. 7
      java/src/main/java/org/rocksdb/StatisticsCollector.java
  27. 4
      java/src/main/java/org/rocksdb/StatsCollectorInput.java
  28. 7
      java/src/main/java/org/rocksdb/TransactionLogIterator.java
  29. 19
      java/src/main/java/org/rocksdb/TtlDB.java
  30. 2
      java/src/main/java/org/rocksdb/VectorMemTableConfig.java
  31. 2
      java/src/main/java/org/rocksdb/WBWIRocksIterator.java
  32. 6
      java/src/main/java/org/rocksdb/WriteBatch.java
  33. 14
      java/src/main/java/org/rocksdb/WriteBatchWithIndex.java
  34. 4
      java/src/main/java/org/rocksdb/WriteOptions.java
  35. 4
      java/src/main/java/org/rocksdb/util/Environment.java

@ -23,7 +23,8 @@ public abstract class AbstractRocksIterator<P extends RocksObject>
extends RocksObject implements RocksIteratorInterface { extends RocksObject implements RocksIteratorInterface {
final P parent_; final P parent_;
protected AbstractRocksIterator(P parent, long nativeHandle) { protected AbstractRocksIterator(final P parent,
final long nativeHandle) {
super(); super();
nativeHandle_ = nativeHandle; nativeHandle_ = nativeHandle;
// parent must point to a valid RocksDB instance. // parent must point to a valid RocksDB instance.

@ -20,8 +20,8 @@ public class BackupInfo {
* @param size size of backup * @param size size of backup
* @param numberFiles number of files related to this backup. * @param numberFiles number of files related to this backup.
*/ */
BackupInfo(int backupId, long timestamp, long size, BackupInfo(final int backupId, final long timestamp, final long size,
int numberFiles) { final int numberFiles) {
backupId_ = backupId; backupId_ = backupId;
timestamp_ = timestamp; timestamp_ = timestamp;
size_ = size; size_ = size;

@ -30,7 +30,7 @@ public class BackupableDB extends RocksDB {
* native library. * native library.
*/ */
public static BackupableDB open( public static BackupableDB open(
Options opt, BackupableDBOptions bopt, String db_path) final Options opt, final BackupableDBOptions bopt, final String db_path)
throws RocksDBException { throws RocksDBException {
RocksDB db = RocksDB.open(opt, db_path); RocksDB db = RocksDB.open(opt, db_path);
@ -54,7 +54,7 @@ public class BackupableDB extends RocksDB {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void createNewBackup(boolean flushBeforeBackup) public void createNewBackup(final boolean flushBeforeBackup)
throws RocksDBException { throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
createNewBackup(nativeHandle_, flushBeforeBackup); createNewBackup(nativeHandle_, flushBeforeBackup);
@ -68,7 +68,7 @@ public class BackupableDB extends RocksDB {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void purgeOldBackups(int numBackupsToKeep) public void purgeOldBackups(final int numBackupsToKeep)
throws RocksDBException { throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
purgeOldBackups(nativeHandle_, numBackupsToKeep); purgeOldBackups(nativeHandle_, numBackupsToKeep);
@ -82,7 +82,7 @@ public class BackupableDB extends RocksDB {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void deleteBackup(int backupId) throws RocksDBException { public void deleteBackup(final int backupId) throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
deleteBackup0(nativeHandle_, backupId); deleteBackup0(nativeHandle_, backupId);
} }

@ -26,7 +26,7 @@ public class BackupableDBOptions extends RocksObject {
* Best to set this to {@code db name_ + "/backups"} * Best to set this to {@code db name_ + "/backups"}
* @throws java.lang.IllegalArgumentException if illegal path is used. * @throws java.lang.IllegalArgumentException if illegal path is used.
*/ */
public BackupableDBOptions(String path) { public BackupableDBOptions(final String path) {
super(); super();
File backupPath = path == null ? null : new File(path); File backupPath = path == null ? null : new File(path);
if (backupPath == null || !backupPath.isDirectory() || !backupPath.canWrite()) { if (backupPath == null || !backupPath.isDirectory() || !backupPath.canWrite()) {
@ -57,7 +57,7 @@ public class BackupableDBOptions extends RocksObject {
* *
* @return instance of current BackupableDBOptions. * @return instance of current BackupableDBOptions.
*/ */
public BackupableDBOptions setShareTableFiles(boolean shareTableFiles) { public BackupableDBOptions setShareTableFiles(final boolean shareTableFiles) {
assert(isInitialized()); assert(isInitialized());
setShareTableFiles(nativeHandle_, shareTableFiles); setShareTableFiles(nativeHandle_, shareTableFiles);
return this; return this;
@ -86,7 +86,7 @@ public class BackupableDBOptions extends RocksObject {
* *
* @return instance of current BackupableDBOptions. * @return instance of current BackupableDBOptions.
*/ */
public BackupableDBOptions setSync(boolean sync) { public BackupableDBOptions setSync(final boolean sync) {
assert(isInitialized()); assert(isInitialized());
setSync(nativeHandle_, sync); setSync(nativeHandle_, sync);
return this; return this;
@ -111,7 +111,7 @@ public class BackupableDBOptions extends RocksObject {
* *
* @return instance of current BackupableDBOptions. * @return instance of current BackupableDBOptions.
*/ */
public BackupableDBOptions setDestroyOldData(boolean destroyOldData) { public BackupableDBOptions setDestroyOldData(final boolean destroyOldData) {
assert(isInitialized()); assert(isInitialized());
setDestroyOldData(nativeHandle_, destroyOldData); setDestroyOldData(nativeHandle_, destroyOldData);
return this; return this;
@ -138,7 +138,7 @@ public class BackupableDBOptions extends RocksObject {
* *
* @return instance of current BackupableDBOptions. * @return instance of current BackupableDBOptions.
*/ */
public BackupableDBOptions setBackupLogFiles(boolean backupLogFiles) { public BackupableDBOptions setBackupLogFiles(final boolean backupLogFiles) {
assert(isInitialized()); assert(isInitialized());
setBackupLogFiles(nativeHandle_, backupLogFiles); setBackupLogFiles(nativeHandle_, backupLogFiles);
return this; return this;
@ -226,7 +226,7 @@ public class BackupableDBOptions extends RocksObject {
* @return instance of current BackupableDBOptions. * @return instance of current BackupableDBOptions.
*/ */
public BackupableDBOptions setShareFilesWithChecksum( public BackupableDBOptions setShareFilesWithChecksum(
boolean shareFilesWithChecksum) { final boolean shareFilesWithChecksum) {
assert(isInitialized()); assert(isInitialized());
setShareFilesWithChecksum(nativeHandle_, shareFilesWithChecksum); setShareFilesWithChecksum(nativeHandle_, shareFilesWithChecksum);
return this; return this;

@ -38,7 +38,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param noBlockCache if use block cache * @param noBlockCache if use block cache
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setNoBlockCache(boolean noBlockCache) { public BlockBasedTableConfig setNoBlockCache(final boolean noBlockCache) {
noBlockCache_ = noBlockCache; noBlockCache_ = noBlockCache;
return this; return this;
} }
@ -58,7 +58,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param blockCacheSize block cache size in bytes * @param blockCacheSize block cache size in bytes
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setBlockCacheSize(long blockCacheSize) { public BlockBasedTableConfig setBlockCacheSize(final long blockCacheSize) {
blockCacheSize_ = blockCacheSize; blockCacheSize_ = blockCacheSize;
return this; return this;
} }
@ -79,7 +79,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* number means use default settings." * number means use default settings."
* @return the reference to the current option. * @return the reference to the current option.
*/ */
public BlockBasedTableConfig setCacheNumShardBits(int blockCacheNumShardBits) { public BlockBasedTableConfig setCacheNumShardBits(
final int blockCacheNumShardBits) {
blockCacheNumShardBits_ = blockCacheNumShardBits; blockCacheNumShardBits_ = blockCacheNumShardBits;
return this; return this;
} }
@ -105,7 +106,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param blockSize block size in bytes * @param blockSize block size in bytes
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setBlockSize(long blockSize) { public BlockBasedTableConfig setBlockSize(final long blockSize) {
blockSize_ = blockSize; blockSize_ = blockSize;
return this; return this;
} }
@ -128,7 +129,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param blockSizeDeviation the deviation to block size allowed * @param blockSizeDeviation the deviation to block size allowed
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setBlockSizeDeviation(int blockSizeDeviation) { public BlockBasedTableConfig setBlockSizeDeviation(
final int blockSizeDeviation) {
blockSizeDeviation_ = blockSizeDeviation; blockSizeDeviation_ = blockSizeDeviation;
return this; return this;
} }
@ -146,7 +148,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param restartInterval block restart interval. * @param restartInterval block restart interval.
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setBlockRestartInterval(int restartInterval) { public BlockBasedTableConfig setBlockRestartInterval(
final int restartInterval) {
blockRestartInterval_ = restartInterval; blockRestartInterval_ = restartInterval;
return this; return this;
} }
@ -166,7 +169,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param wholeKeyFiltering if enable whole key filtering * @param wholeKeyFiltering if enable whole key filtering
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setWholeKeyFiltering(boolean wholeKeyFiltering) { public BlockBasedTableConfig setWholeKeyFiltering(
final boolean wholeKeyFiltering) {
wholeKeyFiltering_ = wholeKeyFiltering; wholeKeyFiltering_ = wholeKeyFiltering;
return this; return this;
} }
@ -191,7 +195,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param filter {@link org.rocksdb.Filter} Filter Policy java instance. * @param filter {@link org.rocksdb.Filter} Filter Policy java instance.
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setFilter(Filter filter) { public BlockBasedTableConfig setFilter(
final Filter filter) {
filter_ = filter; filter_ = filter;
return this; return this;
} }
@ -216,7 +221,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setCacheIndexAndFilterBlocks( public BlockBasedTableConfig setCacheIndexAndFilterBlocks(
boolean cacheIndexAndFilterBlocks) { final boolean cacheIndexAndFilterBlocks) {
cacheIndexAndFilterBlocks_ = cacheIndexAndFilterBlocks; cacheIndexAndFilterBlocks_ = cacheIndexAndFilterBlocks;
return this; return this;
} }
@ -243,7 +248,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setHashIndexAllowCollision( public BlockBasedTableConfig setHashIndexAllowCollision(
boolean hashIndexAllowCollision) { final boolean hashIndexAllowCollision) {
hashIndexAllowCollision_ = hashIndexAllowCollision; hashIndexAllowCollision_ = hashIndexAllowCollision;
return this; return this;
} }
@ -266,7 +271,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public BlockBasedTableConfig setBlockCacheCompressedSize( public BlockBasedTableConfig setBlockCacheCompressedSize(
long blockCacheCompressedSize) { final long blockCacheCompressedSize) {
blockCacheCompressedSize_ = blockCacheCompressedSize; blockCacheCompressedSize_ = blockCacheCompressedSize;
return this; return this;
} }
@ -293,7 +298,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @return the reference to the current option. * @return the reference to the current option.
*/ */
public BlockBasedTableConfig setBlockCacheCompressedNumShardBits( public BlockBasedTableConfig setBlockCacheCompressedNumShardBits(
int blockCacheCompressedNumShardBits) { final int blockCacheCompressedNumShardBits) {
blockCacheCompressedNumShardBits_ = blockCacheCompressedNumShardBits; blockCacheCompressedNumShardBits_ = blockCacheCompressedNumShardBits;
return this; return this;
} }
@ -304,7 +309,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param checksumType {@link org.rocksdb.ChecksumType} value. * @param checksumType {@link org.rocksdb.ChecksumType} value.
* @return the reference to the current option. * @return the reference to the current option.
*/ */
public BlockBasedTableConfig setChecksumType(ChecksumType checksumType) { public BlockBasedTableConfig setChecksumType(
final ChecksumType checksumType) {
checksumType_ = checksumType; checksumType_ = checksumType;
return this; return this;
} }
@ -323,7 +329,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param indexType {@link org.rocksdb.IndexType} value * @param indexType {@link org.rocksdb.IndexType} value
* @return the reference to the current option. * @return the reference to the current option.
*/ */
public BlockBasedTableConfig setIndexType(IndexType indexType) { public BlockBasedTableConfig setIndexType(
final IndexType indexType) {
indexType_ = indexType; indexType_ = indexType;
return this; return this;
} }
@ -358,7 +365,8 @@ public class BlockBasedTableConfig extends TableFormatConfig {
* @param formatVersion integer representing the version to be used. * @param formatVersion integer representing the version to be used.
* @return the reference to the current option. * @return the reference to the current option.
*/ */
public BlockBasedTableConfig setFormatVersion(int formatVersion) { public BlockBasedTableConfig setFormatVersion(
final int formatVersion) {
assert(formatVersion >= 0 && formatVersion <= 2); assert(formatVersion >= 0 && formatVersion <= 2);
formatVersion_ = formatVersion; formatVersion_ = formatVersion;
return this; return this;

@ -49,7 +49,7 @@ public class BloomFilter extends Filter {
* *
* @param bitsPerKey number of bits to use * @param bitsPerKey number of bits to use
*/ */
public BloomFilter(int bitsPerKey) { public BloomFilter(final int bitsPerKey) {
this(bitsPerKey, DEFAULT_MODE); this(bitsPerKey, DEFAULT_MODE);
} }
@ -72,7 +72,7 @@ public class BloomFilter extends Filter {
* @param bitsPerKey number of bits to use * @param bitsPerKey number of bits to use
* @param useBlockBasedMode use block based mode or full filter mode * @param useBlockBasedMode use block based mode or full filter mode
*/ */
public BloomFilter(int bitsPerKey, boolean useBlockBasedMode) { public BloomFilter(final int bitsPerKey, final boolean useBlockBasedMode) {
super(); super();
bitsPerKey_ = bitsPerKey; bitsPerKey_ = bitsPerKey;
useBlockBasedMode_ = useBlockBasedMode; useBlockBasedMode_ = useBlockBasedMode;
@ -80,7 +80,7 @@ public class BloomFilter extends Filter {
} }
@Override @Override
protected void createNewFilter() { protected final void createNewFilter() {
createNewBloomFilter(bitsPerKey_, useBlockBasedMode_); createNewBloomFilter(bitsPerKey_, useBlockBasedMode_);
} }

@ -23,7 +23,7 @@ public class Checkpoint extends RocksObject {
* @throws java.lang.IllegalStateException if {@link RocksDB} * @throws java.lang.IllegalStateException if {@link RocksDB}
* instance is not initialized. * instance is not initialized.
*/ */
public static Checkpoint create(RocksDB db) { public static Checkpoint create(final RocksDB db) {
if (db == null) { if (db == null) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"RocksDB instance shall not be null."); "RocksDB instance shall not be null.");
@ -46,7 +46,7 @@ public class Checkpoint extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void createCheckpoint(String checkpointPath) public void createCheckpoint(final String checkpointPath)
throws RocksDBException { throws RocksDBException {
createCheckpoint(nativeHandle_, checkpointPath); createCheckpoint(nativeHandle_, checkpointPath);
} }
@ -62,7 +62,7 @@ public class Checkpoint extends RocksObject {
db_ = db; db_ = db;
} }
RocksDB db_; private RocksDB db_;
private static native long newCheckpoint(long dbHandle); private static native long newCheckpoint(long dbHandle);
private native void disposeInternal(long handle); private native void disposeInternal(long handle);

@ -10,7 +10,8 @@ package org.rocksdb;
* ColumnFamily Pointers. * ColumnFamily Pointers.
*/ */
public class ColumnFamilyHandle extends RocksObject { public class ColumnFamilyHandle extends RocksObject {
ColumnFamilyHandle(RocksDB rocksDB, long nativeHandle) { ColumnFamilyHandle(final RocksDB rocksDB,
final long nativeHandle) {
super(); super();
nativeHandle_ = nativeHandle; nativeHandle_ = nativeHandle;
// rocksDB must point to a valid RocksDB instance; // rocksDB must point to a valid RocksDB instance;

@ -51,7 +51,7 @@ public class ColumnFamilyOptions extends RocksObject
* {@link Properties} instance is passed to the method call. * {@link Properties} instance is passed to the method call.
*/ */
public static ColumnFamilyOptions getColumnFamilyOptionsFromProps( public static ColumnFamilyOptions getColumnFamilyOptionsFromProps(
Properties properties) { final Properties properties) {
if (properties == null || properties.size() == 0) { if (properties == null || properties.size() == 0) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Properties value must contain at least one value."); "Properties value must contain at least one value.");
@ -74,7 +74,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions optimizeForPointLookup( public ColumnFamilyOptions optimizeForPointLookup(
long blockCacheSizeMb) { final long blockCacheSizeMb) {
optimizeForPointLookup(nativeHandle_, optimizeForPointLookup(nativeHandle_,
blockCacheSizeMb); blockCacheSizeMb);
return this; return this;
@ -89,7 +89,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions optimizeLevelStyleCompaction( public ColumnFamilyOptions optimizeLevelStyleCompaction(
long memtableMemoryBudget) { final long memtableMemoryBudget) {
optimizeLevelStyleCompaction(nativeHandle_, optimizeLevelStyleCompaction(nativeHandle_,
memtableMemoryBudget); memtableMemoryBudget);
return this; return this;
@ -104,14 +104,14 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions optimizeUniversalStyleCompaction( public ColumnFamilyOptions optimizeUniversalStyleCompaction(
long memtableMemoryBudget) { final long memtableMemoryBudget) {
optimizeUniversalStyleCompaction(nativeHandle_, optimizeUniversalStyleCompaction(nativeHandle_,
memtableMemoryBudget); memtableMemoryBudget);
return this; return this;
} }
@Override @Override
public ColumnFamilyOptions setComparator(BuiltinComparator builtinComparator) { public ColumnFamilyOptions setComparator(final BuiltinComparator builtinComparator) {
assert(isInitialized()); assert(isInitialized());
setComparatorHandle(nativeHandle_, builtinComparator.ordinal()); setComparatorHandle(nativeHandle_, builtinComparator.ordinal());
return this; return this;
@ -119,7 +119,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setComparator( public ColumnFamilyOptions setComparator(
AbstractComparator<? extends AbstractSlice<?>> comparator) { final AbstractComparator<? extends AbstractSlice<?>> comparator) {
assert (isInitialized()); assert (isInitialized());
setComparatorHandle(nativeHandle_, comparator.nativeHandle_); setComparatorHandle(nativeHandle_, comparator.nativeHandle_);
comparator_ = comparator; comparator_ = comparator;
@ -127,7 +127,7 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMergeOperatorName(String name) { public ColumnFamilyOptions setMergeOperatorName(final String name) {
assert (isInitialized()); assert (isInitialized());
if (name == null) { if (name == null) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
@ -138,13 +138,13 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMergeOperator(MergeOperator mergeOperator) { public ColumnFamilyOptions setMergeOperator(final MergeOperator mergeOperator) {
setMergeOperator(nativeHandle_, mergeOperator.newMergeOperatorHandle()); setMergeOperator(nativeHandle_, mergeOperator.newMergeOperatorHandle());
return this; return this;
} }
@Override @Override
public ColumnFamilyOptions setWriteBufferSize(long writeBufferSize) public ColumnFamilyOptions setWriteBufferSize(final long writeBufferSize)
throws RocksDBException { throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
setWriteBufferSize(nativeHandle_, writeBufferSize); setWriteBufferSize(nativeHandle_, writeBufferSize);
@ -159,7 +159,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setMaxWriteBufferNumber( public ColumnFamilyOptions setMaxWriteBufferNumber(
int maxWriteBufferNumber) { final int maxWriteBufferNumber) {
assert(isInitialized()); assert(isInitialized());
setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber); setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber);
return this; return this;
@ -173,7 +173,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setMinWriteBufferNumberToMerge( public ColumnFamilyOptions setMinWriteBufferNumberToMerge(
int minWriteBufferNumberToMerge) { final int minWriteBufferNumberToMerge) {
setMinWriteBufferNumberToMerge(nativeHandle_, minWriteBufferNumberToMerge); setMinWriteBufferNumberToMerge(nativeHandle_, minWriteBufferNumberToMerge);
return this; return this;
} }
@ -184,14 +184,14 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions useFixedLengthPrefixExtractor(int n) { public ColumnFamilyOptions useFixedLengthPrefixExtractor(final int n) {
assert(isInitialized()); assert(isInitialized());
useFixedLengthPrefixExtractor(nativeHandle_, n); useFixedLengthPrefixExtractor(nativeHandle_, n);
return this; return this;
} }
@Override @Override
public ColumnFamilyOptions setCompressionType(CompressionType compressionType) { public ColumnFamilyOptions setCompressionType(final CompressionType compressionType) {
setCompressionType(nativeHandle_, compressionType.getValue()); setCompressionType(nativeHandle_, compressionType.getValue());
return this; return this;
} }
@ -202,7 +202,7 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setNumLevels(int numLevels) { public ColumnFamilyOptions setNumLevels(final int numLevels) {
setNumLevels(nativeHandle_, numLevels); setNumLevels(nativeHandle_, numLevels);
return this; return this;
} }
@ -214,7 +214,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setLevelZeroFileNumCompactionTrigger( public ColumnFamilyOptions setLevelZeroFileNumCompactionTrigger(
int numFiles) { final int numFiles) {
setLevelZeroFileNumCompactionTrigger( setLevelZeroFileNumCompactionTrigger(
nativeHandle_, numFiles); nativeHandle_, numFiles);
return this; return this;
@ -227,7 +227,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setLevelZeroSlowdownWritesTrigger( public ColumnFamilyOptions setLevelZeroSlowdownWritesTrigger(
int numFiles) { final int numFiles) {
setLevelZeroSlowdownWritesTrigger(nativeHandle_, numFiles); setLevelZeroSlowdownWritesTrigger(nativeHandle_, numFiles);
return this; return this;
} }
@ -238,7 +238,7 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setLevelZeroStopWritesTrigger(int numFiles) { public ColumnFamilyOptions setLevelZeroStopWritesTrigger(final int numFiles) {
setLevelZeroStopWritesTrigger(nativeHandle_, numFiles); setLevelZeroStopWritesTrigger(nativeHandle_, numFiles);
return this; return this;
} }
@ -250,7 +250,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setMaxMemCompactionLevel( public ColumnFamilyOptions setMaxMemCompactionLevel(
int maxMemCompactionLevel) { final int maxMemCompactionLevel) {
setMaxMemCompactionLevel(nativeHandle_, maxMemCompactionLevel); setMaxMemCompactionLevel(nativeHandle_, maxMemCompactionLevel);
return this; return this;
} }
@ -261,7 +261,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setTargetFileSizeBase(long targetFileSizeBase) { public ColumnFamilyOptions setTargetFileSizeBase(
final long targetFileSizeBase) {
setTargetFileSizeBase(nativeHandle_, targetFileSizeBase); setTargetFileSizeBase(nativeHandle_, targetFileSizeBase);
return this; return this;
} }
@ -272,7 +273,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setTargetFileSizeMultiplier(int multiplier) { public ColumnFamilyOptions setTargetFileSizeMultiplier(
final int multiplier) {
setTargetFileSizeMultiplier(nativeHandle_, multiplier); setTargetFileSizeMultiplier(nativeHandle_, multiplier);
return this; return this;
} }
@ -284,7 +286,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setMaxBytesForLevelBase( public ColumnFamilyOptions setMaxBytesForLevelBase(
long maxBytesForLevelBase) { final long maxBytesForLevelBase) {
setMaxBytesForLevelBase(nativeHandle_, maxBytesForLevelBase); setMaxBytesForLevelBase(nativeHandle_, maxBytesForLevelBase);
return this; return this;
} }
@ -295,7 +297,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMaxBytesForLevelMultiplier(int multiplier) { public ColumnFamilyOptions setMaxBytesForLevelMultiplier(
final int multiplier) {
setMaxBytesForLevelMultiplier(nativeHandle_, multiplier); setMaxBytesForLevelMultiplier(nativeHandle_, multiplier);
return this; return this;
} }
@ -306,7 +309,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setExpandedCompactionFactor(int expandedCompactionFactor) { public ColumnFamilyOptions setExpandedCompactionFactor(
final int expandedCompactionFactor) {
setExpandedCompactionFactor(nativeHandle_, expandedCompactionFactor); setExpandedCompactionFactor(nativeHandle_, expandedCompactionFactor);
return this; return this;
} }
@ -317,7 +321,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setSourceCompactionFactor(int sourceCompactionFactor) { public ColumnFamilyOptions setSourceCompactionFactor(
final int sourceCompactionFactor) {
setSourceCompactionFactor(nativeHandle_, sourceCompactionFactor); setSourceCompactionFactor(nativeHandle_, sourceCompactionFactor);
return this; return this;
} }
@ -329,7 +334,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setMaxGrandparentOverlapFactor( public ColumnFamilyOptions setMaxGrandparentOverlapFactor(
int maxGrandparentOverlapFactor) { final int maxGrandparentOverlapFactor) {
setMaxGrandparentOverlapFactor(nativeHandle_, maxGrandparentOverlapFactor); setMaxGrandparentOverlapFactor(nativeHandle_, maxGrandparentOverlapFactor);
return this; return this;
} }
@ -340,7 +345,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setSoftRateLimit(double softRateLimit) { public ColumnFamilyOptions setSoftRateLimit(
final double softRateLimit) {
setSoftRateLimit(nativeHandle_, softRateLimit); setSoftRateLimit(nativeHandle_, softRateLimit);
return this; return this;
} }
@ -351,7 +357,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setHardRateLimit(double hardRateLimit) { public ColumnFamilyOptions setHardRateLimit(
final double hardRateLimit) {
setHardRateLimit(nativeHandle_, hardRateLimit); setHardRateLimit(nativeHandle_, hardRateLimit);
return this; return this;
} }
@ -363,7 +370,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setRateLimitDelayMaxMilliseconds( public ColumnFamilyOptions setRateLimitDelayMaxMilliseconds(
int rateLimitDelayMaxMilliseconds) { final int rateLimitDelayMaxMilliseconds) {
setRateLimitDelayMaxMilliseconds( setRateLimitDelayMaxMilliseconds(
nativeHandle_, rateLimitDelayMaxMilliseconds); nativeHandle_, rateLimitDelayMaxMilliseconds);
return this; return this;
@ -375,7 +382,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setArenaBlockSize(long arenaBlockSize) public ColumnFamilyOptions setArenaBlockSize(
final long arenaBlockSize)
throws RocksDBException { throws RocksDBException {
setArenaBlockSize(nativeHandle_, arenaBlockSize); setArenaBlockSize(nativeHandle_, arenaBlockSize);
return this; return this;
@ -387,7 +395,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setDisableAutoCompactions(boolean disableAutoCompactions) { public ColumnFamilyOptions setDisableAutoCompactions(
final boolean disableAutoCompactions) {
setDisableAutoCompactions(nativeHandle_, disableAutoCompactions); setDisableAutoCompactions(nativeHandle_, disableAutoCompactions);
return this; return this;
} }
@ -399,7 +408,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setPurgeRedundantKvsWhileFlush( public ColumnFamilyOptions setPurgeRedundantKvsWhileFlush(
boolean purgeRedundantKvsWhileFlush) { final boolean purgeRedundantKvsWhileFlush) {
setPurgeRedundantKvsWhileFlush( setPurgeRedundantKvsWhileFlush(
nativeHandle_, purgeRedundantKvsWhileFlush); nativeHandle_, purgeRedundantKvsWhileFlush);
return this; return this;
@ -411,7 +420,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setCompactionStyle(CompactionStyle compactionStyle) { public ColumnFamilyOptions setCompactionStyle(
final CompactionStyle compactionStyle) {
setCompactionStyle(nativeHandle_, compactionStyle.getValue()); setCompactionStyle(nativeHandle_, compactionStyle.getValue());
return this; return this;
} }
@ -423,7 +433,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override @Override
public ColumnFamilyOptions setVerifyChecksumsInCompaction( public ColumnFamilyOptions setVerifyChecksumsInCompaction(
boolean verifyChecksumsInCompaction) { final boolean verifyChecksumsInCompaction) {
setVerifyChecksumsInCompaction( setVerifyChecksumsInCompaction(
nativeHandle_, verifyChecksumsInCompaction); nativeHandle_, verifyChecksumsInCompaction);
return this; return this;
@ -435,7 +445,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setFilterDeletes(boolean filterDeletes) { public ColumnFamilyOptions setFilterDeletes(
final boolean filterDeletes) {
setFilterDeletes(nativeHandle_, filterDeletes); setFilterDeletes(nativeHandle_, filterDeletes);
return this; return this;
} }
@ -446,7 +457,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations) { public ColumnFamilyOptions setMaxSequentialSkipInIterations(
final long maxSequentialSkipInIterations) {
setMaxSequentialSkipInIterations(nativeHandle_, maxSequentialSkipInIterations); setMaxSequentialSkipInIterations(nativeHandle_, maxSequentialSkipInIterations);
return this; return this;
} }
@ -457,8 +469,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMemTableConfig(MemTableConfig config) public ColumnFamilyOptions setMemTableConfig(
throws RocksDBException { final MemTableConfig config) throws RocksDBException {
memTableConfig_ = config; memTableConfig_ = config;
setMemTableFactory(nativeHandle_, config.newMemTableFactoryHandle()); setMemTableFactory(nativeHandle_, config.newMemTableFactoryHandle());
return this; return this;
@ -471,7 +483,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setTableFormatConfig(TableFormatConfig config) { public ColumnFamilyOptions setTableFormatConfig(
final TableFormatConfig config) {
tableFormatConfig_ = config; tableFormatConfig_ = config;
setTableFactory(nativeHandle_, config.newTableFactoryHandle()); setTableFactory(nativeHandle_, config.newTableFactoryHandle());
return this; return this;
@ -484,7 +497,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setInplaceUpdateSupport(boolean inplaceUpdateSupport) { public ColumnFamilyOptions setInplaceUpdateSupport(
final boolean inplaceUpdateSupport) {
setInplaceUpdateSupport(nativeHandle_, inplaceUpdateSupport); setInplaceUpdateSupport(nativeHandle_, inplaceUpdateSupport);
return this; return this;
} }
@ -495,7 +509,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setInplaceUpdateNumLocks(long inplaceUpdateNumLocks) public ColumnFamilyOptions setInplaceUpdateNumLocks(
final long inplaceUpdateNumLocks)
throws RocksDBException { throws RocksDBException {
setInplaceUpdateNumLocks(nativeHandle_, inplaceUpdateNumLocks); setInplaceUpdateNumLocks(nativeHandle_, inplaceUpdateNumLocks);
return this; return this;
@ -507,7 +522,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMemtablePrefixBloomBits(int memtablePrefixBloomBits) { public ColumnFamilyOptions setMemtablePrefixBloomBits(
final int memtablePrefixBloomBits) {
setMemtablePrefixBloomBits(nativeHandle_, memtablePrefixBloomBits); setMemtablePrefixBloomBits(nativeHandle_, memtablePrefixBloomBits);
return this; return this;
} }
@ -518,7 +534,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMemtablePrefixBloomProbes(int memtablePrefixBloomProbes) { public ColumnFamilyOptions setMemtablePrefixBloomProbes(
final int memtablePrefixBloomProbes) {
setMemtablePrefixBloomProbes(nativeHandle_, memtablePrefixBloomProbes); setMemtablePrefixBloomProbes(nativeHandle_, memtablePrefixBloomProbes);
return this; return this;
} }
@ -540,8 +557,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMaxSuccessiveMerges(long maxSuccessiveMerges) public ColumnFamilyOptions setMaxSuccessiveMerges(
throws RocksDBException { final long maxSuccessiveMerges) throws RocksDBException {
setMaxSuccessiveMerges(nativeHandle_, maxSuccessiveMerges); setMaxSuccessiveMerges(nativeHandle_, maxSuccessiveMerges);
return this; return this;
} }
@ -552,7 +569,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setMinPartialMergeOperands(int minPartialMergeOperands) { public ColumnFamilyOptions setMinPartialMergeOperands(
final int minPartialMergeOperands) {
setMinPartialMergeOperands(nativeHandle_, minPartialMergeOperands); setMinPartialMergeOperands(nativeHandle_, minPartialMergeOperands);
return this; return this;
} }
@ -577,7 +595,7 @@ public class ColumnFamilyOptions extends RocksObject
* *
* @param handle native handle to ColumnFamilyOptions instance. * @param handle native handle to ColumnFamilyOptions instance.
*/ */
private ColumnFamilyOptions(long handle) { private ColumnFamilyOptions(final long handle) {
super(); super();
nativeHandle_ = handle; nativeHandle_ = handle;
} }

@ -51,7 +51,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
* {@link java.util.Properties} instance is passed to the method call. * {@link java.util.Properties} instance is passed to the method call.
*/ */
public static DBOptions getDBOptionsFromProps( public static DBOptions getDBOptionsFromProps(
Properties properties) { final Properties properties) {
if (properties == null || properties.size() == 0) { if (properties == null || properties.size() == 0) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Properties value must contain at least one value."); "Properties value must contain at least one value.");
@ -73,14 +73,15 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setIncreaseParallelism(int totalThreads) { public DBOptions setIncreaseParallelism(
final int totalThreads) {
assert (isInitialized()); assert (isInitialized());
setIncreaseParallelism(nativeHandle_, totalThreads); setIncreaseParallelism(nativeHandle_, totalThreads);
return this; return this;
} }
@Override @Override
public DBOptions setCreateIfMissing(boolean flag) { public DBOptions setCreateIfMissing(final boolean flag) {
assert(isInitialized()); assert(isInitialized());
setCreateIfMissing(nativeHandle_, flag); setCreateIfMissing(nativeHandle_, flag);
return this; return this;
@ -93,7 +94,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setCreateMissingColumnFamilies(boolean flag) { public DBOptions setCreateMissingColumnFamilies(
final boolean flag) {
assert(isInitialized()); assert(isInitialized());
setCreateMissingColumnFamilies(nativeHandle_, flag); setCreateMissingColumnFamilies(nativeHandle_, flag);
return this; return this;
@ -106,7 +108,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setErrorIfExists(boolean errorIfExists) { public DBOptions setErrorIfExists(
final boolean errorIfExists) {
assert(isInitialized()); assert(isInitialized());
setErrorIfExists(nativeHandle_, errorIfExists); setErrorIfExists(nativeHandle_, errorIfExists);
return this; return this;
@ -119,7 +122,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setParanoidChecks(boolean paranoidChecks) { public DBOptions setParanoidChecks(
final boolean paranoidChecks) {
assert(isInitialized()); assert(isInitialized());
setParanoidChecks(nativeHandle_, paranoidChecks); setParanoidChecks(nativeHandle_, paranoidChecks);
return this; return this;
@ -132,7 +136,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setRateLimiterConfig(RateLimiterConfig config) { public DBOptions setRateLimiterConfig(
final RateLimiterConfig config) {
assert(isInitialized()); assert(isInitialized());
rateLimiterConfig_ = config; rateLimiterConfig_ = config;
setRateLimiter(nativeHandle_, config.newRateLimiterHandle()); setRateLimiter(nativeHandle_, config.newRateLimiterHandle());
@ -140,7 +145,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setInfoLogLevel(InfoLogLevel infoLogLevel) { public DBOptions setInfoLogLevel(
final InfoLogLevel infoLogLevel) {
assert(isInitialized()); assert(isInitialized());
setInfoLogLevel(nativeHandle_, infoLogLevel.getValue()); setInfoLogLevel(nativeHandle_, infoLogLevel.getValue());
return this; return this;
@ -154,7 +160,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setMaxOpenFiles(int maxOpenFiles) { public DBOptions setMaxOpenFiles(
final int maxOpenFiles) {
assert(isInitialized()); assert(isInitialized());
setMaxOpenFiles(nativeHandle_, maxOpenFiles); setMaxOpenFiles(nativeHandle_, maxOpenFiles);
return this; return this;
@ -167,7 +174,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setMaxTotalWalSize(long maxTotalWalSize) { public DBOptions setMaxTotalWalSize(
final long maxTotalWalSize) {
assert(isInitialized()); assert(isInitialized());
setMaxTotalWalSize(nativeHandle_, maxTotalWalSize); setMaxTotalWalSize(nativeHandle_, maxTotalWalSize);
return this; return this;
@ -200,7 +208,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setDisableDataSync(boolean disableDataSync) { public DBOptions setDisableDataSync(
final boolean disableDataSync) {
assert(isInitialized()); assert(isInitialized());
setDisableDataSync(nativeHandle_, disableDataSync); setDisableDataSync(nativeHandle_, disableDataSync);
return this; return this;
@ -213,7 +222,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setUseFsync(boolean useFsync) { public DBOptions setUseFsync(
final boolean useFsync) {
assert(isInitialized()); assert(isInitialized());
setUseFsync(nativeHandle_, useFsync); setUseFsync(nativeHandle_, useFsync);
return this; return this;
@ -226,7 +236,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setDbLogDir(String dbLogDir) { public DBOptions setDbLogDir(
final String dbLogDir) {
assert(isInitialized()); assert(isInitialized());
setDbLogDir(nativeHandle_, dbLogDir); setDbLogDir(nativeHandle_, dbLogDir);
return this; return this;
@ -239,7 +250,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setWalDir(String walDir) { public DBOptions setWalDir(
final String walDir) {
assert(isInitialized()); assert(isInitialized());
setWalDir(nativeHandle_, walDir); setWalDir(nativeHandle_, walDir);
return this; return this;
@ -252,7 +264,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setDeleteObsoleteFilesPeriodMicros(long micros) { public DBOptions setDeleteObsoleteFilesPeriodMicros(
final long micros) {
assert(isInitialized()); assert(isInitialized());
setDeleteObsoleteFilesPeriodMicros(nativeHandle_, micros); setDeleteObsoleteFilesPeriodMicros(nativeHandle_, micros);
return this; return this;
@ -265,7 +278,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setMaxBackgroundCompactions(int maxBackgroundCompactions) { public DBOptions setMaxBackgroundCompactions(
final int maxBackgroundCompactions) {
assert(isInitialized()); assert(isInitialized());
setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions); setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions);
return this; return this;
@ -278,7 +292,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setMaxBackgroundFlushes(int maxBackgroundFlushes) { public DBOptions setMaxBackgroundFlushes(
final int maxBackgroundFlushes) {
assert(isInitialized()); assert(isInitialized());
setMaxBackgroundFlushes(nativeHandle_, maxBackgroundFlushes); setMaxBackgroundFlushes(nativeHandle_, maxBackgroundFlushes);
return this; return this;
@ -291,8 +306,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setMaxLogFileSize(long maxLogFileSize) public DBOptions setMaxLogFileSize(
throws RocksDBException { final long maxLogFileSize) throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
setMaxLogFileSize(nativeHandle_, maxLogFileSize); setMaxLogFileSize(nativeHandle_, maxLogFileSize);
return this; return this;
@ -305,8 +320,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setLogFileTimeToRoll(long logFileTimeToRoll) public DBOptions setLogFileTimeToRoll(
throws RocksDBException{ final long logFileTimeToRoll) throws RocksDBException{
assert(isInitialized()); assert(isInitialized());
setLogFileTimeToRoll(nativeHandle_, logFileTimeToRoll); setLogFileTimeToRoll(nativeHandle_, logFileTimeToRoll);
return this; return this;
@ -319,8 +334,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setKeepLogFileNum(long keepLogFileNum) public DBOptions setKeepLogFileNum(
throws RocksDBException{ final long keepLogFileNum) throws RocksDBException{
assert(isInitialized()); assert(isInitialized());
setKeepLogFileNum(nativeHandle_, keepLogFileNum); setKeepLogFileNum(nativeHandle_, keepLogFileNum);
return this; return this;
@ -333,7 +348,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setMaxManifestFileSize(long maxManifestFileSize) { public DBOptions setMaxManifestFileSize(
final long maxManifestFileSize) {
assert(isInitialized()); assert(isInitialized());
setMaxManifestFileSize(nativeHandle_, maxManifestFileSize); setMaxManifestFileSize(nativeHandle_, maxManifestFileSize);
return this; return this;
@ -346,7 +362,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setTableCacheNumshardbits(int tableCacheNumshardbits) { public DBOptions setTableCacheNumshardbits(
final int tableCacheNumshardbits) {
assert(isInitialized()); assert(isInitialized());
setTableCacheNumshardbits(nativeHandle_, tableCacheNumshardbits); setTableCacheNumshardbits(nativeHandle_, tableCacheNumshardbits);
return this; return this;
@ -359,7 +376,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setTableCacheRemoveScanCountLimit(int limit) { public DBOptions setTableCacheRemoveScanCountLimit(
final int limit) {
assert(isInitialized()); assert(isInitialized());
setTableCacheRemoveScanCountLimit(nativeHandle_, limit); setTableCacheRemoveScanCountLimit(nativeHandle_, limit);
return this; return this;
@ -372,7 +390,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setWalTtlSeconds(long walTtlSeconds) { public DBOptions setWalTtlSeconds(
final long walTtlSeconds) {
assert(isInitialized()); assert(isInitialized());
setWalTtlSeconds(nativeHandle_, walTtlSeconds); setWalTtlSeconds(nativeHandle_, walTtlSeconds);
return this; return this;
@ -385,7 +404,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setWalSizeLimitMB(long sizeLimitMB) { public DBOptions setWalSizeLimitMB(
final long sizeLimitMB) {
assert(isInitialized()); assert(isInitialized());
setWalSizeLimitMB(nativeHandle_, sizeLimitMB); setWalSizeLimitMB(nativeHandle_, sizeLimitMB);
return this; return this;
@ -398,8 +418,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setManifestPreallocationSize(long size) public DBOptions setManifestPreallocationSize(
throws RocksDBException { final long size) throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
setManifestPreallocationSize(nativeHandle_, size); setManifestPreallocationSize(nativeHandle_, size);
return this; return this;
@ -412,7 +432,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setAllowOsBuffer(boolean allowOsBuffer) { public DBOptions setAllowOsBuffer(
final boolean allowOsBuffer) {
assert(isInitialized()); assert(isInitialized());
setAllowOsBuffer(nativeHandle_, allowOsBuffer); setAllowOsBuffer(nativeHandle_, allowOsBuffer);
return this; return this;
@ -425,7 +446,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setAllowMmapReads(boolean allowMmapReads) { public DBOptions setAllowMmapReads(
final boolean allowMmapReads) {
assert(isInitialized()); assert(isInitialized());
setAllowMmapReads(nativeHandle_, allowMmapReads); setAllowMmapReads(nativeHandle_, allowMmapReads);
return this; return this;
@ -438,7 +460,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setAllowMmapWrites(boolean allowMmapWrites) { public DBOptions setAllowMmapWrites(
final boolean allowMmapWrites) {
assert(isInitialized()); assert(isInitialized());
setAllowMmapWrites(nativeHandle_, allowMmapWrites); setAllowMmapWrites(nativeHandle_, allowMmapWrites);
return this; return this;
@ -451,7 +474,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setIsFdCloseOnExec(boolean isFdCloseOnExec) { public DBOptions setIsFdCloseOnExec(
final boolean isFdCloseOnExec) {
assert(isInitialized()); assert(isInitialized());
setIsFdCloseOnExec(nativeHandle_, isFdCloseOnExec); setIsFdCloseOnExec(nativeHandle_, isFdCloseOnExec);
return this; return this;
@ -465,7 +489,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
@Override @Override
@Deprecated @Deprecated
public DBOptions setSkipLogErrorOnRecovery(boolean skip) { public DBOptions setSkipLogErrorOnRecovery(
final boolean skip) {
assert(isInitialized()); assert(isInitialized());
setSkipLogErrorOnRecovery(nativeHandle_, skip); setSkipLogErrorOnRecovery(nativeHandle_, skip);
return this; return this;
@ -479,7 +504,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setStatsDumpPeriodSec(int statsDumpPeriodSec) { public DBOptions setStatsDumpPeriodSec(
final int statsDumpPeriodSec) {
assert(isInitialized()); assert(isInitialized());
setStatsDumpPeriodSec(nativeHandle_, statsDumpPeriodSec); setStatsDumpPeriodSec(nativeHandle_, statsDumpPeriodSec);
return this; return this;
@ -492,7 +518,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setAdviseRandomOnOpen(boolean adviseRandomOnOpen) { public DBOptions setAdviseRandomOnOpen(
final boolean adviseRandomOnOpen) {
assert(isInitialized()); assert(isInitialized());
setAdviseRandomOnOpen(nativeHandle_, adviseRandomOnOpen); setAdviseRandomOnOpen(nativeHandle_, adviseRandomOnOpen);
return this; return this;
@ -504,7 +531,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setUseAdaptiveMutex(boolean useAdaptiveMutex) { public DBOptions setUseAdaptiveMutex(
final boolean useAdaptiveMutex) {
assert(isInitialized()); assert(isInitialized());
setUseAdaptiveMutex(nativeHandle_, useAdaptiveMutex); setUseAdaptiveMutex(nativeHandle_, useAdaptiveMutex);
return this; return this;
@ -517,7 +545,8 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
} }
@Override @Override
public DBOptions setBytesPerSync(long bytesPerSync) { public DBOptions setBytesPerSync(
final long bytesPerSync) {
assert(isInitialized()); assert(isInitialized());
setBytesPerSync(nativeHandle_, bytesPerSync); setBytesPerSync(nativeHandle_, bytesPerSync);
return this; return this;
@ -545,7 +574,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
* *
* @param handle native handle to DBOptions instance. * @param handle native handle to DBOptions instance.
*/ */
private DBOptions(long handle) { private DBOptions(final long handle) {
super(); super();
nativeHandle_ = handle; nativeHandle_ = handle;
} }

@ -22,7 +22,7 @@ public class FlushOptions extends RocksObject {
* *
* @return instance of current FlushOptions. * @return instance of current FlushOptions.
*/ */
public FlushOptions setWaitForFlush(boolean waitForFlush) { public FlushOptions setWaitForFlush(final boolean waitForFlush) {
assert(isInitialized()); assert(isInitialized());
setWaitForFlush(nativeHandle_, waitForFlush); setWaitForFlush(nativeHandle_, waitForFlush);
return this; return this;

@ -34,8 +34,8 @@ public class GenericRateLimiterConfig extends RateLimiterConfig {
* fairness chance even though high-pri requests exist to avoid starvation. * fairness chance even though high-pri requests exist to avoid starvation.
* You should be good by leaving it at default 10. * You should be good by leaving it at default 10.
*/ */
public GenericRateLimiterConfig(long rateBytesPerSecond, public GenericRateLimiterConfig(final long rateBytesPerSecond,
long refillPeriodMicros, int fairness) { final long refillPeriodMicros, final int fairness) {
rateBytesPerSecond_ = rateBytesPerSecond; rateBytesPerSecond_ = rateBytesPerSecond;
refillPeriodMicros_ = refillPeriodMicros; refillPeriodMicros_ = refillPeriodMicros;
fairness_ = fairness; fairness_ = fairness;
@ -49,7 +49,7 @@ public class GenericRateLimiterConfig extends RateLimiterConfig {
* and flush in bytes per second. Currently, RocksDB does not enforce * and flush in bytes per second. Currently, RocksDB does not enforce
* rate limit for anything other than flush and compaction, e.g. write to WAL. * rate limit for anything other than flush and compaction, e.g. write to WAL.
*/ */
public GenericRateLimiterConfig(long rateBytesPerSecond) { public GenericRateLimiterConfig(final long rateBytesPerSecond) {
this(rateBytesPerSecond, DEFAULT_REFILL_PERIOD_MICROS, DEFAULT_FAIRNESS); this(rateBytesPerSecond, DEFAULT_REFILL_PERIOD_MICROS, DEFAULT_FAIRNESS);
} }

@ -39,7 +39,8 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
* @param count the number of hash buckets. * @param count the number of hash buckets.
* @return the reference to the current HashLinkedListMemTableConfig. * @return the reference to the current HashLinkedListMemTableConfig.
*/ */
public HashLinkedListMemTableConfig setBucketCount(long count) { public HashLinkedListMemTableConfig setBucketCount(
final long count) {
bucketCount_ = count; bucketCount_ = count;
return this; return this;
} }
@ -66,7 +67,8 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
* @param size if set to {@code <= 0} hashtable bytes from malloc * @param size if set to {@code <= 0} hashtable bytes from malloc
* @return the reference to the current HashLinkedListMemTableConfig. * @return the reference to the current HashLinkedListMemTableConfig.
*/ */
public HashLinkedListMemTableConfig setHugePageTlbSize(long size) { public HashLinkedListMemTableConfig setHugePageTlbSize(
final long size) {
hugePageTlbSize_ = size; hugePageTlbSize_ = size;
return this; return this;
} }
@ -89,7 +91,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
* @return the reference to the current HashLinkedListMemTableConfig. * @return the reference to the current HashLinkedListMemTableConfig.
*/ */
public HashLinkedListMemTableConfig public HashLinkedListMemTableConfig
setBucketEntriesLoggingThreshold(int threshold) { setBucketEntriesLoggingThreshold(final int threshold) {
bucketEntriesLoggingThreshold_ = threshold; bucketEntriesLoggingThreshold_ = threshold;
return this; return this;
} }
@ -113,7 +115,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
* @return the reference to the current HashLinkedListMemTableConfig. * @return the reference to the current HashLinkedListMemTableConfig.
*/ */
public HashLinkedListMemTableConfig public HashLinkedListMemTableConfig
setIfLogBucketDistWhenFlush(boolean logDistribution) { setIfLogBucketDistWhenFlush(final boolean logDistribution) {
ifLogBucketDistWhenFlush_ = logDistribution; ifLogBucketDistWhenFlush_ = logDistribution;
return this; return this;
} }
@ -137,7 +139,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
* @return the reference to the current HashLinkedListMemTableConfig. * @return the reference to the current HashLinkedListMemTableConfig.
*/ */
public HashLinkedListMemTableConfig public HashLinkedListMemTableConfig
setThresholdUseSkiplist(int threshold) { setThresholdUseSkiplist(final int threshold) {
thresholdUseSkiplist_ = threshold; thresholdUseSkiplist_ = threshold;
return this; return this;
} }

@ -35,7 +35,8 @@ public class HashSkipListMemTableConfig extends MemTableConfig {
* skiplist memtable. * skiplist memtable.
* @return the reference to the current HashSkipListMemTableConfig. * @return the reference to the current HashSkipListMemTableConfig.
*/ */
public HashSkipListMemTableConfig setBucketCount(long count) { public HashSkipListMemTableConfig setBucketCount(
final long count) {
bucketCount_ = count; bucketCount_ = count;
return this; return this;
} }
@ -54,7 +55,7 @@ public class HashSkipListMemTableConfig extends MemTableConfig {
* *
* @return the reference to the current HashSkipListMemTableConfig. * @return the reference to the current HashSkipListMemTableConfig.
*/ */
public HashSkipListMemTableConfig setHeight(int height) { public HashSkipListMemTableConfig setHeight(final int height) {
height_ = height; height_ = height;
return this; return this;
} }
@ -75,7 +76,8 @@ public class HashSkipListMemTableConfig extends MemTableConfig {
* lists in the skip list. * lists in the skip list.
* @return the reference to the current HashSkipListMemTableConfig. * @return the reference to the current HashSkipListMemTableConfig.
*/ */
public HashSkipListMemTableConfig setBranchingFactor(int bf) { public HashSkipListMemTableConfig setBranchingFactor(
final int bf) {
branchingFactor_ = bf; branchingFactor_ = bf;
return this; return this;
} }

@ -12,8 +12,9 @@ public class HistogramData {
private final double average_; private final double average_;
private final double standardDeviation_; private final double standardDeviation_;
public HistogramData(double median, double percentile95, public HistogramData(final double median, final double percentile95,
double percentile99, double average, double standardDeviation) { final double percentile99, final double average,
final double standardDeviation) {
median_ = median; median_ = median;
percentile95_ = percentile95; percentile95_ = percentile95;
percentile99_ = percentile99; percentile99_ = percentile99;

@ -37,28 +37,29 @@ public class Options extends RocksObject
* @param columnFamilyOptions {@link org.rocksdb.ColumnFamilyOptions} * @param columnFamilyOptions {@link org.rocksdb.ColumnFamilyOptions}
* instance * instance
*/ */
public Options(DBOptions dbOptions, ColumnFamilyOptions columnFamilyOptions) { public Options(final DBOptions dbOptions,
final ColumnFamilyOptions columnFamilyOptions) {
super(); super();
newOptions(dbOptions.nativeHandle_, columnFamilyOptions.nativeHandle_); newOptions(dbOptions.nativeHandle_, columnFamilyOptions.nativeHandle_);
env_ = RocksEnv.getDefault(); env_ = RocksEnv.getDefault();
} }
@Override @Override
public Options setIncreaseParallelism(int totalThreads) { public Options setIncreaseParallelism(final int totalThreads) {
assert(isInitialized()); assert(isInitialized());
setIncreaseParallelism(nativeHandle_, totalThreads); setIncreaseParallelism(nativeHandle_, totalThreads);
return this; return this;
} }
@Override @Override
public Options setCreateIfMissing(boolean flag) { public Options setCreateIfMissing(final boolean flag) {
assert(isInitialized()); assert(isInitialized());
setCreateIfMissing(nativeHandle_, flag); setCreateIfMissing(nativeHandle_, flag);
return this; return this;
} }
@Override @Override
public Options setCreateMissingColumnFamilies(boolean flag) { public Options setCreateMissingColumnFamilies(final boolean flag) {
assert(isInitialized()); assert(isInitialized());
setCreateMissingColumnFamilies(nativeHandle_, flag); setCreateMissingColumnFamilies(nativeHandle_, flag);
return this; return this;
@ -72,7 +73,7 @@ public class Options extends RocksObject
* @param env {@link RocksEnv} instance. * @param env {@link RocksEnv} instance.
* @return the instance of the current Options. * @return the instance of the current Options.
*/ */
public Options setEnv(RocksEnv env) { public Options setEnv(final RocksEnv env) {
assert(isInitialized()); assert(isInitialized());
setEnv(nativeHandle_, env.nativeHandle_); setEnv(nativeHandle_, env.nativeHandle_);
env_ = env; env_ = env;
@ -149,14 +150,14 @@ public class Options extends RocksObject
@Override @Override
public Options optimizeUniversalStyleCompaction( public Options optimizeUniversalStyleCompaction(
long memtableMemoryBudget) { final long memtableMemoryBudget) {
optimizeUniversalStyleCompaction(nativeHandle_, optimizeUniversalStyleCompaction(nativeHandle_,
memtableMemoryBudget); memtableMemoryBudget);
return this; return this;
} }
@Override @Override
public Options setComparator(BuiltinComparator builtinComparator) { public Options setComparator(final BuiltinComparator builtinComparator) {
assert(isInitialized()); assert(isInitialized());
setComparatorHandle(nativeHandle_, builtinComparator.ordinal()); setComparatorHandle(nativeHandle_, builtinComparator.ordinal());
return this; return this;
@ -164,7 +165,7 @@ public class Options extends RocksObject
@Override @Override
public Options setComparator( public Options setComparator(
AbstractComparator<? extends AbstractSlice<?>> comparator) { final AbstractComparator<? extends AbstractSlice<?>> comparator) {
assert (isInitialized()); assert (isInitialized());
setComparatorHandle(nativeHandle_, comparator.nativeHandle_); setComparatorHandle(nativeHandle_, comparator.nativeHandle_);
comparator_ = comparator; comparator_ = comparator;
@ -172,7 +173,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMergeOperatorName(String name) { public Options setMergeOperatorName(final String name) {
assert (isInitialized()); assert (isInitialized());
if (name == null) { if (name == null) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
@ -183,13 +184,13 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMergeOperator(MergeOperator mergeOperator) { public Options setMergeOperator(final MergeOperator mergeOperator) {
setMergeOperator(nativeHandle_, mergeOperator.newMergeOperatorHandle()); setMergeOperator(nativeHandle_, mergeOperator.newMergeOperatorHandle());
return this; return this;
} }
@Override @Override
public Options setWriteBufferSize(long writeBufferSize) public Options setWriteBufferSize(final long writeBufferSize)
throws RocksDBException { throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
setWriteBufferSize(nativeHandle_, writeBufferSize); setWriteBufferSize(nativeHandle_, writeBufferSize);
@ -203,7 +204,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxWriteBufferNumber(int maxWriteBufferNumber) { public Options setMaxWriteBufferNumber(final int maxWriteBufferNumber) {
assert(isInitialized()); assert(isInitialized());
setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber); setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber);
return this; return this;
@ -222,7 +223,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setErrorIfExists(boolean errorIfExists) { public Options setErrorIfExists(final boolean errorIfExists) {
assert(isInitialized()); assert(isInitialized());
setErrorIfExists(nativeHandle_, errorIfExists); setErrorIfExists(nativeHandle_, errorIfExists);
return this; return this;
@ -235,7 +236,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setParanoidChecks(boolean paranoidChecks) { public Options setParanoidChecks(final boolean paranoidChecks) {
assert(isInitialized()); assert(isInitialized());
setParanoidChecks(nativeHandle_, paranoidChecks); setParanoidChecks(nativeHandle_, paranoidChecks);
return this; return this;
@ -248,7 +249,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxTotalWalSize(long maxTotalWalSize) { public Options setMaxTotalWalSize(final long maxTotalWalSize) {
assert(isInitialized()); assert(isInitialized());
setMaxTotalWalSize(nativeHandle_, maxTotalWalSize); setMaxTotalWalSize(nativeHandle_, maxTotalWalSize);
return this; return this;
@ -261,7 +262,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxOpenFiles(int maxOpenFiles) { public Options setMaxOpenFiles(final int maxOpenFiles) {
assert(isInitialized()); assert(isInitialized());
setMaxOpenFiles(nativeHandle_, maxOpenFiles); setMaxOpenFiles(nativeHandle_, maxOpenFiles);
return this; return this;
@ -274,7 +275,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setDisableDataSync(boolean disableDataSync) { public Options setDisableDataSync(final boolean disableDataSync) {
assert(isInitialized()); assert(isInitialized());
setDisableDataSync(nativeHandle_, disableDataSync); setDisableDataSync(nativeHandle_, disableDataSync);
return this; return this;
@ -287,7 +288,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setUseFsync(boolean useFsync) { public Options setUseFsync(final boolean useFsync) {
assert(isInitialized()); assert(isInitialized());
setUseFsync(nativeHandle_, useFsync); setUseFsync(nativeHandle_, useFsync);
return this; return this;
@ -300,7 +301,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setDbLogDir(String dbLogDir) { public Options setDbLogDir(final String dbLogDir) {
assert(isInitialized()); assert(isInitialized());
setDbLogDir(nativeHandle_, dbLogDir); setDbLogDir(nativeHandle_, dbLogDir);
return this; return this;
@ -313,7 +314,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setWalDir(String walDir) { public Options setWalDir(final String walDir) {
assert(isInitialized()); assert(isInitialized());
setWalDir(nativeHandle_, walDir); setWalDir(nativeHandle_, walDir);
return this; return this;
@ -326,7 +327,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setDeleteObsoleteFilesPeriodMicros(long micros) { public Options setDeleteObsoleteFilesPeriodMicros(
final long micros) {
assert(isInitialized()); assert(isInitialized());
setDeleteObsoleteFilesPeriodMicros(nativeHandle_, micros); setDeleteObsoleteFilesPeriodMicros(nativeHandle_, micros);
return this; return this;
@ -359,7 +361,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxBackgroundCompactions(int maxBackgroundCompactions) { public Options setMaxBackgroundCompactions(
final int maxBackgroundCompactions) {
assert(isInitialized()); assert(isInitialized());
setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions); setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions);
return this; return this;
@ -372,7 +375,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxBackgroundFlushes(int maxBackgroundFlushes) { public Options setMaxBackgroundFlushes(
final int maxBackgroundFlushes) {
assert(isInitialized()); assert(isInitialized());
setMaxBackgroundFlushes(nativeHandle_, maxBackgroundFlushes); setMaxBackgroundFlushes(nativeHandle_, maxBackgroundFlushes);
return this; return this;
@ -385,7 +389,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxLogFileSize(long maxLogFileSize) public Options setMaxLogFileSize(final long maxLogFileSize)
throws RocksDBException { throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
setMaxLogFileSize(nativeHandle_, maxLogFileSize); setMaxLogFileSize(nativeHandle_, maxLogFileSize);
@ -399,7 +403,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setLogFileTimeToRoll(long logFileTimeToRoll) public Options setLogFileTimeToRoll(final long logFileTimeToRoll)
throws RocksDBException{ throws RocksDBException{
assert(isInitialized()); assert(isInitialized());
setLogFileTimeToRoll(nativeHandle_, logFileTimeToRoll); setLogFileTimeToRoll(nativeHandle_, logFileTimeToRoll);
@ -413,7 +417,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setKeepLogFileNum(long keepLogFileNum) public Options setKeepLogFileNum(final long keepLogFileNum)
throws RocksDBException{ throws RocksDBException{
assert(isInitialized()); assert(isInitialized());
setKeepLogFileNum(nativeHandle_, keepLogFileNum); setKeepLogFileNum(nativeHandle_, keepLogFileNum);
@ -427,7 +431,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxManifestFileSize(long maxManifestFileSize) { public Options setMaxManifestFileSize(
final long maxManifestFileSize) {
assert(isInitialized()); assert(isInitialized());
setMaxManifestFileSize(nativeHandle_, maxManifestFileSize); setMaxManifestFileSize(nativeHandle_, maxManifestFileSize);
return this; return this;
@ -440,7 +445,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setTableCacheNumshardbits(int tableCacheNumshardbits) { public Options setTableCacheNumshardbits(
final int tableCacheNumshardbits) {
assert(isInitialized()); assert(isInitialized());
setTableCacheNumshardbits(nativeHandle_, tableCacheNumshardbits); setTableCacheNumshardbits(nativeHandle_, tableCacheNumshardbits);
return this; return this;
@ -453,7 +459,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setTableCacheRemoveScanCountLimit(int limit) { public Options setTableCacheRemoveScanCountLimit(
final int limit) {
assert(isInitialized()); assert(isInitialized());
setTableCacheRemoveScanCountLimit(nativeHandle_, limit); setTableCacheRemoveScanCountLimit(nativeHandle_, limit);
return this; return this;
@ -466,7 +473,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setWalTtlSeconds(long walTtlSeconds) { public Options setWalTtlSeconds(final long walTtlSeconds) {
assert(isInitialized()); assert(isInitialized());
setWalTtlSeconds(nativeHandle_, walTtlSeconds); setWalTtlSeconds(nativeHandle_, walTtlSeconds);
return this; return this;
@ -479,7 +486,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setWalSizeLimitMB(long sizeLimitMB) { public Options setWalSizeLimitMB(final long sizeLimitMB) {
assert(isInitialized()); assert(isInitialized());
setWalSizeLimitMB(nativeHandle_, sizeLimitMB); setWalSizeLimitMB(nativeHandle_, sizeLimitMB);
return this; return this;
@ -492,7 +499,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setManifestPreallocationSize(long size) public Options setManifestPreallocationSize(final long size)
throws RocksDBException { throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
setManifestPreallocationSize(nativeHandle_, size); setManifestPreallocationSize(nativeHandle_, size);
@ -506,7 +513,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setAllowOsBuffer(boolean allowOsBuffer) { public Options setAllowOsBuffer(final boolean allowOsBuffer) {
assert(isInitialized()); assert(isInitialized());
setAllowOsBuffer(nativeHandle_, allowOsBuffer); setAllowOsBuffer(nativeHandle_, allowOsBuffer);
return this; return this;
@ -519,7 +526,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setAllowMmapReads(boolean allowMmapReads) { public Options setAllowMmapReads(final boolean allowMmapReads) {
assert(isInitialized()); assert(isInitialized());
setAllowMmapReads(nativeHandle_, allowMmapReads); setAllowMmapReads(nativeHandle_, allowMmapReads);
return this; return this;
@ -532,7 +539,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setAllowMmapWrites(boolean allowMmapWrites) { public Options setAllowMmapWrites(final boolean allowMmapWrites) {
assert(isInitialized()); assert(isInitialized());
setAllowMmapWrites(nativeHandle_, allowMmapWrites); setAllowMmapWrites(nativeHandle_, allowMmapWrites);
return this; return this;
@ -545,7 +552,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setIsFdCloseOnExec(boolean isFdCloseOnExec) { public Options setIsFdCloseOnExec(final boolean isFdCloseOnExec) {
assert(isInitialized()); assert(isInitialized());
setIsFdCloseOnExec(nativeHandle_, isFdCloseOnExec); setIsFdCloseOnExec(nativeHandle_, isFdCloseOnExec);
return this; return this;
@ -560,7 +567,7 @@ public class Options extends RocksObject
@Override @Override
@Deprecated @Deprecated
public Options setSkipLogErrorOnRecovery(boolean skip) { public Options setSkipLogErrorOnRecovery(final boolean skip) {
assert(isInitialized()); assert(isInitialized());
setSkipLogErrorOnRecovery(nativeHandle_, skip); setSkipLogErrorOnRecovery(nativeHandle_, skip);
return this; return this;
@ -573,7 +580,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setStatsDumpPeriodSec(int statsDumpPeriodSec) { public Options setStatsDumpPeriodSec(final int statsDumpPeriodSec) {
assert(isInitialized()); assert(isInitialized());
setStatsDumpPeriodSec(nativeHandle_, statsDumpPeriodSec); setStatsDumpPeriodSec(nativeHandle_, statsDumpPeriodSec);
return this; return this;
@ -585,7 +592,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setAdviseRandomOnOpen(boolean adviseRandomOnOpen) { public Options setAdviseRandomOnOpen(final boolean adviseRandomOnOpen) {
assert(isInitialized()); assert(isInitialized());
setAdviseRandomOnOpen(nativeHandle_, adviseRandomOnOpen); setAdviseRandomOnOpen(nativeHandle_, adviseRandomOnOpen);
return this; return this;
@ -598,7 +605,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setUseAdaptiveMutex(boolean useAdaptiveMutex) { public Options setUseAdaptiveMutex(final boolean useAdaptiveMutex) {
assert(isInitialized()); assert(isInitialized());
setUseAdaptiveMutex(nativeHandle_, useAdaptiveMutex); setUseAdaptiveMutex(nativeHandle_, useAdaptiveMutex);
return this; return this;
@ -610,14 +617,14 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setBytesPerSync(long bytesPerSync) { public Options setBytesPerSync(final long bytesPerSync) {
assert(isInitialized()); assert(isInitialized());
setBytesPerSync(nativeHandle_, bytesPerSync); setBytesPerSync(nativeHandle_, bytesPerSync);
return this; return this;
} }
@Override @Override
public Options setMemTableConfig(MemTableConfig config) public Options setMemTableConfig(final MemTableConfig config)
throws RocksDBException { throws RocksDBException {
memTableConfig_ = config; memTableConfig_ = config;
setMemTableFactory(nativeHandle_, config.newMemTableFactoryHandle()); setMemTableFactory(nativeHandle_, config.newMemTableFactoryHandle());
@ -625,14 +632,14 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setRateLimiterConfig(RateLimiterConfig config) { public Options setRateLimiterConfig(final RateLimiterConfig config) {
rateLimiterConfig_ = config; rateLimiterConfig_ = config;
setRateLimiter(nativeHandle_, config.newRateLimiterHandle()); setRateLimiter(nativeHandle_, config.newRateLimiterHandle());
return this; return this;
} }
@Override @Override
public Options setInfoLogLevel(InfoLogLevel infoLogLevel) { public Options setInfoLogLevel(final InfoLogLevel infoLogLevel) {
assert(isInitialized()); assert(isInitialized());
setInfoLogLevel(nativeHandle_, infoLogLevel.getValue()); setInfoLogLevel(nativeHandle_, infoLogLevel.getValue());
return this; return this;
@ -652,7 +659,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setTableFormatConfig(TableFormatConfig config) { public Options setTableFormatConfig(final TableFormatConfig config) {
tableFormatConfig_ = config; tableFormatConfig_ = config;
setTableFactory(nativeHandle_, config.newTableFactoryHandle()); setTableFactory(nativeHandle_, config.newTableFactoryHandle());
return this; return this;
@ -665,7 +672,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options useFixedLengthPrefixExtractor(int n) { public Options useFixedLengthPrefixExtractor(final int n) {
assert(isInitialized()); assert(isInitialized());
useFixedLengthPrefixExtractor(nativeHandle_, n); useFixedLengthPrefixExtractor(nativeHandle_, n);
return this; return this;
@ -688,7 +695,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setCompactionStyle(CompactionStyle compactionStyle) { public Options setCompactionStyle(
final CompactionStyle compactionStyle) {
setCompactionStyle(nativeHandle_, compactionStyle.getValue()); setCompactionStyle(nativeHandle_, compactionStyle.getValue());
return this; return this;
} }
@ -711,7 +719,7 @@ public class Options extends RocksObject
@Override @Override
public Options setLevelZeroFileNumCompactionTrigger( public Options setLevelZeroFileNumCompactionTrigger(
int numFiles) { final int numFiles) {
setLevelZeroFileNumCompactionTrigger( setLevelZeroFileNumCompactionTrigger(
nativeHandle_, numFiles); nativeHandle_, numFiles);
return this; return this;
@ -724,7 +732,7 @@ public class Options extends RocksObject
@Override @Override
public Options setLevelZeroSlowdownWritesTrigger( public Options setLevelZeroSlowdownWritesTrigger(
int numFiles) { final int numFiles) {
setLevelZeroSlowdownWritesTrigger(nativeHandle_, numFiles); setLevelZeroSlowdownWritesTrigger(nativeHandle_, numFiles);
return this; return this;
} }
@ -735,7 +743,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setLevelZeroStopWritesTrigger(int numFiles) { public Options setLevelZeroStopWritesTrigger(
final int numFiles) {
setLevelZeroStopWritesTrigger(nativeHandle_, numFiles); setLevelZeroStopWritesTrigger(nativeHandle_, numFiles);
return this; return this;
} }
@ -746,7 +755,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxMemCompactionLevel(int maxMemCompactionLevel) { public Options setMaxMemCompactionLevel(
final int maxMemCompactionLevel) {
setMaxMemCompactionLevel(nativeHandle_, maxMemCompactionLevel); setMaxMemCompactionLevel(nativeHandle_, maxMemCompactionLevel);
return this; return this;
} }
@ -779,7 +789,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxBytesForLevelBase(long maxBytesForLevelBase) { public Options setMaxBytesForLevelBase(final long maxBytesForLevelBase) {
setMaxBytesForLevelBase(nativeHandle_, maxBytesForLevelBase); setMaxBytesForLevelBase(nativeHandle_, maxBytesForLevelBase);
return this; return this;
} }
@ -790,7 +800,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxBytesForLevelMultiplier(int multiplier) { public Options setMaxBytesForLevelMultiplier(final int multiplier) {
setMaxBytesForLevelMultiplier(nativeHandle_, multiplier); setMaxBytesForLevelMultiplier(nativeHandle_, multiplier);
return this; return this;
} }
@ -801,7 +811,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setExpandedCompactionFactor(int expandedCompactionFactor) { public Options setExpandedCompactionFactor(
final int expandedCompactionFactor) {
setExpandedCompactionFactor(nativeHandle_, expandedCompactionFactor); setExpandedCompactionFactor(nativeHandle_, expandedCompactionFactor);
return this; return this;
} }
@ -824,7 +835,7 @@ public class Options extends RocksObject
@Override @Override
public Options setMaxGrandparentOverlapFactor( public Options setMaxGrandparentOverlapFactor(
int maxGrandparentOverlapFactor) { final int maxGrandparentOverlapFactor) {
setMaxGrandparentOverlapFactor(nativeHandle_, maxGrandparentOverlapFactor); setMaxGrandparentOverlapFactor(nativeHandle_, maxGrandparentOverlapFactor);
return this; return this;
} }
@ -835,7 +846,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setSoftRateLimit(double softRateLimit) { public Options setSoftRateLimit(final double softRateLimit) {
setSoftRateLimit(nativeHandle_, softRateLimit); setSoftRateLimit(nativeHandle_, softRateLimit);
return this; return this;
} }
@ -858,7 +869,7 @@ public class Options extends RocksObject
@Override @Override
public Options setRateLimitDelayMaxMilliseconds( public Options setRateLimitDelayMaxMilliseconds(
int rateLimitDelayMaxMilliseconds) { final int rateLimitDelayMaxMilliseconds) {
setRateLimitDelayMaxMilliseconds( setRateLimitDelayMaxMilliseconds(
nativeHandle_, rateLimitDelayMaxMilliseconds); nativeHandle_, rateLimitDelayMaxMilliseconds);
return this; return this;
@ -870,7 +881,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setArenaBlockSize(long arenaBlockSize) public Options setArenaBlockSize(final long arenaBlockSize)
throws RocksDBException { throws RocksDBException {
setArenaBlockSize(nativeHandle_, arenaBlockSize); setArenaBlockSize(nativeHandle_, arenaBlockSize);
return this; return this;
@ -882,7 +893,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setDisableAutoCompactions(boolean disableAutoCompactions) { public Options setDisableAutoCompactions(
final boolean disableAutoCompactions) {
setDisableAutoCompactions(nativeHandle_, disableAutoCompactions); setDisableAutoCompactions(nativeHandle_, disableAutoCompactions);
return this; return this;
} }
@ -894,7 +906,7 @@ public class Options extends RocksObject
@Override @Override
public Options setPurgeRedundantKvsWhileFlush( public Options setPurgeRedundantKvsWhileFlush(
boolean purgeRedundantKvsWhileFlush) { final boolean purgeRedundantKvsWhileFlush) {
setPurgeRedundantKvsWhileFlush( setPurgeRedundantKvsWhileFlush(
nativeHandle_, purgeRedundantKvsWhileFlush); nativeHandle_, purgeRedundantKvsWhileFlush);
return this; return this;
@ -907,7 +919,7 @@ public class Options extends RocksObject
@Override @Override
public Options setVerifyChecksumsInCompaction( public Options setVerifyChecksumsInCompaction(
boolean verifyChecksumsInCompaction) { final boolean verifyChecksumsInCompaction) {
setVerifyChecksumsInCompaction( setVerifyChecksumsInCompaction(
nativeHandle_, verifyChecksumsInCompaction); nativeHandle_, verifyChecksumsInCompaction);
return this; return this;
@ -919,7 +931,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setFilterDeletes(boolean filterDeletes) { public Options setFilterDeletes(
final boolean filterDeletes) {
setFilterDeletes(nativeHandle_, filterDeletes); setFilterDeletes(nativeHandle_, filterDeletes);
return this; return this;
} }
@ -930,7 +943,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations) { public Options setMaxSequentialSkipInIterations(
final long maxSequentialSkipInIterations) {
setMaxSequentialSkipInIterations(nativeHandle_, maxSequentialSkipInIterations); setMaxSequentialSkipInIterations(nativeHandle_, maxSequentialSkipInIterations);
return this; return this;
} }
@ -941,7 +955,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setInplaceUpdateSupport(boolean inplaceUpdateSupport) { public Options setInplaceUpdateSupport(
final boolean inplaceUpdateSupport) {
setInplaceUpdateSupport(nativeHandle_, inplaceUpdateSupport); setInplaceUpdateSupport(nativeHandle_, inplaceUpdateSupport);
return this; return this;
} }
@ -952,8 +967,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setInplaceUpdateNumLocks(long inplaceUpdateNumLocks) public Options setInplaceUpdateNumLocks(
throws RocksDBException { final long inplaceUpdateNumLocks) throws RocksDBException {
setInplaceUpdateNumLocks(nativeHandle_, inplaceUpdateNumLocks); setInplaceUpdateNumLocks(nativeHandle_, inplaceUpdateNumLocks);
return this; return this;
} }
@ -964,7 +979,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMemtablePrefixBloomBits(int memtablePrefixBloomBits) { public Options setMemtablePrefixBloomBits(
final int memtablePrefixBloomBits) {
setMemtablePrefixBloomBits(nativeHandle_, memtablePrefixBloomBits); setMemtablePrefixBloomBits(nativeHandle_, memtablePrefixBloomBits);
return this; return this;
} }
@ -975,7 +991,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMemtablePrefixBloomProbes(int memtablePrefixBloomProbes) { public Options setMemtablePrefixBloomProbes(
final int memtablePrefixBloomProbes) {
setMemtablePrefixBloomProbes(nativeHandle_, memtablePrefixBloomProbes); setMemtablePrefixBloomProbes(nativeHandle_, memtablePrefixBloomProbes);
return this; return this;
} }
@ -986,7 +1003,7 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setBloomLocality(int bloomLocality) { public Options setBloomLocality(final int bloomLocality) {
setBloomLocality(nativeHandle_, bloomLocality); setBloomLocality(nativeHandle_, bloomLocality);
return this; return this;
} }
@ -1009,7 +1026,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge) { public Options setMinWriteBufferNumberToMerge(
final int minWriteBufferNumberToMerge) {
setMinWriteBufferNumberToMerge(nativeHandle_, minWriteBufferNumberToMerge); setMinWriteBufferNumberToMerge(nativeHandle_, minWriteBufferNumberToMerge);
return this; return this;
} }
@ -1020,7 +1038,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setMinPartialMergeOperands(int minPartialMergeOperands) { public Options setMinPartialMergeOperands(
final int minPartialMergeOperands) {
setMinPartialMergeOperands(nativeHandle_, minPartialMergeOperands); setMinPartialMergeOperands(nativeHandle_, minPartialMergeOperands);
return this; return this;
} }

@ -40,7 +40,8 @@ public class ReadOptions extends RocksObject {
* will be performed on every read. * will be performed on every read.
* @return the reference to the current ReadOptions. * @return the reference to the current ReadOptions.
*/ */
public ReadOptions setVerifyChecksums(boolean verifyChecksums) { public ReadOptions setVerifyChecksums(
final boolean verifyChecksums) {
assert(isInitialized()); assert(isInitialized());
setVerifyChecksums(nativeHandle_, verifyChecksums); setVerifyChecksums(nativeHandle_, verifyChecksums);
return this; return this;
@ -72,7 +73,7 @@ public class ReadOptions extends RocksObject {
* performed. * performed.
* @return the reference to the current ReadOptions. * @return the reference to the current ReadOptions.
*/ */
public ReadOptions setFillCache(boolean fillCache) { public ReadOptions setFillCache(final boolean fillCache) {
assert(isInitialized()); assert(isInitialized());
setFillCache(nativeHandle_, fillCache); setFillCache(nativeHandle_, fillCache);
return this; return this;
@ -90,7 +91,7 @@ public class ReadOptions extends RocksObject {
* @param snapshot {@link Snapshot} instance * @param snapshot {@link Snapshot} instance
* @return the reference to the current ReadOptions. * @return the reference to the current ReadOptions.
*/ */
public ReadOptions setSnapshot(Snapshot snapshot) { public ReadOptions setSnapshot(final Snapshot snapshot) {
assert(isInitialized()); assert(isInitialized());
if (snapshot != null) { if (snapshot != null) {
setSnapshot(nativeHandle_, snapshot.nativeHandle_); setSnapshot(nativeHandle_, snapshot.nativeHandle_);
@ -145,7 +146,7 @@ public class ReadOptions extends RocksObject {
* @param tailing if true, then tailing iterator will be enabled. * @param tailing if true, then tailing iterator will be enabled.
* @return the reference to the current ReadOptions. * @return the reference to the current ReadOptions.
*/ */
public ReadOptions setTailing(boolean tailing) { public ReadOptions setTailing(final boolean tailing) {
assert(isInitialized()); assert(isInitialized());
setTailing(nativeHandle_, tailing); setTailing(nativeHandle_, tailing);
return this; return this;

@ -22,7 +22,7 @@ public class RestoreBackupableDB extends RocksObject {
* *
* @param options {@link org.rocksdb.BackupableDBOptions} instance * @param options {@link org.rocksdb.BackupableDBOptions} instance
*/ */
public RestoreBackupableDB(BackupableDBOptions options) { public RestoreBackupableDB(final BackupableDBOptions options) {
super(); super();
nativeHandle_ = newRestoreBackupableDB(options.nativeHandle_); nativeHandle_ = newRestoreBackupableDB(options.nativeHandle_);
} }
@ -49,8 +49,9 @@ public class RestoreBackupableDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void restoreDBFromBackup(long backupId, String dbDir, String walDir, public void restoreDBFromBackup(final long backupId, final String dbDir,
RestoreOptions restoreOptions) throws RocksDBException { final String walDir, final RestoreOptions restoreOptions)
throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
restoreDBFromBackup0(nativeHandle_, backupId, dbDir, walDir, restoreDBFromBackup0(nativeHandle_, backupId, dbDir, walDir,
restoreOptions.nativeHandle_); restoreOptions.nativeHandle_);
@ -66,8 +67,9 @@ public class RestoreBackupableDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void restoreDBFromLatestBackup(String dbDir, String walDir, public void restoreDBFromLatestBackup(final String dbDir,
RestoreOptions restoreOptions) throws RocksDBException { final String walDir, final RestoreOptions restoreOptions)
throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
restoreDBFromLatestBackup0(nativeHandle_, dbDir, walDir, restoreDBFromLatestBackup0(nativeHandle_, dbDir, walDir,
restoreOptions.nativeHandle_); restoreOptions.nativeHandle_);
@ -81,7 +83,8 @@ public class RestoreBackupableDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void purgeOldBackups(int numBackupsToKeep) throws RocksDBException { public void purgeOldBackups(final int numBackupsToKeep)
throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
purgeOldBackups0(nativeHandle_, numBackupsToKeep); purgeOldBackups0(nativeHandle_, numBackupsToKeep);
} }
@ -94,7 +97,8 @@ public class RestoreBackupableDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void deleteBackup(int backupId) throws RocksDBException { public void deleteBackup(final int backupId)
throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
deleteBackup0(nativeHandle_, backupId); deleteBackup0(nativeHandle_, backupId);
} }

@ -22,7 +22,7 @@ public class RestoreOptions extends RocksObject {
* for persisting in-memory databases. * for persisting in-memory databases.
* Default: false * Default: false
*/ */
public RestoreOptions(boolean keepLogFiles) { public RestoreOptions(final boolean keepLogFiles) {
super(); super();
nativeHandle_ = newRestoreOptions(keepLogFiles); nativeHandle_ = newRestoreOptions(keepLogFiles);
} }

@ -59,7 +59,7 @@ public class RocksDB extends RocksObject {
* @param paths a list of strings where each describes a directory * @param paths a list of strings where each describes a directory
* of a library. * of a library.
*/ */
public static synchronized void loadLibrary(List<String> paths) { public static synchronized void loadLibrary(final List<String> paths) {
for (CompressionType compressionType : CompressionType.values()) { for (CompressionType compressionType : CompressionType.values()) {
if (compressionType.equals(CompressionType.NO_COMPRESSION)) { if (compressionType.equals(CompressionType.NO_COMPRESSION)) {
continue; continue;
@ -103,7 +103,7 @@ public class RocksDB extends RocksObject {
* native library. * native library.
* @see Options#setCreateIfMissing(boolean) * @see Options#setCreateIfMissing(boolean)
*/ */
public static RocksDB open(String path) throws RocksDBException { public static RocksDB open(final String path) throws RocksDBException {
// This allows to use the rocksjni default Options instead of // This allows to use the rocksjni default Options instead of
// the c++ one. // the c++ one.
Options options = new Options(); Options options = new Options();
@ -140,9 +140,10 @@ public class RocksDB extends RocksObject {
* native library. * native library.
* @see DBOptions#setCreateIfMissing(boolean) * @see DBOptions#setCreateIfMissing(boolean)
*/ */
public static RocksDB open(String path, public static RocksDB open(final String path,
List<ColumnFamilyDescriptor> columnFamilyDescriptors, final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException { final List<ColumnFamilyHandle> columnFamilyHandles)
throws RocksDBException {
// This allows to use the rocksjni default Options instead of // This allows to use the rocksjni default Options instead of
// the c++ one. // the c++ one.
DBOptions options = new DBOptions(); DBOptions options = new DBOptions();
@ -173,7 +174,7 @@ public class RocksDB extends RocksObject {
* *
* @see Options#setCreateIfMissing(boolean) * @see Options#setCreateIfMissing(boolean)
*/ */
public static RocksDB open(Options options, String path) public static RocksDB open(final Options options, final String path)
throws RocksDBException { throws RocksDBException {
// when non-default Options is used, keeping an Options reference // when non-default Options is used, keeping an Options reference
// in RocksDB can prevent Java to GC during the life-time of // in RocksDB can prevent Java to GC during the life-time of
@ -220,9 +221,9 @@ public class RocksDB extends RocksObject {
* *
* @see DBOptions#setCreateIfMissing(boolean) * @see DBOptions#setCreateIfMissing(boolean)
*/ */
public static RocksDB open(DBOptions options, String path, public static RocksDB open(final DBOptions options, final String path,
List<ColumnFamilyDescriptor> columnFamilyDescriptors, final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
List<ColumnFamilyHandle> columnFamilyHandles) final List<ColumnFamilyHandle> columnFamilyHandles)
throws RocksDBException { throws RocksDBException {
RocksDB db = new RocksDB(); RocksDB db = new RocksDB();
List<Long> cfReferences = db.open(options.nativeHandle_, path, List<Long> cfReferences = db.open(options.nativeHandle_, path,
@ -246,7 +247,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public static RocksDB openReadOnly(String path) public static RocksDB openReadOnly(final String path)
throws RocksDBException { throws RocksDBException {
// This allows to use the rocksjni default Options instead of // This allows to use the rocksjni default Options instead of
// the c++ one. // the c++ one.
@ -269,9 +270,10 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public static RocksDB openReadOnly(String path, public static RocksDB openReadOnly(final String path,
List<ColumnFamilyDescriptor> columnFamilyDescriptors, final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException { final List<ColumnFamilyHandle> columnFamilyHandles)
throws RocksDBException {
// This allows to use the rocksjni default Options instead of // This allows to use the rocksjni default Options instead of
// the c++ one. // the c++ one.
DBOptions options = new DBOptions(); DBOptions options = new DBOptions();
@ -296,7 +298,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public static RocksDB openReadOnly(Options options, String path) public static RocksDB openReadOnly(final Options options, final String path)
throws RocksDBException { throws RocksDBException {
// when non-default Options is used, keeping an Options reference // when non-default Options is used, keeping an Options reference
// in RocksDB can prevent Java to GC during the life-time of // in RocksDB can prevent Java to GC during the life-time of
@ -330,9 +332,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public static RocksDB openReadOnly(DBOptions options, String path, public static RocksDB openReadOnly(final DBOptions options, final String path,
List<ColumnFamilyDescriptor> columnFamilyDescriptors, final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
List<ColumnFamilyHandle> columnFamilyHandles) final List<ColumnFamilyHandle> columnFamilyHandles)
throws RocksDBException { throws RocksDBException {
// when non-default Options is used, keeping an Options reference // when non-default Options is used, keeping an Options reference
// in RocksDB can prevent Java to GC during the life-time of // in RocksDB can prevent Java to GC during the life-time of
@ -358,8 +360,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public static List<byte[]> listColumnFamilies(Options options, String path) public static List<byte[]> listColumnFamilies(final Options options,
throws RocksDBException { final String path) throws RocksDBException {
return RocksDB.listColumnFamilies(options.nativeHandle_, path); return RocksDB.listColumnFamilies(options.nativeHandle_, path);
} }
@ -391,7 +393,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void put(byte[] key, byte[] value) throws RocksDBException { public void put(final byte[] key, final byte[] value) throws RocksDBException {
put(nativeHandle_, key, key.length, value, value.length); put(nativeHandle_, key, key.length, value, value.length);
} }
@ -409,8 +411,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void put(ColumnFamilyHandle columnFamilyHandle, byte[] key, public void put(final ColumnFamilyHandle columnFamilyHandle,
byte[] value) throws RocksDBException { final byte[] key, final byte[] value) throws RocksDBException {
put(nativeHandle_, key, key.length, value, value.length, put(nativeHandle_, key, key.length, value, value.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -425,8 +427,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void put(WriteOptions writeOpts, byte[] key, byte[] value) public void put(final WriteOptions writeOpts, final byte[] key,
throws RocksDBException { final byte[] value) throws RocksDBException {
put(nativeHandle_, writeOpts.nativeHandle_, put(nativeHandle_, writeOpts.nativeHandle_,
key, key.length, value, value.length); key, key.length, value, value.length);
} }
@ -447,8 +449,9 @@ public class RocksDB extends RocksObject {
* native library. * native library.
* @see IllegalArgumentException * @see IllegalArgumentException
*/ */
public void put(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpts, public void put(final ColumnFamilyHandle columnFamilyHandle,
byte[] key, byte[] value) throws RocksDBException { final WriteOptions writeOpts, final byte[] key,
final byte[] value) throws RocksDBException {
put(nativeHandle_, writeOpts.nativeHandle_, key, key.length, value, value.length, put(nativeHandle_, writeOpts.nativeHandle_, key, key.length, value, value.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -465,7 +468,7 @@ public class RocksDB extends RocksObject {
* found in block-cache. * found in block-cache.
* @return boolean value indicating if key does not exist or might exist. * @return boolean value indicating if key does not exist or might exist.
*/ */
public boolean keyMayExist(byte[] key, StringBuffer value){ public boolean keyMayExist(final byte[] key, final StringBuffer value){
return keyMayExist(key, key.length, value); return keyMayExist(key, key.length, value);
} }
@ -482,8 +485,8 @@ public class RocksDB extends RocksObject {
* found in block-cache. * found in block-cache.
* @return boolean value indicating if key does not exist or might exist. * @return boolean value indicating if key does not exist or might exist.
*/ */
public boolean keyMayExist(ColumnFamilyHandle columnFamilyHandle, public boolean keyMayExist(final ColumnFamilyHandle columnFamilyHandle,
byte[] key, StringBuffer value){ final byte[] key, final StringBuffer value){
return keyMayExist(key, key.length, columnFamilyHandle.nativeHandle_, return keyMayExist(key, key.length, columnFamilyHandle.nativeHandle_,
value); value);
} }
@ -501,8 +504,8 @@ public class RocksDB extends RocksObject {
* found in block-cache. * found in block-cache.
* @return boolean value indicating if key does not exist or might exist. * @return boolean value indicating if key does not exist or might exist.
*/ */
public boolean keyMayExist(ReadOptions readOptions, public boolean keyMayExist(final ReadOptions readOptions,
byte[] key, StringBuffer value){ final byte[] key, final StringBuffer value){
return keyMayExist(readOptions.nativeHandle_, return keyMayExist(readOptions.nativeHandle_,
key, key.length, value); key, key.length, value);
} }
@ -521,8 +524,9 @@ public class RocksDB extends RocksObject {
* found in block-cache. * found in block-cache.
* @return boolean value indicating if key does not exist or might exist. * @return boolean value indicating if key does not exist or might exist.
*/ */
public boolean keyMayExist(ReadOptions readOptions, public boolean keyMayExist(final ReadOptions readOptions,
ColumnFamilyHandle columnFamilyHandle, byte[] key, StringBuffer value){ final ColumnFamilyHandle columnFamilyHandle, final byte[] key,
final StringBuffer value){
return keyMayExist(readOptions.nativeHandle_, return keyMayExist(readOptions.nativeHandle_,
key, key.length, columnFamilyHandle.nativeHandle_, key, key.length, columnFamilyHandle.nativeHandle_,
value); value);
@ -537,7 +541,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void write(WriteOptions writeOpts, WriteBatch updates) public void write(final WriteOptions writeOpts, final WriteBatch updates)
throws RocksDBException { throws RocksDBException {
write0(writeOpts.nativeHandle_, updates.nativeHandle_); write0(writeOpts.nativeHandle_, updates.nativeHandle_);
} }
@ -551,8 +555,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void write(WriteOptions writeOpts, WriteBatchWithIndex updates) public void write(final WriteOptions writeOpts,
throws RocksDBException { final WriteBatchWithIndex updates) throws RocksDBException {
write1(writeOpts.nativeHandle_, updates.nativeHandle_); write1(writeOpts.nativeHandle_, updates.nativeHandle_);
} }
@ -566,7 +570,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void merge(byte[] key, byte[] value) throws RocksDBException { public void merge(final byte[] key, final byte[] value) throws RocksDBException {
merge(nativeHandle_, key, key.length, value, value.length); merge(nativeHandle_, key, key.length, value, value.length);
} }
@ -581,8 +585,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void merge(ColumnFamilyHandle columnFamilyHandle, byte[] key, public void merge(final ColumnFamilyHandle columnFamilyHandle,
byte[] value) throws RocksDBException { final byte[] key, final byte[] value) throws RocksDBException {
merge(nativeHandle_, key, key.length, value, value.length, merge(nativeHandle_, key, key.length, value, value.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -598,8 +602,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void merge(WriteOptions writeOpts, byte[] key, byte[] value) public void merge(final WriteOptions writeOpts, final byte[] key,
throws RocksDBException { final byte[] value) throws RocksDBException {
merge(nativeHandle_, writeOpts.nativeHandle_, merge(nativeHandle_, writeOpts.nativeHandle_,
key, key.length, value, value.length); key, key.length, value, value.length);
} }
@ -616,9 +620,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void merge(ColumnFamilyHandle columnFamilyHandle, public void merge(final ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpts, byte[] key, byte[] value) final WriteOptions writeOpts, final byte[] key,
throws RocksDBException { final byte[] value) throws RocksDBException {
merge(nativeHandle_, writeOpts.nativeHandle_, merge(nativeHandle_, writeOpts.nativeHandle_,
key, key.length, value, value.length, key, key.length, value, value.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
@ -638,7 +642,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public int get(byte[] key, byte[] value) throws RocksDBException { public int get(final byte[] key, final byte[] value) throws RocksDBException {
return get(nativeHandle_, key, key.length, value, value.length); return get(nativeHandle_, key, key.length, value, value.length);
} }
@ -659,8 +663,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public int get(ColumnFamilyHandle columnFamilyHandle, byte[] key, byte[] value) public int get(final ColumnFamilyHandle columnFamilyHandle, final byte[] key,
throws RocksDBException, IllegalArgumentException { final byte[] value) throws RocksDBException, IllegalArgumentException {
return get(nativeHandle_, key, key.length, value, value.length, return get(nativeHandle_, key, key.length, value, value.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -681,8 +685,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public int get(ReadOptions opt, byte[] key, byte[] value) public int get(final ReadOptions opt, final byte[] key,
throws RocksDBException { final byte[] value) throws RocksDBException {
return get(nativeHandle_, opt.nativeHandle_, return get(nativeHandle_, opt.nativeHandle_,
key, key.length, value, value.length); key, key.length, value, value.length);
} }
@ -704,8 +708,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public int get(ColumnFamilyHandle columnFamilyHandle, ReadOptions opt, byte[] key, public int get(final ColumnFamilyHandle columnFamilyHandle,
byte[] value) throws RocksDBException { final ReadOptions opt, final byte[] key, final byte[] value)
throws RocksDBException {
return get(nativeHandle_, opt.nativeHandle_, key, key.length, value, return get(nativeHandle_, opt.nativeHandle_, key, key.length, value,
value.length, columnFamilyHandle.nativeHandle_); value.length, columnFamilyHandle.nativeHandle_);
} }
@ -722,7 +727,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public byte[] get(byte[] key) throws RocksDBException { public byte[] get(final byte[] key) throws RocksDBException {
return get(nativeHandle_, key, key.length); return get(nativeHandle_, key, key.length);
} }
@ -740,7 +745,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public byte[] get(ColumnFamilyHandle columnFamilyHandle, byte[] key) public byte[] get(final ColumnFamilyHandle columnFamilyHandle, final byte[] key)
throws RocksDBException { throws RocksDBException {
return get(nativeHandle_, key, key.length, columnFamilyHandle.nativeHandle_); return get(nativeHandle_, key, key.length, columnFamilyHandle.nativeHandle_);
} }
@ -758,7 +763,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public byte[] get(ReadOptions opt, byte[] key) throws RocksDBException { public byte[] get(final ReadOptions opt, final byte[] key)
throws RocksDBException {
return get(nativeHandle_, opt.nativeHandle_, key, key.length); return get(nativeHandle_, opt.nativeHandle_, key, key.length);
} }
@ -777,8 +783,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public byte[] get(ColumnFamilyHandle columnFamilyHandle, ReadOptions opt, public byte[] get(final ColumnFamilyHandle columnFamilyHandle,
byte[] key) throws RocksDBException { final ReadOptions opt, final byte[] key) throws RocksDBException {
return get(nativeHandle_, opt.nativeHandle_, key, key.length, return get(nativeHandle_, opt.nativeHandle_, key, key.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -793,7 +799,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public Map<byte[], byte[]> multiGet(List<byte[]> keys) public Map<byte[], byte[]> multiGet(final List<byte[]> keys)
throws RocksDBException { throws RocksDBException {
assert(keys.size() != 0); assert(keys.size() != 0);
@ -830,8 +836,8 @@ public class RocksDB extends RocksObject {
* @throws IllegalArgumentException thrown if the size of passed keys is not * @throws IllegalArgumentException thrown if the size of passed keys is not
* equal to the amount of passed column family handles. * equal to the amount of passed column family handles.
*/ */
public Map<byte[], byte[]> multiGet(List<ColumnFamilyHandle> columnFamilyHandleList, public Map<byte[], byte[]> multiGet(final List<ColumnFamilyHandle> columnFamilyHandleList,
List<byte[]> keys) throws RocksDBException, IllegalArgumentException { final List<byte[]> keys) throws RocksDBException, IllegalArgumentException {
assert(keys.size() != 0); assert(keys.size() != 0);
// Check if key size equals cfList size. If not a exception must be // Check if key size equals cfList size. If not a exception must be
// thrown. If not a Segmentation fault happens. // thrown. If not a Segmentation fault happens.
@ -863,8 +869,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public Map<byte[], byte[]> multiGet(ReadOptions opt, List<byte[]> keys) public Map<byte[], byte[]> multiGet(final ReadOptions opt,
throws RocksDBException { final List<byte[]> keys) throws RocksDBException {
assert(keys.size() != 0); assert(keys.size() != 0);
List<byte[]> values = multiGet( List<byte[]> values = multiGet(
@ -901,9 +907,9 @@ public class RocksDB extends RocksObject {
* @throws IllegalArgumentException thrown if the size of passed keys is not * @throws IllegalArgumentException thrown if the size of passed keys is not
* equal to the amount of passed column family handles. * equal to the amount of passed column family handles.
*/ */
public Map<byte[], byte[]> multiGet(ReadOptions opt, public Map<byte[], byte[]> multiGet(final ReadOptions opt,
List<ColumnFamilyHandle> columnFamilyHandleList, List<byte[]> keys) final List<ColumnFamilyHandle> columnFamilyHandleList,
throws RocksDBException { final List<byte[]> keys) throws RocksDBException {
assert(keys.size() != 0); assert(keys.size() != 0);
// Check if key size equals cfList size. If not a exception must be // Check if key size equals cfList size. If not a exception must be
// thrown. If not a Segmentation fault happens. // thrown. If not a Segmentation fault happens.
@ -936,7 +942,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void remove(byte[] key) throws RocksDBException { public void remove(final byte[] key) throws RocksDBException {
remove(nativeHandle_, key, key.length); remove(nativeHandle_, key, key.length);
} }
@ -952,7 +958,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void remove(ColumnFamilyHandle columnFamilyHandle, byte[] key) public void remove(final ColumnFamilyHandle columnFamilyHandle, final byte[] key)
throws RocksDBException { throws RocksDBException {
remove(nativeHandle_, key, key.length, columnFamilyHandle.nativeHandle_); remove(nativeHandle_, key, key.length, columnFamilyHandle.nativeHandle_);
} }
@ -968,7 +974,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void remove(WriteOptions writeOpt, byte[] key) public void remove(final WriteOptions writeOpt, final byte[] key)
throws RocksDBException { throws RocksDBException {
remove(nativeHandle_, writeOpt.nativeHandle_, key, key.length); remove(nativeHandle_, writeOpt.nativeHandle_, key, key.length);
} }
@ -986,8 +992,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void remove(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpt, public void remove(final ColumnFamilyHandle columnFamilyHandle,
byte[] key) throws RocksDBException { final WriteOptions writeOpt, final byte[] key)
throws RocksDBException {
remove(nativeHandle_, writeOpt.nativeHandle_, key, key.length, remove(nativeHandle_, writeOpt.nativeHandle_, key, key.length,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -1018,8 +1025,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public String getProperty(ColumnFamilyHandle columnFamilyHandle, String property) public String getProperty(final ColumnFamilyHandle columnFamilyHandle,
throws RocksDBException { final String property) throws RocksDBException {
return getProperty0(nativeHandle_, columnFamilyHandle.nativeHandle_, property, return getProperty0(nativeHandle_, columnFamilyHandle.nativeHandle_, property,
property.length()); property.length());
} }
@ -1046,7 +1053,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public String getProperty(String property) throws RocksDBException { public String getProperty(final String property) throws RocksDBException {
return getProperty0(nativeHandle_, property, property.length()); return getProperty0(nativeHandle_, property, property.length());
} }
@ -1072,7 +1079,7 @@ public class RocksDB extends RocksObject {
* *
* @throws RocksDBException if an error happens in the underlying native code. * @throws RocksDBException if an error happens in the underlying native code.
*/ */
public long getLongProperty(String property) throws RocksDBException { public long getLongProperty(final String property) throws RocksDBException {
return getLongProperty(nativeHandle_, property, property.length()); return getLongProperty(nativeHandle_, property, property.length());
} }
@ -1100,8 +1107,8 @@ public class RocksDB extends RocksObject {
* *
* @throws RocksDBException if an error happens in the underlying native code. * @throws RocksDBException if an error happens in the underlying native code.
*/ */
public long getLongProperty(ColumnFamilyHandle columnFamilyHandle, String property) public long getLongProperty(final ColumnFamilyHandle columnFamilyHandle,
throws RocksDBException { final String property) throws RocksDBException {
return getLongProperty(nativeHandle_, columnFamilyHandle.nativeHandle_, property, return getLongProperty(nativeHandle_, columnFamilyHandle.nativeHandle_, property,
property.length()); property.length());
} }
@ -1135,7 +1142,7 @@ public class RocksDB extends RocksObject {
* @param readOptions {@link ReadOptions} instance. * @param readOptions {@link ReadOptions} instance.
* @return instance of iterator object. * @return instance of iterator object.
*/ */
public RocksIterator newIterator(ReadOptions readOptions) { public RocksIterator newIterator(final ReadOptions readOptions) {
return new RocksIterator(this, iterator(nativeHandle_, return new RocksIterator(this, iterator(nativeHandle_,
readOptions.nativeHandle_)); readOptions.nativeHandle_));
} }
@ -1185,7 +1192,7 @@ public class RocksDB extends RocksObject {
* instance * instance
* @return instance of iterator object. * @return instance of iterator object.
*/ */
public RocksIterator newIterator(ColumnFamilyHandle columnFamilyHandle) { public RocksIterator newIterator(final ColumnFamilyHandle columnFamilyHandle) {
return new RocksIterator(this, iteratorCF(nativeHandle_, return new RocksIterator(this, iteratorCF(nativeHandle_,
columnFamilyHandle.nativeHandle_)); columnFamilyHandle.nativeHandle_));
} }
@ -1205,8 +1212,8 @@ public class RocksDB extends RocksObject {
* @param readOptions {@link ReadOptions} instance. * @param readOptions {@link ReadOptions} instance.
* @return instance of iterator object. * @return instance of iterator object.
*/ */
public RocksIterator newIterator(ColumnFamilyHandle columnFamilyHandle, public RocksIterator newIterator(final ColumnFamilyHandle columnFamilyHandle,
ReadOptions readOptions) { final ReadOptions readOptions) {
return new RocksIterator(this, iteratorCF(nativeHandle_, return new RocksIterator(this, iteratorCF(nativeHandle_,
columnFamilyHandle.nativeHandle_, readOptions.nativeHandle_)); columnFamilyHandle.nativeHandle_, readOptions.nativeHandle_));
} }
@ -1225,7 +1232,7 @@ public class RocksDB extends RocksObject {
* native library. * native library.
*/ */
public List<RocksIterator> newIterators( public List<RocksIterator> newIterators(
List<ColumnFamilyHandle> columnFamilyHandleList) throws RocksDBException { final List<ColumnFamilyHandle> columnFamilyHandleList) throws RocksDBException {
return newIterators(columnFamilyHandleList, new ReadOptions()); return newIterators(columnFamilyHandleList, new ReadOptions());
} }
@ -1244,8 +1251,8 @@ public class RocksDB extends RocksObject {
* native library. * native library.
*/ */
public List<RocksIterator> newIterators( public List<RocksIterator> newIterators(
List<ColumnFamilyHandle> columnFamilyHandleList, final List<ColumnFamilyHandle> columnFamilyHandleList,
ReadOptions readOptions) throws RocksDBException { final ReadOptions readOptions) throws RocksDBException {
List<RocksIterator> iterators = List<RocksIterator> iterators =
new ArrayList<>(columnFamilyHandleList.size()); new ArrayList<>(columnFamilyHandleList.size());
@ -1278,7 +1285,7 @@ public class RocksDB extends RocksObject {
* native library. * native library.
*/ */
public ColumnFamilyHandle createColumnFamily( public ColumnFamilyHandle createColumnFamily(
ColumnFamilyDescriptor columnFamilyDescriptor) final ColumnFamilyDescriptor columnFamilyDescriptor)
throws RocksDBException { throws RocksDBException {
return new ColumnFamilyHandle(this, createColumnFamily(nativeHandle_, return new ColumnFamilyHandle(this, createColumnFamily(nativeHandle_,
columnFamilyDescriptor)); columnFamilyDescriptor));
@ -1295,7 +1302,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if error happens in underlying * @throws RocksDBException thrown if error happens in underlying
* native library. * native library.
*/ */
public void dropColumnFamily(ColumnFamilyHandle columnFamilyHandle) public void dropColumnFamily(final ColumnFamilyHandle columnFamilyHandle)
throws RocksDBException, IllegalArgumentException { throws RocksDBException, IllegalArgumentException {
// throws RocksDBException if something goes wrong // throws RocksDBException if something goes wrong
dropColumnFamily(nativeHandle_, columnFamilyHandle.nativeHandle_); dropColumnFamily(nativeHandle_, columnFamilyHandle.nativeHandle_);
@ -1314,7 +1321,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void flush(FlushOptions flushOptions) public void flush(final FlushOptions flushOptions)
throws RocksDBException { throws RocksDBException {
flush(nativeHandle_, flushOptions.nativeHandle_); flush(nativeHandle_, flushOptions.nativeHandle_);
} }
@ -1331,8 +1338,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void flush(FlushOptions flushOptions, public void flush(final FlushOptions flushOptions,
ColumnFamilyHandle columnFamilyHandle) throws RocksDBException { final ColumnFamilyHandle columnFamilyHandle) throws RocksDBException {
flush(nativeHandle_, flushOptions.nativeHandle_, flush(nativeHandle_, flushOptions.nativeHandle_,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
} }
@ -1376,7 +1383,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(byte[] begin, byte[] end) public void compactRange(final byte[] begin, final byte[] end)
throws RocksDBException { throws RocksDBException {
compactRange0(nativeHandle_, begin, begin.length, end, compactRange0(nativeHandle_, begin, begin.length, end,
end.length, false, -1, 0); end.length, false, -1, 0);
@ -1406,8 +1413,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(boolean reduce_level, int target_level, public void compactRange(final boolean reduce_level,
int target_path_id) throws RocksDBException { final int target_level, final int target_path_id)
throws RocksDBException {
compactRange0(nativeHandle_, reduce_level, compactRange0(nativeHandle_, reduce_level,
target_level, target_path_id); target_level, target_path_id);
} }
@ -1439,9 +1447,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(byte[] begin, byte[] end, public void compactRange(final byte[] begin, final byte[] end,
boolean reduce_level, int target_level, int target_path_id) final boolean reduce_level, final int target_level,
throws RocksDBException { final int target_path_id) throws RocksDBException {
compactRange0(nativeHandle_, begin, begin.length, end, end.length, compactRange0(nativeHandle_, begin, begin.length, end, end.length,
reduce_level, target_level, target_path_id); reduce_level, target_level, target_path_id);
} }
@ -1472,7 +1480,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(ColumnFamilyHandle columnFamilyHandle) public void compactRange(final ColumnFamilyHandle columnFamilyHandle)
throws RocksDBException { throws RocksDBException {
compactRange(nativeHandle_, false, -1, 0, compactRange(nativeHandle_, false, -1, 0,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
@ -1504,8 +1512,8 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(ColumnFamilyHandle columnFamilyHandle, public void compactRange(final ColumnFamilyHandle columnFamilyHandle,
byte[] begin, byte[] end) throws RocksDBException { final byte[] begin, final byte[] end) throws RocksDBException {
compactRange(nativeHandle_, begin, begin.length, end, end.length, compactRange(nativeHandle_, begin, begin.length, end, end.length,
false, -1, 0, columnFamilyHandle.nativeHandle_); false, -1, 0, columnFamilyHandle.nativeHandle_);
} }
@ -1541,9 +1549,9 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(ColumnFamilyHandle columnFamilyHandle, public void compactRange(final ColumnFamilyHandle columnFamilyHandle,
boolean reduce_level, int target_level, int target_path_id) final boolean reduce_level, final int target_level,
throws RocksDBException { final int target_path_id) throws RocksDBException {
compactRange(nativeHandle_, reduce_level, target_level, compactRange(nativeHandle_, reduce_level, target_level,
target_path_id, columnFamilyHandle.nativeHandle_); target_path_id, columnFamilyHandle.nativeHandle_);
} }
@ -1580,9 +1588,10 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public void compactRange(ColumnFamilyHandle columnFamilyHandle, public void compactRange(final ColumnFamilyHandle columnFamilyHandle,
byte[] begin, byte[] end, boolean reduce_level, int target_level, final byte[] begin, final byte[] end, final boolean reduce_level,
int target_path_id) throws RocksDBException { final int target_level, final int target_path_id)
throws RocksDBException {
compactRange(nativeHandle_, begin, begin.length, end, end.length, compactRange(nativeHandle_, begin, begin.length, end, end.length,
reduce_level, target_level, target_path_id, reduce_level, target_level, target_path_id,
columnFamilyHandle.nativeHandle_); columnFamilyHandle.nativeHandle_);
@ -1630,7 +1639,7 @@ public class RocksDB extends RocksObject {
* @throws RocksDBException thrown if operation was not performed * @throws RocksDBException thrown if operation was not performed
* successfully. * successfully.
*/ */
public void enableFileDeletions(boolean force) public void enableFileDeletions(final boolean force)
throws RocksDBException { throws RocksDBException {
enableFileDeletions(nativeHandle_, force); enableFileDeletions(nativeHandle_, force);
} }
@ -1652,7 +1661,7 @@ public class RocksDB extends RocksObject {
* @throws org.rocksdb.RocksDBException if iterator cannot be retrieved * @throws org.rocksdb.RocksDBException if iterator cannot be retrieved
* from native-side. * from native-side.
*/ */
public TransactionLogIterator getUpdatesSince(long sequenceNumber) public TransactionLogIterator getUpdatesSince(final long sequenceNumber)
throws RocksDBException { throws RocksDBException {
return new TransactionLogIterator( return new TransactionLogIterator(
getUpdatesSince(nativeHandle_, sequenceNumber)); getUpdatesSince(nativeHandle_, sequenceNumber));

@ -15,7 +15,7 @@ public class RocksDBException extends Exception {
* *
* @param msg the specified error message. * @param msg the specified error message.
*/ */
public RocksDBException(String msg) { public RocksDBException(final String msg) {
super(msg); super(msg);
} }
} }

@ -46,7 +46,7 @@ public class RocksEnv extends RocksObject {
* *
* @return current {@link org.rocksdb.RocksEnv} instance. * @return current {@link org.rocksdb.RocksEnv} instance.
*/ */
public RocksEnv setBackgroundThreads(int num) { public RocksEnv setBackgroundThreads(final int num) {
return setBackgroundThreads(num, FLUSH_POOL); return setBackgroundThreads(num, FLUSH_POOL);
} }
@ -61,7 +61,7 @@ public class RocksEnv extends RocksObject {
* <p>Default number: 1</p> * <p>Default number: 1</p>
* @return current {@link org.rocksdb.RocksEnv} instance. * @return current {@link org.rocksdb.RocksEnv} instance.
*/ */
public RocksEnv setBackgroundThreads(int num, int poolID) { public RocksEnv setBackgroundThreads(final int num, final int poolID) {
setBackgroundThreads(nativeHandle_, num, poolID); setBackgroundThreads(nativeHandle_, num, poolID);
return this; return this;
} }
@ -77,7 +77,7 @@ public class RocksEnv extends RocksObject {
* *
* @return the thread pool queue length. * @return the thread pool queue length.
*/ */
public int getThreadPoolQueueLen(int poolID) { public int getThreadPoolQueueLen(final int poolID) {
return getThreadPoolQueueLen(nativeHandle_, poolID); return getThreadPoolQueueLen(nativeHandle_, poolID);
} }
private native int getThreadPoolQueueLen(long handle, int poolID); private native int getThreadPoolQueueLen(long handle, int poolID);
@ -91,7 +91,7 @@ public class RocksEnv extends RocksObject {
* the ownership of the input handle. As a result, calling * the ownership of the input handle. As a result, calling
* {@code dispose()} of the created RocksEnv will be no-op.</p> * {@code dispose()} of the created RocksEnv will be no-op.</p>
*/ */
RocksEnv(long handle) { RocksEnv(final long handle) {
super(); super();
nativeHandle_ = handle; nativeHandle_ = handle;
disOwnNativeHandle(); disOwnNativeHandle();

@ -24,7 +24,7 @@ public class SkipListMemTableConfig extends MemTableConfig {
* seeks with consecutive keys. * seeks with consecutive keys.
* @return the current instance of SkipListMemTableConfig * @return the current instance of SkipListMemTableConfig
*/ */
public SkipListMemTableConfig setLookahead(long lookahead) { public SkipListMemTableConfig setLookahead(final long lookahead) {
lookahead_ = lookahead; lookahead_ = lookahead;
return this; return this;
} }

@ -9,7 +9,7 @@ package org.rocksdb;
* Snapshot of database * Snapshot of database
*/ */
public class Snapshot extends RocksObject { public class Snapshot extends RocksObject {
Snapshot(long nativeHandle) { Snapshot(final long nativeHandle) {
super(); super();
nativeHandle_ = nativeHandle; nativeHandle_ = nativeHandle;
} }

@ -13,7 +13,7 @@ public class Statistics {
private final long statsHandle_; private final long statsHandle_;
public Statistics(long statsHandle) { public Statistics(final long statsHandle) {
statsHandle_ = statsHandle; statsHandle_ = statsHandle;
} }
@ -22,7 +22,7 @@ public class Statistics {
return getTickerCount0(tickerType.getValue(), statsHandle_); return getTickerCount0(tickerType.getValue(), statsHandle_);
} }
public HistogramData geHistogramData(HistogramType histogramType) { public HistogramData geHistogramData(final HistogramType histogramType) {
assert(isInitialized()); assert(isInitialized());
return geHistogramData0( return geHistogramData0(
histogramType.getValue(), statsHandle_); histogramType.getValue(), statsHandle_);

@ -32,8 +32,9 @@ public class StatisticsCollector {
* @param statsCollectionIntervalInMilliSeconds Statistics collection time * @param statsCollectionIntervalInMilliSeconds Statistics collection time
* period (specified in milliseconds). * period (specified in milliseconds).
*/ */
public StatisticsCollector(List<StatsCollectorInput> statsCollectorInputList, public StatisticsCollector(
int statsCollectionIntervalInMilliSeconds) { final List<StatsCollectorInput> statsCollectorInputList,
final int statsCollectionIntervalInMilliSeconds) {
_statsCollectorInputList = statsCollectorInputList; _statsCollectorInputList = statsCollectorInputList;
_statsCollectionInterval = statsCollectionIntervalInMilliSeconds; _statsCollectionInterval = statsCollectionIntervalInMilliSeconds;
@ -51,7 +52,7 @@ public class StatisticsCollector {
* killing the collection process. * killing the collection process.
* @throws java.lang.InterruptedException thrown if Threads are interrupted. * @throws java.lang.InterruptedException thrown if Threads are interrupted.
*/ */
public void shutDown(int shutdownTimeout) throws InterruptedException { public void shutDown(final int shutdownTimeout) throws InterruptedException {
_isRunning = false; _isRunning = false;
_executorService.shutdownNow(); _executorService.shutdownNow();

@ -19,8 +19,8 @@ public class StatsCollectorInput {
* @param statistics Reference of DB statistics. * @param statistics Reference of DB statistics.
* @param statsCallback Reference of statistics callback interface. * @param statsCallback Reference of statistics callback interface.
*/ */
public StatsCollectorInput(Statistics statistics, public StatsCollectorInput(final Statistics statistics,
StatisticsCollectorCallback statsCallback) { final StatisticsCollectorCallback statsCallback) {
_statistics = statistics; _statistics = statistics;
_statsCallback = statsCallback; _statsCallback = statsCallback;
} }

@ -56,7 +56,7 @@ public class TransactionLogIterator extends RocksObject {
* *
* @param nativeHandle address to native address. * @param nativeHandle address to native address.
*/ */
TransactionLogIterator(long nativeHandle) { TransactionLogIterator(final long nativeHandle) {
super(); super();
nativeHandle_ = nativeHandle; nativeHandle_ = nativeHandle;
} }
@ -70,7 +70,7 @@ public class TransactionLogIterator extends RocksObject {
* by a TransactionLogIterator containing a sequence * by a TransactionLogIterator containing a sequence
* number and a {@link WriteBatch} instance.</p> * number and a {@link WriteBatch} instance.</p>
*/ */
public class BatchResult { public final class BatchResult {
/** /**
* <p>Constructor of BatchResult class.</p> * <p>Constructor of BatchResult class.</p>
* *
@ -78,7 +78,8 @@ public class TransactionLogIterator extends RocksObject {
* @param nativeHandle to {@link org.rocksdb.WriteBatch} * @param nativeHandle to {@link org.rocksdb.WriteBatch}
* native instance. * native instance.
*/ */
public BatchResult(long sequenceNumber, long nativeHandle) { public BatchResult(final long sequenceNumber,
final long nativeHandle) {
sequenceNumber_ = sequenceNumber; sequenceNumber_ = sequenceNumber;
writeBatch_ = new WriteBatch(nativeHandle); writeBatch_ = new WriteBatch(nativeHandle);
} }

@ -63,7 +63,7 @@ public class TtlDB extends RocksDB {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public static TtlDB open(Options options, String db_path) public static TtlDB open(final Options options, final String db_path)
throws RocksDBException { throws RocksDBException {
return open(options, db_path, 0, false); return open(options, db_path, 0, false);
} }
@ -82,8 +82,8 @@ public class TtlDB extends RocksDB {
* @throws RocksDBException thrown if an error occurs within the native * @throws RocksDBException thrown if an error occurs within the native
* part of the library. * part of the library.
*/ */
public static TtlDB open(Options options, String db_path, int ttl, public static TtlDB open(final Options options, final String db_path,
boolean readOnly) throws RocksDBException { final int ttl, final boolean readOnly) throws RocksDBException {
TtlDB ttldb = new TtlDB(); TtlDB ttldb = new TtlDB();
ttldb.open(options.nativeHandle_, db_path, ttl, readOnly); ttldb.open(options.nativeHandle_, db_path, ttl, readOnly);
return ttldb; return ttldb;
@ -108,10 +108,11 @@ public class TtlDB extends RocksDB {
* @throws java.lang.IllegalArgumentException when there is not a ttl value * @throws java.lang.IllegalArgumentException when there is not a ttl value
* per given column family handle. * per given column family handle.
*/ */
public static TtlDB open(DBOptions options, String db_path, public static TtlDB open(final DBOptions options, final String db_path,
List<ColumnFamilyDescriptor> columnFamilyDescriptors, final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
List<ColumnFamilyHandle> columnFamilyHandles, final List<ColumnFamilyHandle> columnFamilyHandles,
List<Integer> ttlValues, boolean readOnly) throws RocksDBException { final List<Integer> ttlValues, final boolean readOnly)
throws RocksDBException {
if (columnFamilyDescriptors.size() != ttlValues.size()) { if (columnFamilyDescriptors.size() != ttlValues.size()) {
throw new IllegalArgumentException("There must be a ttl value per column" + throw new IllegalArgumentException("There must be a ttl value per column" +
"family handle."); "family handle.");
@ -143,8 +144,8 @@ public class TtlDB extends RocksDB {
* native library. * native library.
*/ */
public ColumnFamilyHandle createColumnFamilyWithTtl( public ColumnFamilyHandle createColumnFamilyWithTtl(
ColumnFamilyDescriptor columnFamilyDescriptor, int ttl) final ColumnFamilyDescriptor columnFamilyDescriptor,
throws RocksDBException { final int ttl) throws RocksDBException {
assert(isInitialized()); assert(isInitialized());
return new ColumnFamilyHandle(this, return new ColumnFamilyHandle(this,
createColumnFamilyWithTtl(nativeHandle_, createColumnFamilyWithTtl(nativeHandle_,

@ -20,7 +20,7 @@ public class VectorMemTableConfig extends MemTableConfig {
* @param size the initial size of the vector. * @param size the initial size of the vector.
* @return the reference to the current config. * @return the reference to the current config.
*/ */
public VectorMemTableConfig setReservedSize(int size) { public VectorMemTableConfig setReservedSize(final int size) {
reservedSize_ = size; reservedSize_ = size;
return this; return this;
} }

@ -8,7 +8,7 @@ package org.rocksdb;
public class WBWIRocksIterator extends AbstractRocksIterator<WriteBatchWithIndex> { public class WBWIRocksIterator extends AbstractRocksIterator<WriteBatchWithIndex> {
private final WriteEntry entry = new WriteEntry(); private final WriteEntry entry = new WriteEntry();
protected WBWIRocksIterator(WriteBatchWithIndex wbwi, long nativeHandle) { protected WBWIRocksIterator(final WriteBatchWithIndex wbwi, final long nativeHandle) {
super(wbwi, nativeHandle); super(wbwi, nativeHandle);
} }

@ -36,7 +36,7 @@ public class WriteBatch extends AbstractWriteBatch {
* *
* @param reserved_bytes reserved size for WriteBatch * @param reserved_bytes reserved size for WriteBatch
*/ */
public WriteBatch(int reserved_bytes) { public WriteBatch(final int reserved_bytes) {
nativeHandle_ = 0; nativeHandle_ = 0;
newWriteBatch(reserved_bytes); newWriteBatch(reserved_bytes);
} }
@ -49,7 +49,7 @@ public class WriteBatch extends AbstractWriteBatch {
* *
* @throws RocksDBException If we cannot iterate over the batch * @throws RocksDBException If we cannot iterate over the batch
*/ */
public void iterate(Handler handler) throws RocksDBException { public void iterate(final Handler handler) throws RocksDBException {
iterate(handler.nativeHandle_); iterate(handler.nativeHandle_);
} }
@ -60,7 +60,7 @@ public class WriteBatch extends AbstractWriteBatch {
* *
* @param nativeHandle address of native instance. * @param nativeHandle address of native instance.
*/ */
WriteBatch(long nativeHandle) { WriteBatch(final long nativeHandle) {
super(); super();
disOwnNativeHandle(); disOwnNativeHandle();
nativeHandle_ = nativeHandle; nativeHandle_ = nativeHandle;

@ -40,7 +40,7 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* inserting a duplicate key, in this way an iterator will never * inserting a duplicate key, in this way an iterator will never
* show two entries with the same key. * show two entries with the same key.
*/ */
public WriteBatchWithIndex(boolean overwriteKey) { public WriteBatchWithIndex(final boolean overwriteKey) {
super(); super();
newWriteBatchWithIndex(overwriteKey); newWriteBatchWithIndex(overwriteKey);
} }
@ -58,8 +58,8 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* inserting a duplicate key, in this way an iterator will never * inserting a duplicate key, in this way an iterator will never
* show two entries with the same key. * show two entries with the same key.
*/ */
public WriteBatchWithIndex(AbstractComparator<? extends AbstractSlice<?>> public WriteBatchWithIndex(final AbstractComparator<? extends AbstractSlice<?>>
fallbackIndexComparator, int reservedBytes, boolean overwriteKey) { fallbackIndexComparator, final int reservedBytes, final boolean overwriteKey) {
super(); super();
newWriteBatchWithIndex(fallbackIndexComparator.nativeHandle_, reservedBytes, overwriteKey); newWriteBatchWithIndex(fallbackIndexComparator.nativeHandle_, reservedBytes, overwriteKey);
} }
@ -75,7 +75,7 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* @param columnFamilyHandle The column family to iterate over * @param columnFamilyHandle The column family to iterate over
* @return An iterator for the Write Batch contents, restricted to the column family * @return An iterator for the Write Batch contents, restricted to the column family
*/ */
public WBWIRocksIterator newIterator(ColumnFamilyHandle columnFamilyHandle) { public WBWIRocksIterator newIterator(final ColumnFamilyHandle columnFamilyHandle) {
return new WBWIRocksIterator(this, iterator1(columnFamilyHandle.nativeHandle_)); return new WBWIRocksIterator(this, iterator1(columnFamilyHandle.nativeHandle_));
} }
@ -103,8 +103,8 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* @return An iterator which shows a view comprised of both the database point-in-time * @return An iterator which shows a view comprised of both the database point-in-time
* from baseIterator and modifications made in this write batch. * from baseIterator and modifications made in this write batch.
*/ */
public RocksIterator newIteratorWithBase(ColumnFamilyHandle columnFamilyHandle, public RocksIterator newIteratorWithBase(final ColumnFamilyHandle columnFamilyHandle,
RocksIterator baseIterator) { final RocksIterator baseIterator) {
RocksIterator iterator = new RocksIterator( RocksIterator iterator = new RocksIterator(
baseIterator.parent_, baseIterator.parent_,
iteratorWithBase(columnFamilyHandle.nativeHandle_, baseIterator.nativeHandle_)); iteratorWithBase(columnFamilyHandle.nativeHandle_, baseIterator.nativeHandle_));
@ -122,7 +122,7 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* @return An iterator which shows a view comprised of both the database point-in-time * @return An iterator which shows a view comprised of both the database point-in-time
* from baseIterator and modifications made in this write batch. * from baseIterator and modifications made in this write batch.
*/ */
public RocksIterator newIteratorWithBase(RocksIterator baseIterator) { public RocksIterator newIteratorWithBase(final RocksIterator baseIterator) {
return newIteratorWithBase(baseIterator.parent_.getDefaultColumnFamily(), baseIterator); return newIteratorWithBase(baseIterator.parent_.getDefaultColumnFamily(), baseIterator);
} }

@ -47,7 +47,7 @@ public class WriteOptions extends RocksObject {
* should be synchronized. * should be synchronized.
* @return the instance of the current WriteOptions. * @return the instance of the current WriteOptions.
*/ */
public WriteOptions setSync(boolean flag) { public WriteOptions setSync(final boolean flag) {
setSync(nativeHandle_, flag); setSync(nativeHandle_, flag);
return this; return this;
} }
@ -82,7 +82,7 @@ public class WriteOptions extends RocksObject {
* write-ahead-log on writes. * write-ahead-log on writes.
* @return the instance of the current WriteOptions. * @return the instance of the current WriteOptions.
*/ */
public WriteOptions setDisableWAL(boolean flag) { public WriteOptions setDisableWAL(final boolean flag) {
setDisableWAL(nativeHandle_, flag); setDisableWAL(nativeHandle_, flag);
return this; return this;
} }

@ -22,11 +22,11 @@ public class Environment {
return (ARCH.indexOf("64") > 0); return (ARCH.indexOf("64") > 0);
} }
public static String getSharedLibraryName(String name) { public static String getSharedLibraryName(final String name) {
return name + "jni"; return name + "jni";
} }
public static String getSharedLibraryFileName(String name) { public static String getSharedLibraryFileName(final String name) {
return appendLibOsSuffix("lib" + getSharedLibraryName(name), true); return appendLibOsSuffix("lib" + getSharedLibraryName(name), true);
} }

Loading…
Cancel
Save