diff --git a/hdfs/env_hdfs.h b/hdfs/env_hdfs.h index ab27e0440..11879e332 100644 --- a/hdfs/env_hdfs.h +++ b/hdfs/env_hdfs.h @@ -106,7 +106,7 @@ class HdfsEnv : public Env { } virtual int UnSchedule(void* tag, Priority pri) { - posixEnv->UnSchedule(tag, pri); + return posixEnv->UnSchedule(tag, pri); } virtual void StartThread(void (*function)(void* arg), void* arg) { diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index f4f941149..4116c13f0 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -4371,6 +4371,20 @@ jlong Java_org_rocksdb_DBOptions_writeThreadSlowYieldUsec( write_thread_slow_yield_usec; } +void Java_org_rocksdb_DBOptions_setDelayedWriteRate( + JNIEnv* env, jobject jobj, jlong jhandle, jlong delay_write_rate){ + + reinterpret_cast(jhandle)-> + delayed_write_rate = static_cast(delay_write_rate); + + } + + jlong Java_org_rocksdb_DBOptions_delayedWriteRate( + JNIEnv* env, jobject jobj, jlong jhandle){ + + return reinterpret_cast(jhandle)-> + delayed_write_rate; + } ////////////////////////////////////////////////////////////////////////////// // rocksdb::WriteOptions diff --git a/java/src/main/java/org/rocksdb/DBOptions.java b/java/src/main/java/org/rocksdb/DBOptions.java index 9cc2d2bfd..2189bf3f0 100644 --- a/java/src/main/java/org/rocksdb/DBOptions.java +++ b/java/src/main/java/org/rocksdb/DBOptions.java @@ -604,6 +604,17 @@ public class DBOptions extends RocksObject implements DBOptionsInterface { static final int DEFAULT_NUM_SHARD_BITS = -1; + public DBOptions setDelayedWriteRate(final long delayedWriteRate){ + assert(isOwningHandle()); + setDelayedWriteRate(nativeHandle_, delayedWriteRate); + return this; +} + +public long delayedWriteRate(){ + return delayedWriteRate(nativeHandle_); +} + + /** *

Private constructor to be used by * {@link #getDBOptionsFromProps(java.util.Properties)}

@@ -725,6 +736,9 @@ public class DBOptions extends RocksObject implements DBOptionsInterface { long writeThreadSlowYieldUsec); private native long writeThreadSlowYieldUsec(long handle); + private native void setDelayedWriteRate(long handle, long delayedWriteRate); + private native long delayedWriteRate(long handle); + int numShardBits_; RateLimiterConfig rateLimiterConfig_; }