From 566f6527163a27a4025939816d73a5681fd7c5d7 Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 15 Apr 2015 23:31:59 +0200 Subject: [PATCH 1/3] [RocksJava] Removed deprecated ColumnFamilyDescriptor methods As announced previously removed methods are obsolete and will be replaced by its byte array pendants. --- .../org/rocksdb/ColumnFamilyDescriptor.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java b/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java index 4c0954740..8def05e74 100644 --- a/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java +++ b/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java @@ -11,19 +11,6 @@ package org.rocksdb; */ public class ColumnFamilyDescriptor { - /** - *

Creates a new Column Family using a name and default - * options,

- * - * @param columnFamilyName name of column family. - * @deprecated will be removed in RocksDB 3.10.0. Use - * {@link #ColumnFamilyDescriptor(byte[])} instead. - */ - @Deprecated - public ColumnFamilyDescriptor(final String columnFamilyName){ - this(columnFamilyName.getBytes(), new ColumnFamilyOptions()); - } - /** *

Creates a new Column Family using a name and default * options,

@@ -35,22 +22,6 @@ public class ColumnFamilyDescriptor { this(columnFamilyName, new ColumnFamilyOptions()); } - /** - *

Creates a new Column Family using a name and custom - * options.

- * - * @param columnFamilyName name of column family. - * @param columnFamilyOptions options to be used with - * column family. - * @deprecated will be removed in RocksDB 3.10.0. Use - * {@link #ColumnFamilyDescriptor(byte[], ColumnFamilyOptions)} instead. - */ - @Deprecated - public ColumnFamilyDescriptor(final String columnFamilyName, - final ColumnFamilyOptions columnFamilyOptions) { - this(columnFamilyName.getBytes(), columnFamilyOptions); - } - /** *

Creates a new Column Family using a name and custom * options.

From 5b7131c751efd69ffa7ebe4b9450643f2b2e5860 Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 15 Apr 2015 23:35:09 +0200 Subject: [PATCH 2/3] [RocksJava] Removed deprecated skipLogErrorOnRecovery methods. As annonunced these options are not used anymore so these are removed from code. --- java/rocksjni/options.cc | 44 ------------------- java/src/main/java/org/rocksdb/DBOptions.java | 19 -------- .../java/org/rocksdb/DBOptionsInterface.java | 25 ----------- java/src/main/java/org/rocksdb/Options.java | 18 -------- .../test/java/org/rocksdb/DBOptionsTest.java | 15 ------- .../test/java/org/rocksdb/OptionsTest.java | 15 ------- 6 files changed, 136 deletions(-) diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index 487b92655..ee236645f 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -890,28 +890,6 @@ void Java_org_rocksdb_Options_setIsFdCloseOnExec( static_cast(is_fd_close_on_exec); } -/* - * Class: org_rocksdb_Options - * Method: skipLogErrorOnRecovery - * Signature: (J)Z - */ -jboolean Java_org_rocksdb_Options_skipLogErrorOnRecovery( - JNIEnv* env, jobject jobj, jlong jhandle) { - return reinterpret_cast(jhandle) - ->skip_log_error_on_recovery; -} - -/* - * Class: org_rocksdb_Options - * Method: setSkipLogErrorOnRecovery - * Signature: (JZ)V - */ -void Java_org_rocksdb_Options_setSkipLogErrorOnRecovery( - JNIEnv* env, jobject jobj, jlong jhandle, jboolean skip) { - reinterpret_cast(jhandle)->skip_log_error_on_recovery = - static_cast(skip); -} - /* * Class: org_rocksdb_Options * Method: statsDumpPeriodSec @@ -3697,28 +3675,6 @@ jboolean Java_org_rocksdb_DBOptions_isFdCloseOnExec( return reinterpret_cast(jhandle)->is_fd_close_on_exec; } -/* - * Class: org_rocksdb_DBOptions - * Method: setSkipLogErrorOnRecovery - * Signature: (JZ)V - */ -void Java_org_rocksdb_DBOptions_setSkipLogErrorOnRecovery( - JNIEnv* env, jobject jobj, jlong jhandle, jboolean skip) { - reinterpret_cast(jhandle)->skip_log_error_on_recovery = - static_cast(skip); -} - -/* - * Class: org_rocksdb_DBOptions - * Method: skipLogErrorOnRecovery - * Signature: (J)Z - */ -jboolean Java_org_rocksdb_DBOptions_skipLogErrorOnRecovery( - JNIEnv* env, jobject jobj, jlong jhandle) { - return reinterpret_cast(jhandle) - ->skip_log_error_on_recovery; -} - /* * Class: org_rocksdb_DBOptions * Method: setStatsDumpPeriodSec diff --git a/java/src/main/java/org/rocksdb/DBOptions.java b/java/src/main/java/org/rocksdb/DBOptions.java index b60d897a3..4d81a40bd 100644 --- a/java/src/main/java/org/rocksdb/DBOptions.java +++ b/java/src/main/java/org/rocksdb/DBOptions.java @@ -494,22 +494,6 @@ public class DBOptions extends RocksObject implements DBOptionsInterface { return isFdCloseOnExec(nativeHandle_); } - @Override - @Deprecated - public DBOptions setSkipLogErrorOnRecovery( - final boolean skip) { - assert(isInitialized()); - setSkipLogErrorOnRecovery(nativeHandle_, skip); - return this; - } - - @Override - @Deprecated - public boolean skipLogErrorOnRecovery() { - assert(isInitialized()); - return skipLogErrorOnRecovery(nativeHandle_); - } - @Override public DBOptions setStatsDumpPeriodSec( final int statsDumpPeriodSec) { @@ -670,9 +654,6 @@ public class DBOptions extends RocksObject implements DBOptionsInterface { private native void setIsFdCloseOnExec( long handle, boolean isFdCloseOnExec); private native boolean isFdCloseOnExec(long handle); - private native void setSkipLogErrorOnRecovery( - long handle, boolean skip); - private native boolean skipLogErrorOnRecovery(long handle); private native void setStatsDumpPeriodSec( long handle, int statsDumpPeriodSec); private native int statsDumpPeriodSec(long handle); diff --git a/java/src/main/java/org/rocksdb/DBOptionsInterface.java b/java/src/main/java/org/rocksdb/DBOptionsInterface.java index e7f16b7cb..6050c29c0 100644 --- a/java/src/main/java/org/rocksdb/DBOptionsInterface.java +++ b/java/src/main/java/org/rocksdb/DBOptionsInterface.java @@ -715,31 +715,6 @@ public interface DBOptionsInterface { */ boolean isFdCloseOnExec(); - /** - * Skip log corruption error on recovery (If client is ok with - * losing most recent changes) - * Default: false - * - * @param skip true if log corruption errors are skipped during recovery. - * @return the instance of the current Object. - * - * @deprecated will be removed in RocksDB 3.11.0. Not used anymore. - */ - @Deprecated - Object setSkipLogErrorOnRecovery(boolean skip); - - /** - * Skip log corruption error on recovery (If client is ok with - * losing most recent changes) - * Default: false - * - * @return true if log corruption errors are skipped during recovery. - * - * @deprecated will be removed in RocksDB 3.11.0. Not used anymore. - */ - @Deprecated - boolean skipLogErrorOnRecovery(); - /** * if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec * Default: 3600 (1 hour) diff --git a/java/src/main/java/org/rocksdb/Options.java b/java/src/main/java/org/rocksdb/Options.java index ed4fb163d..0ed9bfa88 100644 --- a/java/src/main/java/org/rocksdb/Options.java +++ b/java/src/main/java/org/rocksdb/Options.java @@ -556,21 +556,6 @@ public class Options extends RocksObject return this; } - @Override - @Deprecated - public boolean skipLogErrorOnRecovery() { - assert(isInitialized()); - return skipLogErrorOnRecovery(nativeHandle_); - } - - @Override - @Deprecated - public Options setSkipLogErrorOnRecovery(final boolean skip) { - assert(isInitialized()); - setSkipLogErrorOnRecovery(nativeHandle_, skip); - return this; - } - @Override public int statsDumpPeriodSec() { assert(isInitialized()); @@ -1189,9 +1174,6 @@ public class Options extends RocksObject private native void setIsFdCloseOnExec( long handle, boolean isFdCloseOnExec); private native boolean isFdCloseOnExec(long handle); - private native void setSkipLogErrorOnRecovery( - long handle, boolean skip); - private native boolean skipLogErrorOnRecovery(long handle); private native void setStatsDumpPeriodSec( long handle, int statsDumpPeriodSec); private native int statsDumpPeriodSec(long handle); diff --git a/java/src/test/java/org/rocksdb/DBOptionsTest.java b/java/src/test/java/org/rocksdb/DBOptionsTest.java index 98e033a83..98ba4ce38 100644 --- a/java/src/test/java/org/rocksdb/DBOptionsTest.java +++ b/java/src/test/java/org/rocksdb/DBOptionsTest.java @@ -473,21 +473,6 @@ public class DBOptionsTest { } } - @Test - public void skipLogErrorOnRecovery() { - DBOptions opt = null; - try { - opt = new DBOptions(); - boolean boolValue = rand.nextBoolean(); - opt.setSkipLogErrorOnRecovery(boolValue); - assertThat(opt.skipLogErrorOnRecovery()).isEqualTo(boolValue); - } finally { - if (opt != null) { - opt.dispose(); - } - } - } - @Test public void statsDumpPeriodSec() { DBOptions opt = null; diff --git a/java/src/test/java/org/rocksdb/OptionsTest.java b/java/src/test/java/org/rocksdb/OptionsTest.java index 0cba08a2f..1cdde548f 100644 --- a/java/src/test/java/org/rocksdb/OptionsTest.java +++ b/java/src/test/java/org/rocksdb/OptionsTest.java @@ -920,21 +920,6 @@ public class OptionsTest { } } - @Test - public void skipLogErrorOnRecovery() { - Options opt = null; - try { - opt = new Options(); - boolean boolValue = rand.nextBoolean(); - opt.setSkipLogErrorOnRecovery(boolValue); - assertThat(opt.skipLogErrorOnRecovery()).isEqualTo(boolValue); - } finally { - if (opt != null) { - opt.dispose(); - } - } - } - @Test public void statsDumpPeriodSec() { Options opt = null; From 019ecd19329ee895284e9b040df0ffe4c08b35d8 Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 15 Apr 2015 23:43:30 +0200 Subject: [PATCH 3/3] [RocksJava] Remove deprecated methods Summary: - Removed deprecated ColumnFamilyDescript constructor methods - Removed deprecated skipLogErrorOnRecovery methods - Removed deprecated tableCacheRemoveScanCountLimit methods Test Plan: make rocksdbjava make jtest Reviewers: yhchiang, adamretter, ankgup87 Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D37191 --- java/rocksjni/options.cc | 42 ------------------- java/src/main/java/org/rocksdb/DBOptions.java | 17 -------- .../java/org/rocksdb/DBOptionsInterface.java | 33 --------------- java/src/main/java/org/rocksdb/Options.java | 17 -------- 4 files changed, 109 deletions(-) diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index ee236645f..2186d0ce7 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -695,27 +695,6 @@ void Java_org_rocksdb_Options_setTableCacheNumshardbits( static_cast(table_cache_numshardbits); } -/* - * Class: org_rocksdb_Options - * Method: tableCacheRemoveScanCountLimit - * Signature: (J)I - */ -jint Java_org_rocksdb_Options_tableCacheRemoveScanCountLimit( - JNIEnv* env, jobject jobj, jlong jhandle) { - // deprecated - return 0; -} - -/* - * Class: org_rocksdb_Options - * Method: setTableCacheRemoveScanCountLimit - * Signature: (JI)V - */ -void Java_org_rocksdb_Options_setTableCacheRemoveScanCountLimit( - JNIEnv* env, jobject jobj, jlong jhandle, jint limit) { - // deprecated -} - /* * Method: useFixedLengthPrefixExtractor * Signature: (JI)V @@ -3501,27 +3480,6 @@ jint Java_org_rocksdb_DBOptions_tableCacheNumshardbits( table_cache_numshardbits; } -/* - * Class: org_rocksdb_DBOptions - * Method: setTableCacheRemoveScanCountLimit - * Signature: (JI)V - */ -void Java_org_rocksdb_DBOptions_setTableCacheRemoveScanCountLimit( - JNIEnv* env, jobject jobj, jlong jhandle, jint limit) { - // deprecated -} - -/* - * Class: org_rocksdb_DBOptions - * Method: tableCacheRemoveScanCountLimit - * Signature: (J)I - */ -jint Java_org_rocksdb_DBOptions_tableCacheRemoveScanCountLimit( - JNIEnv* env, jobject jobj, jlong jhandle) { - // deprecated - return 0; -} - /* * Class: org_rocksdb_DBOptions * Method: setWalTtlSeconds diff --git a/java/src/main/java/org/rocksdb/DBOptions.java b/java/src/main/java/org/rocksdb/DBOptions.java index 4d81a40bd..85aad1e72 100644 --- a/java/src/main/java/org/rocksdb/DBOptions.java +++ b/java/src/main/java/org/rocksdb/DBOptions.java @@ -382,20 +382,6 @@ public class DBOptions extends RocksObject implements DBOptionsInterface { return tableCacheNumshardbits(nativeHandle_); } - @Override - public DBOptions setTableCacheRemoveScanCountLimit( - final int limit) { - assert(isInitialized()); - setTableCacheRemoveScanCountLimit(nativeHandle_, limit); - return this; - } - - @Override - public int tableCacheRemoveScanCountLimit() { - assert(isInitialized()); - return tableCacheRemoveScanCountLimit(nativeHandle_); - } - @Override public DBOptions setWalTtlSeconds( final long walTtlSeconds) { @@ -632,9 +618,6 @@ public class DBOptions extends RocksObject implements DBOptionsInterface { private native void setTableCacheNumshardbits( long handle, int tableCacheNumshardbits); private native int tableCacheNumshardbits(long handle); - private native void setTableCacheRemoveScanCountLimit( - long handle, int limit); - private native int tableCacheRemoveScanCountLimit(long handle); private native void setWalTtlSeconds(long handle, long walTtlSeconds); private native long walTtlSeconds(long handle); private native void setWalSizeLimitMB(long handle, long sizeLimitMB); diff --git a/java/src/main/java/org/rocksdb/DBOptionsInterface.java b/java/src/main/java/org/rocksdb/DBOptionsInterface.java index 6050c29c0..f710105a6 100644 --- a/java/src/main/java/org/rocksdb/DBOptionsInterface.java +++ b/java/src/main/java/org/rocksdb/DBOptionsInterface.java @@ -505,39 +505,6 @@ public interface DBOptionsInterface { */ int tableCacheNumshardbits(); - /** - * During data eviction of table's LRU cache, it would be inefficient - * to strictly follow LRU because this piece of memory will not really - * be released unless its refcount falls to zero. Instead, make two - * passes: the first pass will release items with refcount = 1, - * and if not enough space releases after scanning the number of - * elements specified by this parameter, we will remove items in LRU - * order. - * - * @param limit scan count limit - * @return the instance of the current Object. - * - * @deprecated This function is depreciated. - */ - @Deprecated - Object setTableCacheRemoveScanCountLimit(int limit); - - /** - * During data eviction of table's LRU cache, it would be inefficient - * to strictly follow LRU because this piece of memory will not really - * be released unless its refcount falls to zero. Instead, make two - * passes: the first pass will release items with refcount = 1, - * and if not enough space releases after scanning the number of - * elements specified by this parameter, we will remove items in LRU - * order. - * - * @return scan count limit - * - * @deprecated This function is depreciated. - */ - @Deprecated - int tableCacheRemoveScanCountLimit(); - /** * {@link #walTtlSeconds()} and {@link #walSizeLimitMB()} affect how archived logs * will be deleted. diff --git a/java/src/main/java/org/rocksdb/Options.java b/java/src/main/java/org/rocksdb/Options.java index 0ed9bfa88..75e5b1822 100644 --- a/java/src/main/java/org/rocksdb/Options.java +++ b/java/src/main/java/org/rocksdb/Options.java @@ -451,20 +451,6 @@ public class Options extends RocksObject return this; } - @Override - public int tableCacheRemoveScanCountLimit() { - assert(isInitialized()); - return tableCacheRemoveScanCountLimit(nativeHandle_); - } - - @Override - public Options setTableCacheRemoveScanCountLimit( - final int limit) { - assert(isInitialized()); - setTableCacheRemoveScanCountLimit(nativeHandle_, limit); - return this; - } - @Override public long walTtlSeconds() { assert(isInitialized()); @@ -1152,9 +1138,6 @@ public class Options extends RocksObject private native void setTableCacheNumshardbits( long handle, int tableCacheNumshardbits); private native int tableCacheNumshardbits(long handle); - private native void setTableCacheRemoveScanCountLimit( - long handle, int limit); - private native int tableCacheRemoveScanCountLimit(long handle); private native void setWalTtlSeconds(long handle, long walTtlSeconds); private native long walTtlSeconds(long handle); private native void setWalSizeLimitMB(long handle, long sizeLimitMB);