Fix formatting errors

main
Ankit Gupta 11 years ago
parent c990a7645a
commit 22d45de2ed
  1. 29
      java/org/rocksdb/Options.java
  2. 18
      java/rocksjni/options.cc

@ -34,7 +34,7 @@ public class Options {
* @see RocksDB::Open() * @see RocksDB::Open()
*/ */
public void setCreateIfMissing(boolean flag) { public void setCreateIfMissing(boolean flag) {
checkInitialization(); assert(isInitialized());
setCreateIfMissing(nativeHandle_, flag); setCreateIfMissing(nativeHandle_, flag);
} }
@ -46,7 +46,7 @@ public class Options {
* @see setCreateIfMissing() * @see setCreateIfMissing()
*/ */
public boolean createIfMissing() { public boolean createIfMissing() {
checkInitialization(); assert(isInitialized());
return createIfMissing(nativeHandle_); return createIfMissing(nativeHandle_);
} }
@ -67,7 +67,7 @@ public class Options {
* @see RocksDB::Open() * @see RocksDB::Open()
*/ */
public void setWriteBufferSize(int writeBufferSize) { public void setWriteBufferSize(int writeBufferSize) {
checkInitialization(); assert(isInitialized());
setWriteBufferSize(nativeHandle_, writeBufferSize); setWriteBufferSize(nativeHandle_, writeBufferSize);
} }
@ -78,7 +78,7 @@ public class Options {
* @see setWriteBufferSize() * @see setWriteBufferSize()
*/ */
public int writeBufferSize() { public int writeBufferSize() {
checkInitialization(); assert(isInitialized());
return writeBufferSize(nativeHandle_); return writeBufferSize(nativeHandle_);
} }
@ -92,7 +92,7 @@ public class Options {
* @see RocksDB::Open() * @see RocksDB::Open()
*/ */
public void setMaxWriteBufferNumber(int maxWriteBufferNumber) { public void setMaxWriteBufferNumber(int maxWriteBufferNumber) {
checkInitialization(); assert(isInitialized());
setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber); setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber);
} }
@ -103,7 +103,7 @@ public class Options {
* @see setMaxWriteBufferNumber() * @see setMaxWriteBufferNumber()
*/ */
public int maxWriteBufferNumber() { public int maxWriteBufferNumber() {
checkInitialization(); assert(isInitialized());
return maxWriteBufferNumber(nativeHandle_); return maxWriteBufferNumber(nativeHandle_);
} }
@ -119,7 +119,7 @@ public class Options {
* @see RocksDB::Open() * @see RocksDB::Open()
*/ */
public void setBlockSize(int blockSize) { public void setBlockSize(int blockSize) {
checkInitialization(); assert(isInitialized());
setBlockSize(nativeHandle_, blockSize); setBlockSize(nativeHandle_, blockSize);
} }
@ -130,7 +130,7 @@ public class Options {
* @see setBlockSize() * @see setBlockSize()
*/ */
public int blockSize() { public int blockSize() {
checkInitialization(); assert(isInitialized());
return blockSize(nativeHandle_); return blockSize(nativeHandle_);
} }
@ -139,12 +139,13 @@ public class Options {
* With bloomfilter and fast storage, a miss on one level * With bloomfilter and fast storage, a miss on one level
* is very cheap if the file handle is cached in table cache * is very cheap if the file handle is cached in table cache
* (which is true if max_open_files is large). * (which is true if max_open_files is large).
* Default: true
* *
* @param disable seek compaction * @param disable seek compaction
* @see RocksDB::Open() * @see RocksDB::Open()
*/ */
public void setDisableSeekCompaction(boolean disableSeekCompaction) { public void setDisableSeekCompaction(boolean disableSeekCompaction) {
checkInitialization(); assert(isInitialized());
setDisableSeekCompaction(nativeHandle_, disableSeekCompaction); setDisableSeekCompaction(nativeHandle_, disableSeekCompaction);
} }
@ -155,7 +156,7 @@ public class Options {
* @see setDisableSeekCompaction() * @see setDisableSeekCompaction()
*/ */
public boolean disableSeekCompaction() { public boolean disableSeekCompaction() {
checkInitialization(); assert(isInitialized());
return disableSeekCompaction(nativeHandle_); return disableSeekCompaction(nativeHandle_);
} }
@ -168,7 +169,7 @@ public class Options {
* @see RocksDB::Open() * @see RocksDB::Open()
*/ */
public void setMaxBackgroundCompactions(int maxBackgroundCompactions) { public void setMaxBackgroundCompactions(int maxBackgroundCompactions) {
checkInitialization(); assert(isInitialized());
setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions); setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions);
} }
@ -179,7 +180,7 @@ public class Options {
* @see setMaxBackgroundCompactions * @see setMaxBackgroundCompactions
*/ */
public int maxBackgroundCompactions() { public int maxBackgroundCompactions() {
checkInitialization(); assert(isInitialized());
return maxBackgroundCompactions(nativeHandle_); return maxBackgroundCompactions(nativeHandle_);
} }
@ -193,8 +194,8 @@ public class Options {
} }
} }
private void checkInitialization() { private boolean isInitialized() {
assert(nativeHandle_ != 0); return (nativeHandle_ != 0);
} }
private native void newOptions(); private native void newOptions();

@ -87,7 +87,8 @@ jint Java_org_rocksdb_Options_writeBufferSize(
*/ */
void Java_org_rocksdb_Options_setMaxWriteBufferNumber( void Java_org_rocksdb_Options_setMaxWriteBufferNumber(
JNIEnv* env, jobject jobj, jlong jhandle, jint jmax_write_buffer_number) { JNIEnv* env, jobject jobj, jlong jhandle, jint jmax_write_buffer_number) {
reinterpret_cast<rocksdb::Options*>(jhandle)->max_write_buffer_number = jmax_write_buffer_number; reinterpret_cast<rocksdb::Options*>(jhandle)->max_write_buffer_number =
jmax_write_buffer_number;
} }
@ -128,8 +129,10 @@ jint Java_org_rocksdb_Options_blockSize(
* Signature: (JZ)V * Signature: (JZ)V
*/ */
void Java_org_rocksdb_Options_setDisableSeekCompaction( void Java_org_rocksdb_Options_setDisableSeekCompaction(
JNIEnv* env, jobject jobj, jlong jhandle, jboolean jdisable_seek_compaction) { JNIEnv* env, jobject jobj, jlong jhandle,
reinterpret_cast<rocksdb::Options*>(jhandle)->disable_seek_compaction = jdisable_seek_compaction; jboolean jdisable_seek_compaction) {
reinterpret_cast<rocksdb::Options*>(jhandle)->disable_seek_compaction =
jdisable_seek_compaction;
} }
/* /*
@ -148,8 +151,10 @@ jboolean Java_org_rocksdb_Options_disableSeekCompaction(
* Signature: (JI)V * Signature: (JI)V
*/ */
void Java_org_rocksdb_Options_setMaxBackgroundCompactions( void Java_org_rocksdb_Options_setMaxBackgroundCompactions(
JNIEnv* env, jobject jobj, jlong jhandle, jint jmax_background_compactions) { JNIEnv* env, jobject jobj, jlong jhandle,
reinterpret_cast<rocksdb::Options*>(jhandle)->max_background_compactions = jmax_background_compactions; jint jmax_background_compactions) {
reinterpret_cast<rocksdb::Options*>(jhandle)->max_background_compactions =
jmax_background_compactions;
} }
/* /*
@ -159,7 +164,8 @@ void Java_org_rocksdb_Options_setMaxBackgroundCompactions(
*/ */
jint Java_org_rocksdb_Options_maxBackgroundCompactions( jint Java_org_rocksdb_Options_maxBackgroundCompactions(
JNIEnv* env, jobject jobj, jlong jhandle) { JNIEnv* env, jobject jobj, jlong jhandle) {
return reinterpret_cast<rocksdb::Options*>(jhandle)->max_background_compactions; return
reinterpret_cast<rocksdb::Options*>(jhandle)->max_background_compactions;
} }

Loading…
Cancel
Save