Fix bug in UnScSigned-off-by: xh931076284 <931076284@qq.com> (#1336)

Fix HdfsEnv::UnSchedule() API error
This commit is contained in:
xh931076284 2016-09-15 01:17:34 +08:00 committed by Islam AbdelRahman
parent 8e061f9740
commit 3639f32889
3 changed files with 29 additions and 1 deletions

View File

@ -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) {

View File

@ -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<rocksdb::DBOptions*>(jhandle)->
delayed_write_rate = static_cast<int64_t>(delay_write_rate);
}
jlong Java_org_rocksdb_DBOptions_delayedWriteRate(
JNIEnv* env, jobject jobj, jlong jhandle){
return reinterpret_cast<rocksdb::DBOptions*>(jhandle)->
delayed_write_rate;
}
//////////////////////////////////////////////////////////////////////////////
// rocksdb::WriteOptions

View File

@ -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_);
}
/**
* <p>Private constructor to be used by
* {@link #getDBOptionsFromProps(java.util.Properties)}</p>
@ -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_;
}