Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
51da3aab
R
rocksdb
项目概览
kvdb
/
rocksdb
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
51da3aab
编写于
3月 22, 2015
作者:
A
Adam Retter
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #536 from fyrz/RocksJava-32-Bit-adjustment
[RocksJava] 32-Bit adjustments
上级
b7e88cfb
5615e23d
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
139 addition
and
133 deletion
+139
-133
java/rocksjni/memtablejni.cc
java/rocksjni/memtablejni.cc
+4
-4
java/rocksjni/options.cc
java/rocksjni/options.cc
+16
-16
java/rocksjni/portal.h
java/rocksjni/portal.h
+42
-18
java/samples/src/main/java/RocksDBSample.java
java/samples/src/main/java/RocksDBSample.java
+2
-1
java/src/main/java/org/rocksdb/ColumnFamilyOptions.java
java/src/main/java/org/rocksdb/ColumnFamilyOptions.java
+12
-12
java/src/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java
...c/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java
+15
-20
java/src/main/java/org/rocksdb/DBOptions.java
java/src/main/java/org/rocksdb/DBOptions.java
+8
-8
java/src/main/java/org/rocksdb/DBOptionsInterface.java
java/src/main/java/org/rocksdb/DBOptionsInterface.java
+12
-16
java/src/main/java/org/rocksdb/HashLinkedListMemTableConfig.java
...c/main/java/org/rocksdb/HashLinkedListMemTableConfig.java
+2
-3
java/src/main/java/org/rocksdb/HashSkipListMemTableConfig.java
...src/main/java/org/rocksdb/HashSkipListMemTableConfig.java
+2
-3
java/src/main/java/org/rocksdb/MemTableConfig.java
java/src/main/java/org/rocksdb/MemTableConfig.java
+1
-5
java/src/main/java/org/rocksdb/Options.java
java/src/main/java/org/rocksdb/Options.java
+19
-25
java/src/main/java/org/rocksdb/SkipListMemTableConfig.java
java/src/main/java/org/rocksdb/SkipListMemTableConfig.java
+2
-1
java/src/main/java/org/rocksdb/VectorMemTableConfig.java
java/src/main/java/org/rocksdb/VectorMemTableConfig.java
+2
-1
未找到文件。
java/rocksjni/memtablejni.cc
浏览文件 @
51da3aab
...
@@ -27,7 +27,7 @@ jlong Java_org_rocksdb_HashSkipListMemTableConfig_newMemTableFactoryHandle(
...
@@ -27,7 +27,7 @@ jlong Java_org_rocksdb_HashSkipListMemTableConfig_newMemTableFactoryHandle(
static_cast
<
int32_t
>
(
jheight
),
static_cast
<
int32_t
>
(
jheight
),
static_cast
<
int32_t
>
(
jbranching_factor
)));
static_cast
<
int32_t
>
(
jbranching_factor
)));
}
}
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
return
0
;
return
0
;
}
}
...
@@ -52,7 +52,7 @@ jlong Java_org_rocksdb_HashLinkedListMemTableConfig_newMemTableFactoryHandle(
...
@@ -52,7 +52,7 @@ jlong Java_org_rocksdb_HashLinkedListMemTableConfig_newMemTableFactoryHandle(
static_cast
<
bool
>
(
jif_log_bucket_dist_when_flash
),
static_cast
<
bool
>
(
jif_log_bucket_dist_when_flash
),
static_cast
<
int32_t
>
(
jthreshold_use_skiplist
)));
static_cast
<
int32_t
>
(
jthreshold_use_skiplist
)));
}
}
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
!
statusBucketCount
.
ok
()
?
statusBucketCount
:
statusHugePageTlb
);
!
statusBucketCount
.
ok
()
?
statusBucketCount
:
statusHugePageTlb
);
return
0
;
return
0
;
}
}
...
@@ -69,7 +69,7 @@ jlong Java_org_rocksdb_VectorMemTableConfig_newMemTableFactoryHandle(
...
@@ -69,7 +69,7 @@ jlong Java_org_rocksdb_VectorMemTableConfig_newMemTableFactoryHandle(
return
reinterpret_cast
<
jlong
>
(
new
rocksdb
::
VectorRepFactory
(
return
reinterpret_cast
<
jlong
>
(
new
rocksdb
::
VectorRepFactory
(
static_cast
<
size_t
>
(
jreserved_size
)));
static_cast
<
size_t
>
(
jreserved_size
)));
}
}
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
return
0
;
return
0
;
}
}
...
@@ -85,6 +85,6 @@ jlong Java_org_rocksdb_SkipListMemTableConfig_newMemTableFactoryHandle0(
...
@@ -85,6 +85,6 @@ jlong Java_org_rocksdb_SkipListMemTableConfig_newMemTableFactoryHandle0(
return
reinterpret_cast
<
jlong
>
(
new
rocksdb
::
SkipListFactory
(
return
reinterpret_cast
<
jlong
>
(
new
rocksdb
::
SkipListFactory
(
static_cast
<
size_t
>
(
jlookahead
)));
static_cast
<
size_t
>
(
jlookahead
)));
}
}
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
return
0
;
return
0
;
}
}
java/rocksjni/options.cc
浏览文件 @
51da3aab
...
@@ -189,7 +189,7 @@ void Java_org_rocksdb_Options_setWriteBufferSize(
...
@@ -189,7 +189,7 @@ void Java_org_rocksdb_Options_setWriteBufferSize(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
write_buffer_size
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
write_buffer_size
=
jwrite_buffer_size
;
jwrite_buffer_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -519,7 +519,7 @@ void Java_org_rocksdb_Options_setMaxLogFileSize(
...
@@ -519,7 +519,7 @@ void Java_org_rocksdb_Options_setMaxLogFileSize(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
max_log_file_size
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
max_log_file_size
=
max_log_file_size
;
max_log_file_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -546,7 +546,7 @@ void Java_org_rocksdb_Options_setLogFileTimeToRoll(
...
@@ -546,7 +546,7 @@ void Java_org_rocksdb_Options_setLogFileTimeToRoll(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
log_file_time_to_roll
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
log_file_time_to_roll
=
log_file_time_to_roll
;
log_file_time_to_roll
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -572,7 +572,7 @@ void Java_org_rocksdb_Options_setKeepLogFileNum(
...
@@ -572,7 +572,7 @@ void Java_org_rocksdb_Options_setKeepLogFileNum(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
keep_log_file_num
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
keep_log_file_num
=
keep_log_file_num
;
keep_log_file_num
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -792,7 +792,7 @@ void Java_org_rocksdb_Options_setManifestPreallocationSize(
...
@@ -792,7 +792,7 @@ void Java_org_rocksdb_Options_setManifestPreallocationSize(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
manifest_preallocation_size
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
manifest_preallocation_size
=
preallocation_size
;
preallocation_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -1472,7 +1472,7 @@ void Java_org_rocksdb_Options_setArenaBlockSize(
...
@@ -1472,7 +1472,7 @@ void Java_org_rocksdb_Options_setArenaBlockSize(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
arena_block_size
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
arena_block_size
=
jarena_block_size
;
jarena_block_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -1642,7 +1642,7 @@ void Java_org_rocksdb_Options_setInplaceUpdateNumLocks(
...
@@ -1642,7 +1642,7 @@ void Java_org_rocksdb_Options_setInplaceUpdateNumLocks(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
inplace_update_num_locks
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
inplace_update_num_locks
=
jinplace_update_num_locks
;
jinplace_update_num_locks
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -1739,7 +1739,7 @@ void Java_org_rocksdb_Options_setMaxSuccessiveMerges(
...
@@ -1739,7 +1739,7 @@ void Java_org_rocksdb_Options_setMaxSuccessiveMerges(
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
max_successive_merges
=
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
max_successive_merges
=
jmax_successive_merges
;
jmax_successive_merges
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -1989,7 +1989,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setWriteBufferSize(
...
@@ -1989,7 +1989,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setWriteBufferSize(
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
write_buffer_size
=
jwrite_buffer_size
;
write_buffer_size
=
jwrite_buffer_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -2564,7 +2564,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setArenaBlockSize(
...
@@ -2564,7 +2564,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setArenaBlockSize(
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
arena_block_size
=
jarena_block_size
;
arena_block_size
=
jarena_block_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -2735,7 +2735,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setInplaceUpdateNumLocks(
...
@@ -2735,7 +2735,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setInplaceUpdateNumLocks(
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
inplace_update_num_locks
=
jinplace_update_num_locks
;
inplace_update_num_locks
=
jinplace_update_num_locks
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -2834,7 +2834,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setMaxSuccessiveMerges(
...
@@ -2834,7 +2834,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setMaxSuccessiveMerges(
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
reinterpret_cast
<
rocksdb
::
ColumnFamilyOptions
*>
(
jhandle
)
->
max_successive_merges
=
jmax_successive_merges
;
max_successive_merges
=
jmax_successive_merges
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -3312,7 +3312,7 @@ void Java_org_rocksdb_DBOptions_setMaxLogFileSize(
...
@@ -3312,7 +3312,7 @@ void Java_org_rocksdb_DBOptions_setMaxLogFileSize(
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
max_log_file_size
=
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
max_log_file_size
=
max_log_file_size
;
max_log_file_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -3339,7 +3339,7 @@ void Java_org_rocksdb_DBOptions_setLogFileTimeToRoll(
...
@@ -3339,7 +3339,7 @@ void Java_org_rocksdb_DBOptions_setLogFileTimeToRoll(
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
log_file_time_to_roll
=
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
log_file_time_to_roll
=
log_file_time_to_roll
;
log_file_time_to_roll
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -3365,7 +3365,7 @@ void Java_org_rocksdb_DBOptions_setKeepLogFileNum(
...
@@ -3365,7 +3365,7 @@ void Java_org_rocksdb_DBOptions_setKeepLogFileNum(
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
keep_log_file_num
=
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
keep_log_file_num
=
keep_log_file_num
;
keep_log_file_num
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
@@ -3498,7 +3498,7 @@ void Java_org_rocksdb_DBOptions_setManifestPreallocationSize(
...
@@ -3498,7 +3498,7 @@ void Java_org_rocksdb_DBOptions_setManifestPreallocationSize(
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
manifest_preallocation_size
=
preallocation_size
;
manifest_preallocation_size
=
preallocation_size
;
}
else
{
}
else
{
rocksdb
::
RocksDB
ExceptionJni
::
ThrowNew
(
env
,
s
);
rocksdb
::
IllegalArgument
ExceptionJni
::
ThrowNew
(
env
,
s
);
}
}
}
}
...
...
java/rocksjni/portal.h
浏览文件 @
51da3aab
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
namespace
rocksdb
{
namespace
rocksdb
{
//
d
etect if jlong overflows size_t
//
D
etect if jlong overflows size_t
inline
Status
check_if_jlong_fits_size_t
(
const
jlong
&
jvalue
)
{
inline
Status
check_if_jlong_fits_size_t
(
const
jlong
&
jvalue
)
{
Status
s
=
Status
::
OK
();
Status
s
=
Status
::
OK
();
if
(
static_cast
<
uint64_t
>
(
jvalue
)
>
std
::
numeric_limits
<
size_t
>::
max
())
{
if
(
static_cast
<
uint64_t
>
(
jvalue
)
>
std
::
numeric_limits
<
size_t
>::
max
())
{
...
@@ -68,27 +68,18 @@ template<class PTR, class DERIVED> class RocksDBNativeClass {
...
@@ -68,27 +68,18 @@ template<class PTR, class DERIVED> class RocksDBNativeClass {
}
}
};
};
// The portal class for org.rocksdb.RocksDB
// Java Exception template
class
RocksDBJni
:
public
RocksDBNativeClass
<
rocksdb
::
DB
*
,
RocksDBJni
>
{
template
<
class
DERIVED
>
class
RocksDBJavaException
{
public:
// Get the java class id of org.rocksdb.RocksDB.
static
jclass
getJClass
(
JNIEnv
*
env
)
{
return
RocksDBNativeClass
::
getJClass
(
env
,
"org/rocksdb/RocksDB"
);
}
};
// The portal class for org.rocksdb.RocksDBException
class
RocksDBExceptionJni
{
public:
public:
// Get the j
class of org.rocksdb.RocksDBException
// Get the j
ava class id
static
jclass
getJClass
(
JNIEnv
*
env
)
{
static
jclass
getJClass
(
JNIEnv
*
env
,
const
char
*
jclazz_name
)
{
jclass
jclazz
=
env
->
FindClass
(
"org/rocksdb/RocksDBException"
);
jclass
jclazz
=
env
->
FindClass
(
jclazz_name
);
assert
(
jclazz
!=
nullptr
);
assert
(
jclazz
!=
nullptr
);
return
jclazz
;
return
jclazz
;
}
}
// Create and throw a java exception by converting the input
// Create and throw a java exception by converting the input
// Status
to an RocksDBException
.
// Status.
//
//
// In case s.ok() is true, then this function will not throw any
// In case s.ok() is true, then this function will not throw any
// exception.
// exception.
...
@@ -99,13 +90,46 @@ class RocksDBExceptionJni {
...
@@ -99,13 +90,46 @@ class RocksDBExceptionJni {
jstring
msg
=
env
->
NewStringUTF
(
s
.
ToString
().
c_str
());
jstring
msg
=
env
->
NewStringUTF
(
s
.
ToString
().
c_str
());
// get the constructor id of org.rocksdb.RocksDBException
// get the constructor id of org.rocksdb.RocksDBException
static
jmethodID
mid
=
env
->
GetMethodID
(
static
jmethodID
mid
=
env
->
GetMethodID
(
getJClass
(
env
),
"<init>"
,
"(Ljava/lang/String;)V"
);
DERIVED
::
getJClass
(
env
),
"<init>"
,
"(Ljava/lang/String;)V"
);
assert
(
mid
!=
nullptr
);
assert
(
mid
!=
nullptr
);
env
->
Throw
((
jthrowable
)
env
->
NewObject
(
getJClass
(
env
),
mid
,
msg
));
env
->
Throw
((
jthrowable
)
env
->
NewObject
(
DERIVED
::
getJClass
(
env
),
mid
,
msg
));
}
}
};
};
// The portal class for org.rocksdb.RocksDB
class
RocksDBJni
:
public
RocksDBNativeClass
<
rocksdb
::
DB
*
,
RocksDBJni
>
{
public:
// Get the java class id of org.rocksdb.RocksDB.
static
jclass
getJClass
(
JNIEnv
*
env
)
{
return
RocksDBNativeClass
::
getJClass
(
env
,
"org/rocksdb/RocksDB"
);
}
};
// The portal class for org.rocksdb.RocksDBException
class
RocksDBExceptionJni
:
public
RocksDBJavaException
<
RocksDBExceptionJni
>
{
public:
// Get the java class id of java.lang.IllegalArgumentException
static
jclass
getJClass
(
JNIEnv
*
env
)
{
return
RocksDBJavaException
::
getJClass
(
env
,
"org/rocksdb/RocksDBException"
);
}
};
// The portal class for java.lang.IllegalArgumentException
class
IllegalArgumentExceptionJni
:
public
RocksDBJavaException
<
IllegalArgumentExceptionJni
>
{
public:
// Get the java class id of java.lang.IllegalArgumentException
static
jclass
getJClass
(
JNIEnv
*
env
)
{
return
RocksDBJavaException
::
getJClass
(
env
,
"java/lang/IllegalArgumentException"
);
}
};
// The portal class for org.rocksdb.Options
// The portal class for org.rocksdb.Options
class
OptionsJni
:
public
RocksDBNativeClass
<
class
OptionsJni
:
public
RocksDBNativeClass
<
rocksdb
::
Options
*
,
OptionsJni
>
{
rocksdb
::
Options
*
,
OptionsJni
>
{
...
...
java/samples/src/main/java/RocksDBSample.java
浏览文件 @
51da3aab
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// LICENSE file in the root directory of this source tree. An additional grant
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
// of patent rights can be found in the PATENTS file in the same directory.
import
java.lang.IllegalArgumentException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -43,7 +44,7 @@ public class RocksDBSample {
...
@@ -43,7 +44,7 @@ public class RocksDBSample {
.
setMaxBackgroundCompactions
(
10
)
.
setMaxBackgroundCompactions
(
10
)
.
setCompressionType
(
CompressionType
.
SNAPPY_COMPRESSION
)
.
setCompressionType
(
CompressionType
.
SNAPPY_COMPRESSION
)
.
setCompactionStyle
(
CompactionStyle
.
UNIVERSAL
);
.
setCompactionStyle
(
CompactionStyle
.
UNIVERSAL
);
}
catch
(
RocksDB
Exception
e
)
{
}
catch
(
IllegalArgument
Exception
e
)
{
assert
(
false
);
assert
(
false
);
}
}
...
...
java/src/main/java/org/rocksdb/ColumnFamilyOptions.java
浏览文件 @
51da3aab
...
@@ -144,8 +144,7 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -144,8 +144,7 @@ public class ColumnFamilyOptions extends RocksObject
}
}
@Override
@Override
public
ColumnFamilyOptions
setWriteBufferSize
(
final
long
writeBufferSize
)
public
ColumnFamilyOptions
setWriteBufferSize
(
final
long
writeBufferSize
)
{
throws
RocksDBException
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setWriteBufferSize
(
nativeHandle_
,
writeBufferSize
);
setWriteBufferSize
(
nativeHandle_
,
writeBufferSize
);
return
this
;
return
this
;
...
@@ -396,8 +395,7 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -396,8 +395,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override
@Override
public
ColumnFamilyOptions
setArenaBlockSize
(
public
ColumnFamilyOptions
setArenaBlockSize
(
final
long
arenaBlockSize
)
final
long
arenaBlockSize
)
{
throws
RocksDBException
{
setArenaBlockSize
(
nativeHandle_
,
arenaBlockSize
);
setArenaBlockSize
(
nativeHandle_
,
arenaBlockSize
);
return
this
;
return
this
;
}
}
...
@@ -483,7 +481,7 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -483,7 +481,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override
@Override
public
ColumnFamilyOptions
setMemTableConfig
(
public
ColumnFamilyOptions
setMemTableConfig
(
final
MemTableConfig
config
)
throws
RocksDBException
{
final
MemTableConfig
config
)
{
memTableConfig_
=
config
;
memTableConfig_
=
config
;
setMemTableFactory
(
nativeHandle_
,
config
.
newMemTableFactoryHandle
());
setMemTableFactory
(
nativeHandle_
,
config
.
newMemTableFactoryHandle
());
return
this
;
return
this
;
...
@@ -523,8 +521,7 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -523,8 +521,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override
@Override
public
ColumnFamilyOptions
setInplaceUpdateNumLocks
(
public
ColumnFamilyOptions
setInplaceUpdateNumLocks
(
final
long
inplaceUpdateNumLocks
)
final
long
inplaceUpdateNumLocks
)
{
throws
RocksDBException
{
setInplaceUpdateNumLocks
(
nativeHandle_
,
inplaceUpdateNumLocks
);
setInplaceUpdateNumLocks
(
nativeHandle_
,
inplaceUpdateNumLocks
);
return
this
;
return
this
;
}
}
...
@@ -571,7 +568,7 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -571,7 +568,7 @@ public class ColumnFamilyOptions extends RocksObject
@Override
@Override
public
ColumnFamilyOptions
setMaxSuccessiveMerges
(
public
ColumnFamilyOptions
setMaxSuccessiveMerges
(
final
long
maxSuccessiveMerges
)
throws
RocksDBException
{
final
long
maxSuccessiveMerges
)
{
setMaxSuccessiveMerges
(
nativeHandle_
,
maxSuccessiveMerges
);
setMaxSuccessiveMerges
(
nativeHandle_
,
maxSuccessiveMerges
);
return
this
;
return
this
;
}
}
...
@@ -644,7 +641,7 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -644,7 +641,7 @@ public class ColumnFamilyOptions extends RocksObject
private
native
void
setMergeOperator
(
private
native
void
setMergeOperator
(
long
handle
,
long
mergeOperatorHandle
);
long
handle
,
long
mergeOperatorHandle
);
private
native
void
setWriteBufferSize
(
long
handle
,
long
writeBufferSize
)
private
native
void
setWriteBufferSize
(
long
handle
,
long
writeBufferSize
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
native
long
writeBufferSize
(
long
handle
);
private
native
long
writeBufferSize
(
long
handle
);
private
native
void
setMaxWriteBufferNumber
(
private
native
void
setMaxWriteBufferNumber
(
long
handle
,
int
maxWriteBufferNumber
);
long
handle
,
int
maxWriteBufferNumber
);
...
@@ -706,7 +703,8 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -706,7 +703,8 @@ public class ColumnFamilyOptions extends RocksObject
long
handle
,
int
rateLimitDelayMaxMilliseconds
);
long
handle
,
int
rateLimitDelayMaxMilliseconds
);
private
native
int
rateLimitDelayMaxMilliseconds
(
long
handle
);
private
native
int
rateLimitDelayMaxMilliseconds
(
long
handle
);
private
native
void
setArenaBlockSize
(
private
native
void
setArenaBlockSize
(
long
handle
,
long
arenaBlockSize
)
throws
RocksDBException
;
long
handle
,
long
arenaBlockSize
)
throws
IllegalArgumentException
;
private
native
long
arenaBlockSize
(
long
handle
);
private
native
long
arenaBlockSize
(
long
handle
);
private
native
void
setDisableAutoCompactions
(
private
native
void
setDisableAutoCompactions
(
long
handle
,
boolean
disableAutoCompactions
);
long
handle
,
boolean
disableAutoCompactions
);
...
@@ -733,7 +731,8 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -733,7 +731,8 @@ public class ColumnFamilyOptions extends RocksObject
long
handle
,
boolean
inplaceUpdateSupport
);
long
handle
,
boolean
inplaceUpdateSupport
);
private
native
boolean
inplaceUpdateSupport
(
long
handle
);
private
native
boolean
inplaceUpdateSupport
(
long
handle
);
private
native
void
setInplaceUpdateNumLocks
(
private
native
void
setInplaceUpdateNumLocks
(
long
handle
,
long
inplaceUpdateNumLocks
)
throws
RocksDBException
;
long
handle
,
long
inplaceUpdateNumLocks
)
throws
IllegalArgumentException
;
private
native
long
inplaceUpdateNumLocks
(
long
handle
);
private
native
long
inplaceUpdateNumLocks
(
long
handle
);
private
native
void
setMemtablePrefixBloomBits
(
private
native
void
setMemtablePrefixBloomBits
(
long
handle
,
int
memtablePrefixBloomBits
);
long
handle
,
int
memtablePrefixBloomBits
);
...
@@ -745,7 +744,8 @@ public class ColumnFamilyOptions extends RocksObject
...
@@ -745,7 +744,8 @@ public class ColumnFamilyOptions extends RocksObject
long
handle
,
int
bloomLocality
);
long
handle
,
int
bloomLocality
);
private
native
int
bloomLocality
(
long
handle
);
private
native
int
bloomLocality
(
long
handle
);
private
native
void
setMaxSuccessiveMerges
(
private
native
void
setMaxSuccessiveMerges
(
long
handle
,
long
maxSuccessiveMerges
)
throws
RocksDBException
;
long
handle
,
long
maxSuccessiveMerges
)
throws
IllegalArgumentException
;
private
native
long
maxSuccessiveMerges
(
long
handle
);
private
native
long
maxSuccessiveMerges
(
long
handle
);
private
native
void
setMinPartialMergeOperands
(
private
native
void
setMinPartialMergeOperands
(
long
handle
,
int
minPartialMergeOperands
);
long
handle
,
int
minPartialMergeOperands
);
...
...
java/src/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java
浏览文件 @
51da3aab
...
@@ -152,11 +152,10 @@ public interface ColumnFamilyOptionsInterface {
...
@@ -152,11 +152,10 @@ public interface ColumnFamilyOptionsInterface {
* Default: 4MB
* Default: 4MB
* @param writeBufferSize the size of write buffer.
* @param writeBufferSize the size of write buffer.
* @return the instance of the current Object.
* @return the instance of the current Object.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setWriteBufferSize
(
long
writeBufferSize
)
Object
setWriteBufferSize
(
long
writeBufferSize
);
throws
RocksDBException
;
/**
/**
* Return size of write buffer size.
* Return size of write buffer size.
...
@@ -701,11 +700,10 @@ public interface ColumnFamilyOptionsInterface {
...
@@ -701,11 +700,10 @@ public interface ColumnFamilyOptionsInterface {
*
*
* @param arenaBlockSize the size of an arena block
* @param arenaBlockSize the size of an arena block
* @return the reference to the current option.
* @return the reference to the current option.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setArenaBlockSize
(
long
arenaBlockSize
)
Object
setArenaBlockSize
(
long
arenaBlockSize
);
throws
RocksDBException
;
/**
/**
* The size of one block in arena memory allocation.
* The size of one block in arena memory allocation.
...
@@ -850,11 +848,10 @@ public interface ColumnFamilyOptionsInterface {
...
@@ -850,11 +848,10 @@ public interface ColumnFamilyOptionsInterface {
*
*
* @param config the mem-table config.
* @param config the mem-table config.
* @return the instance of the current Object.
* @return the instance of the current Object.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setMemTableConfig
(
MemTableConfig
config
)
Object
setMemTableConfig
(
MemTableConfig
config
);
throws
RocksDBException
;
/**
/**
* Returns the name of the current mem table representation.
* Returns the name of the current mem table representation.
...
@@ -915,11 +912,10 @@ public interface ColumnFamilyOptionsInterface {
...
@@ -915,11 +912,10 @@ public interface ColumnFamilyOptionsInterface {
* @param inplaceUpdateNumLocks the number of locks used for
* @param inplaceUpdateNumLocks the number of locks used for
* inplace updates.
* inplace updates.
* @return the reference to the current option.
* @return the reference to the current option.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setInplaceUpdateNumLocks
(
long
inplaceUpdateNumLocks
)
Object
setInplaceUpdateNumLocks
(
long
inplaceUpdateNumLocks
);
throws
RocksDBException
;
/**
/**
* Number of locks used for inplace update
* Number of locks used for inplace update
...
@@ -1010,11 +1006,10 @@ public interface ColumnFamilyOptionsInterface {
...
@@ -1010,11 +1006,10 @@ public interface ColumnFamilyOptionsInterface {
*
*
* @param maxSuccessiveMerges the maximum number of successive merges.
* @param maxSuccessiveMerges the maximum number of successive merges.
* @return the reference to the current option.
* @return the reference to the current option.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setMaxSuccessiveMerges
(
long
maxSuccessiveMerges
)
Object
setMaxSuccessiveMerges
(
long
maxSuccessiveMerges
);
throws
RocksDBException
;
/**
/**
* Maximum number of successive merge operations on a key in the memtable.
* Maximum number of successive merge operations on a key in the memtable.
...
...
java/src/main/java/org/rocksdb/DBOptions.java
浏览文件 @
51da3aab
...
@@ -314,7 +314,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
...
@@ -314,7 +314,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
@Override
@Override
public
DBOptions
setMaxLogFileSize
(
public
DBOptions
setMaxLogFileSize
(
final
long
maxLogFileSize
)
throws
RocksDBException
{
final
long
maxLogFileSize
)
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setMaxLogFileSize
(
nativeHandle_
,
maxLogFileSize
);
setMaxLogFileSize
(
nativeHandle_
,
maxLogFileSize
);
return
this
;
return
this
;
...
@@ -328,7 +328,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
...
@@ -328,7 +328,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
@Override
@Override
public
DBOptions
setLogFileTimeToRoll
(
public
DBOptions
setLogFileTimeToRoll
(
final
long
logFileTimeToRoll
)
throws
RocksDBException
{
final
long
logFileTimeToRoll
)
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setLogFileTimeToRoll
(
nativeHandle_
,
logFileTimeToRoll
);
setLogFileTimeToRoll
(
nativeHandle_
,
logFileTimeToRoll
);
return
this
;
return
this
;
...
@@ -342,7 +342,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
...
@@ -342,7 +342,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
@Override
@Override
public
DBOptions
setKeepLogFileNum
(
public
DBOptions
setKeepLogFileNum
(
final
long
keepLogFileNum
)
throws
RocksDBException
{
final
long
keepLogFileNum
)
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setKeepLogFileNum
(
nativeHandle_
,
keepLogFileNum
);
setKeepLogFileNum
(
nativeHandle_
,
keepLogFileNum
);
return
this
;
return
this
;
...
@@ -426,7 +426,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
...
@@ -426,7 +426,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
@Override
@Override
public
DBOptions
setManifestPreallocationSize
(
public
DBOptions
setManifestPreallocationSize
(
final
long
size
)
throws
RocksDBException
{
final
long
size
)
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setManifestPreallocationSize
(
nativeHandle_
,
size
);
setManifestPreallocationSize
(
nativeHandle_
,
size
);
return
this
;
return
this
;
...
@@ -634,13 +634,13 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
...
@@ -634,13 +634,13 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
long
handle
,
int
maxBackgroundFlushes
);
long
handle
,
int
maxBackgroundFlushes
);
private
native
int
maxBackgroundFlushes
(
long
handle
);
private
native
int
maxBackgroundFlushes
(
long
handle
);
private
native
void
setMaxLogFileSize
(
long
handle
,
long
maxLogFileSize
)
private
native
void
setMaxLogFileSize
(
long
handle
,
long
maxLogFileSize
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
native
long
maxLogFileSize
(
long
handle
);
private
native
long
maxLogFileSize
(
long
handle
);
private
native
void
setLogFileTimeToRoll
(
private
native
void
setLogFileTimeToRoll
(
long
handle
,
long
logFileTimeToRoll
)
throws
RocksDB
Exception
;
long
handle
,
long
logFileTimeToRoll
)
throws
IllegalArgument
Exception
;
private
native
long
logFileTimeToRoll
(
long
handle
);
private
native
long
logFileTimeToRoll
(
long
handle
);
private
native
void
setKeepLogFileNum
(
long
handle
,
long
keepLogFileNum
)
private
native
void
setKeepLogFileNum
(
long
handle
,
long
keepLogFileNum
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
native
long
keepLogFileNum
(
long
handle
);
private
native
long
keepLogFileNum
(
long
handle
);
private
native
void
setMaxManifestFileSize
(
private
native
void
setMaxManifestFileSize
(
long
handle
,
long
maxManifestFileSize
);
long
handle
,
long
maxManifestFileSize
);
...
@@ -656,7 +656,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
...
@@ -656,7 +656,7 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
private
native
void
setWalSizeLimitMB
(
long
handle
,
long
sizeLimitMB
);
private
native
void
setWalSizeLimitMB
(
long
handle
,
long
sizeLimitMB
);
private
native
long
walSizeLimitMB
(
long
handle
);
private
native
long
walSizeLimitMB
(
long
handle
);
private
native
void
setManifestPreallocationSize
(
private
native
void
setManifestPreallocationSize
(
long
handle
,
long
size
)
throws
RocksDB
Exception
;
long
handle
,
long
size
)
throws
IllegalArgument
Exception
;
private
native
long
manifestPreallocationSize
(
long
handle
);
private
native
long
manifestPreallocationSize
(
long
handle
);
private
native
void
setAllowOsBuffer
(
private
native
void
setAllowOsBuffer
(
long
handle
,
boolean
allowOsBuffer
);
long
handle
,
boolean
allowOsBuffer
);
...
...
java/src/main/java/org/rocksdb/DBOptionsInterface.java
浏览文件 @
51da3aab
...
@@ -415,11 +415,10 @@ public interface DBOptionsInterface {
...
@@ -415,11 +415,10 @@ public interface DBOptionsInterface {
*
*
* @param maxLogFileSize the maximum size of a info log file.
* @param maxLogFileSize the maximum size of a info log file.
* @return the instance of the current Object.
* @return the instance of the current Object.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setMaxLogFileSize
(
long
maxLogFileSize
)
Object
setMaxLogFileSize
(
long
maxLogFileSize
);
throws
RocksDBException
;
/**
/**
* Returns the maximum size of a info log file. If the current log file
* Returns the maximum size of a info log file. If the current log file
...
@@ -438,11 +437,10 @@ public interface DBOptionsInterface {
...
@@ -438,11 +437,10 @@ public interface DBOptionsInterface {
*
*
* @param logFileTimeToRoll the time interval in seconds.
* @param logFileTimeToRoll the time interval in seconds.
* @return the instance of the current Object.
* @return the instance of the current Object.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setLogFileTimeToRoll
(
long
logFileTimeToRoll
)
Object
setLogFileTimeToRoll
(
long
logFileTimeToRoll
);
throws
RocksDBException
;
/**
/**
* Returns the time interval for the info log file to roll (in seconds).
* Returns the time interval for the info log file to roll (in seconds).
...
@@ -460,11 +458,10 @@ public interface DBOptionsInterface {
...
@@ -460,11 +458,10 @@ public interface DBOptionsInterface {
*
*
* @param keepLogFileNum the maximum number of info log files to be kept.
* @param keepLogFileNum the maximum number of info log files to be kept.
* @return the instance of the current Object.
* @return the instance of the current Object.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setKeepLogFileNum
(
long
keepLogFileNum
)
Object
setKeepLogFileNum
(
long
keepLogFileNum
);
throws
RocksDBException
;
/**
/**
* Returns the maximum number of info log files to be kept.
* Returns the maximum number of info log files to be kept.
...
@@ -638,11 +635,10 @@ public interface DBOptionsInterface {
...
@@ -638,11 +635,10 @@ public interface DBOptionsInterface {
*
*
* @param size the size in byte
* @param size the size in byte
* @return the instance of the current Object.
* @return the instance of the current Object.
* @throws
org.rocksdb.RocksDBException thrown on 32-Bit platforms while
* @throws
java.lang.IllegalArgumentException thrown on 32-Bit platforms
* overflowing the underlying platform specific value.
*
while
overflowing the underlying platform specific value.
*/
*/
Object
setManifestPreallocationSize
(
long
size
)
Object
setManifestPreallocationSize
(
long
size
);
throws
RocksDBException
;
/**
/**
* Number of bytes to preallocate (via fallocate) the manifest
* Number of bytes to preallocate (via fallocate) the manifest
...
...
java/src/main/java/org/rocksdb/HashLinkedListMemTableConfig.java
浏览文件 @
51da3aab
...
@@ -154,8 +154,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
...
@@ -154,8 +154,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
return
thresholdUseSkiplist_
;
return
thresholdUseSkiplist_
;
}
}
@Override
protected
long
newMemTableFactoryHandle
()
@Override
protected
long
newMemTableFactoryHandle
()
{
throws
RocksDBException
{
return
newMemTableFactoryHandle
(
bucketCount_
,
hugePageTlbSize_
,
return
newMemTableFactoryHandle
(
bucketCount_
,
hugePageTlbSize_
,
bucketEntriesLoggingThreshold_
,
ifLogBucketDistWhenFlush_
,
bucketEntriesLoggingThreshold_
,
ifLogBucketDistWhenFlush_
,
thresholdUseSkiplist_
);
thresholdUseSkiplist_
);
...
@@ -164,7 +163,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
...
@@ -164,7 +163,7 @@ public class HashLinkedListMemTableConfig extends MemTableConfig {
private
native
long
newMemTableFactoryHandle
(
long
bucketCount
,
private
native
long
newMemTableFactoryHandle
(
long
bucketCount
,
long
hugePageTlbSize
,
int
bucketEntriesLoggingThreshold
,
long
hugePageTlbSize
,
int
bucketEntriesLoggingThreshold
,
boolean
ifLogBucketDistWhenFlush
,
int
thresholdUseSkiplist
)
boolean
ifLogBucketDistWhenFlush
,
int
thresholdUseSkiplist
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
long
bucketCount_
;
private
long
bucketCount_
;
private
long
hugePageTlbSize_
;
private
long
hugePageTlbSize_
;
...
...
java/src/main/java/org/rocksdb/HashSkipListMemTableConfig.java
浏览文件 @
51da3aab
...
@@ -90,15 +90,14 @@ public class HashSkipListMemTableConfig extends MemTableConfig {
...
@@ -90,15 +90,14 @@ public class HashSkipListMemTableConfig extends MemTableConfig {
return
branchingFactor_
;
return
branchingFactor_
;
}
}
@Override
protected
long
newMemTableFactoryHandle
()
@Override
protected
long
newMemTableFactoryHandle
()
{
throws
RocksDBException
{
return
newMemTableFactoryHandle
(
return
newMemTableFactoryHandle
(
bucketCount_
,
height_
,
branchingFactor_
);
bucketCount_
,
height_
,
branchingFactor_
);
}
}
private
native
long
newMemTableFactoryHandle
(
private
native
long
newMemTableFactoryHandle
(
long
bucketCount
,
int
height
,
int
branchingFactor
)
long
bucketCount
,
int
height
,
int
branchingFactor
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
long
bucketCount_
;
private
long
bucketCount_
;
private
int
branchingFactor_
;
private
int
branchingFactor_
;
...
...
java/src/main/java/org/rocksdb/MemTableConfig.java
浏览文件 @
51da3aab
...
@@ -24,10 +24,6 @@ public abstract class MemTableConfig {
...
@@ -24,10 +24,6 @@ public abstract class MemTableConfig {
* @see Options#setMemTableConfig(MemTableConfig)
* @see Options#setMemTableConfig(MemTableConfig)
*
*
* @return native handle address to native memory table instance.
* @return native handle address to native memory table instance.
*
* @throws RocksDBException thrown if error happens in underlying
* native library.
*/
*/
abstract
protected
long
newMemTableFactoryHandle
()
abstract
protected
long
newMemTableFactoryHandle
();
throws
RocksDBException
;
}
}
java/src/main/java/org/rocksdb/Options.java
浏览文件 @
51da3aab
...
@@ -190,8 +190,7 @@ public class Options extends RocksObject
...
@@ -190,8 +190,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setWriteBufferSize
(
final
long
writeBufferSize
)
public
Options
setWriteBufferSize
(
final
long
writeBufferSize
)
{
throws
RocksDBException
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setWriteBufferSize
(
nativeHandle_
,
writeBufferSize
);
setWriteBufferSize
(
nativeHandle_
,
writeBufferSize
);
return
this
;
return
this
;
...
@@ -389,8 +388,7 @@ public class Options extends RocksObject
...
@@ -389,8 +388,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setMaxLogFileSize
(
final
long
maxLogFileSize
)
public
Options
setMaxLogFileSize
(
final
long
maxLogFileSize
)
{
throws
RocksDBException
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setMaxLogFileSize
(
nativeHandle_
,
maxLogFileSize
);
setMaxLogFileSize
(
nativeHandle_
,
maxLogFileSize
);
return
this
;
return
this
;
...
@@ -403,8 +401,7 @@ public class Options extends RocksObject
...
@@ -403,8 +401,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setLogFileTimeToRoll
(
final
long
logFileTimeToRoll
)
public
Options
setLogFileTimeToRoll
(
final
long
logFileTimeToRoll
)
{
throws
RocksDBException
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setLogFileTimeToRoll
(
nativeHandle_
,
logFileTimeToRoll
);
setLogFileTimeToRoll
(
nativeHandle_
,
logFileTimeToRoll
);
return
this
;
return
this
;
...
@@ -417,8 +414,7 @@ public class Options extends RocksObject
...
@@ -417,8 +414,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setKeepLogFileNum
(
final
long
keepLogFileNum
)
public
Options
setKeepLogFileNum
(
final
long
keepLogFileNum
)
{
throws
RocksDBException
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setKeepLogFileNum
(
nativeHandle_
,
keepLogFileNum
);
setKeepLogFileNum
(
nativeHandle_
,
keepLogFileNum
);
return
this
;
return
this
;
...
@@ -499,8 +495,7 @@ public class Options extends RocksObject
...
@@ -499,8 +495,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setManifestPreallocationSize
(
final
long
size
)
public
Options
setManifestPreallocationSize
(
final
long
size
)
{
throws
RocksDBException
{
assert
(
isInitialized
());
assert
(
isInitialized
());
setManifestPreallocationSize
(
nativeHandle_
,
size
);
setManifestPreallocationSize
(
nativeHandle_
,
size
);
return
this
;
return
this
;
...
@@ -624,8 +619,7 @@ public class Options extends RocksObject
...
@@ -624,8 +619,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setMemTableConfig
(
final
MemTableConfig
config
)
public
Options
setMemTableConfig
(
final
MemTableConfig
config
)
{
throws
RocksDBException
{
memTableConfig_
=
config
;
memTableConfig_
=
config
;
setMemTableFactory
(
nativeHandle_
,
config
.
newMemTableFactoryHandle
());
setMemTableFactory
(
nativeHandle_
,
config
.
newMemTableFactoryHandle
());
return
this
;
return
this
;
...
@@ -901,8 +895,7 @@ public class Options extends RocksObject
...
@@ -901,8 +895,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setArenaBlockSize
(
final
long
arenaBlockSize
)
public
Options
setArenaBlockSize
(
final
long
arenaBlockSize
)
{
throws
RocksDBException
{
setArenaBlockSize
(
nativeHandle_
,
arenaBlockSize
);
setArenaBlockSize
(
nativeHandle_
,
arenaBlockSize
);
return
this
;
return
this
;
}
}
...
@@ -988,7 +981,7 @@ public class Options extends RocksObject
...
@@ -988,7 +981,7 @@ public class Options extends RocksObject
@Override
@Override
public
Options
setInplaceUpdateNumLocks
(
public
Options
setInplaceUpdateNumLocks
(
final
long
inplaceUpdateNumLocks
)
throws
RocksDBException
{
final
long
inplaceUpdateNumLocks
)
{
setInplaceUpdateNumLocks
(
nativeHandle_
,
inplaceUpdateNumLocks
);
setInplaceUpdateNumLocks
(
nativeHandle_
,
inplaceUpdateNumLocks
);
return
this
;
return
this
;
}
}
...
@@ -1034,8 +1027,7 @@ public class Options extends RocksObject
...
@@ -1034,8 +1027,7 @@ public class Options extends RocksObject
}
}
@Override
@Override
public
Options
setMaxSuccessiveMerges
(
long
maxSuccessiveMerges
)
public
Options
setMaxSuccessiveMerges
(
long
maxSuccessiveMerges
)
{
throws
RocksDBException
{
setMaxSuccessiveMerges
(
nativeHandle_
,
maxSuccessiveMerges
);
setMaxSuccessiveMerges
(
nativeHandle_
,
maxSuccessiveMerges
);
return
this
;
return
this
;
}
}
...
@@ -1135,13 +1127,13 @@ public class Options extends RocksObject
...
@@ -1135,13 +1127,13 @@ public class Options extends RocksObject
long
handle
,
int
maxBackgroundFlushes
);
long
handle
,
int
maxBackgroundFlushes
);
private
native
int
maxBackgroundFlushes
(
long
handle
);
private
native
int
maxBackgroundFlushes
(
long
handle
);
private
native
void
setMaxLogFileSize
(
long
handle
,
long
maxLogFileSize
)
private
native
void
setMaxLogFileSize
(
long
handle
,
long
maxLogFileSize
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
native
long
maxLogFileSize
(
long
handle
);
private
native
long
maxLogFileSize
(
long
handle
);
private
native
void
setLogFileTimeToRoll
(
private
native
void
setLogFileTimeToRoll
(
long
handle
,
long
logFileTimeToRoll
)
throws
RocksDB
Exception
;
long
handle
,
long
logFileTimeToRoll
)
throws
IllegalArgument
Exception
;
private
native
long
logFileTimeToRoll
(
long
handle
);
private
native
long
logFileTimeToRoll
(
long
handle
);
private
native
void
setKeepLogFileNum
(
long
handle
,
long
keepLogFileNum
)
private
native
void
setKeepLogFileNum
(
long
handle
,
long
keepLogFileNum
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
native
long
keepLogFileNum
(
long
handle
);
private
native
long
keepLogFileNum
(
long
handle
);
private
native
void
setMaxManifestFileSize
(
private
native
void
setMaxManifestFileSize
(
long
handle
,
long
maxManifestFileSize
);
long
handle
,
long
maxManifestFileSize
);
...
@@ -1157,7 +1149,7 @@ public class Options extends RocksObject
...
@@ -1157,7 +1149,7 @@ public class Options extends RocksObject
private
native
void
setWalSizeLimitMB
(
long
handle
,
long
sizeLimitMB
);
private
native
void
setWalSizeLimitMB
(
long
handle
,
long
sizeLimitMB
);
private
native
long
walSizeLimitMB
(
long
handle
);
private
native
long
walSizeLimitMB
(
long
handle
);
private
native
void
setManifestPreallocationSize
(
private
native
void
setManifestPreallocationSize
(
long
handle
,
long
size
)
throws
RocksDB
Exception
;
long
handle
,
long
size
)
throws
IllegalArgument
Exception
;
private
native
long
manifestPreallocationSize
(
long
handle
);
private
native
long
manifestPreallocationSize
(
long
handle
);
private
native
void
setAllowOsBuffer
(
private
native
void
setAllowOsBuffer
(
long
handle
,
boolean
allowOsBuffer
);
long
handle
,
boolean
allowOsBuffer
);
...
@@ -1200,7 +1192,7 @@ public class Options extends RocksObject
...
@@ -1200,7 +1192,7 @@ public class Options extends RocksObject
private
native
void
setMergeOperator
(
private
native
void
setMergeOperator
(
long
handle
,
long
mergeOperatorHandle
);
long
handle
,
long
mergeOperatorHandle
);
private
native
void
setWriteBufferSize
(
long
handle
,
long
writeBufferSize
)
private
native
void
setWriteBufferSize
(
long
handle
,
long
writeBufferSize
)
throws
RocksDB
Exception
;
throws
IllegalArgument
Exception
;
private
native
long
writeBufferSize
(
long
handle
);
private
native
long
writeBufferSize
(
long
handle
);
private
native
void
setMaxWriteBufferNumber
(
private
native
void
setMaxWriteBufferNumber
(
long
handle
,
int
maxWriteBufferNumber
);
long
handle
,
int
maxWriteBufferNumber
);
...
@@ -1262,7 +1254,7 @@ public class Options extends RocksObject
...
@@ -1262,7 +1254,7 @@ public class Options extends RocksObject
long
handle
,
int
rateLimitDelayMaxMilliseconds
);
long
handle
,
int
rateLimitDelayMaxMilliseconds
);
private
native
int
rateLimitDelayMaxMilliseconds
(
long
handle
);
private
native
int
rateLimitDelayMaxMilliseconds
(
long
handle
);
private
native
void
setArenaBlockSize
(
private
native
void
setArenaBlockSize
(
long
handle
,
long
arenaBlockSize
)
throws
RocksDB
Exception
;
long
handle
,
long
arenaBlockSize
)
throws
IllegalArgument
Exception
;
private
native
long
arenaBlockSize
(
long
handle
);
private
native
long
arenaBlockSize
(
long
handle
);
private
native
void
setDisableAutoCompactions
(
private
native
void
setDisableAutoCompactions
(
long
handle
,
boolean
disableAutoCompactions
);
long
handle
,
boolean
disableAutoCompactions
);
...
@@ -1289,7 +1281,8 @@ public class Options extends RocksObject
...
@@ -1289,7 +1281,8 @@ public class Options extends RocksObject
long
handle
,
boolean
inplaceUpdateSupport
);
long
handle
,
boolean
inplaceUpdateSupport
);
private
native
boolean
inplaceUpdateSupport
(
long
handle
);
private
native
boolean
inplaceUpdateSupport
(
long
handle
);
private
native
void
setInplaceUpdateNumLocks
(
private
native
void
setInplaceUpdateNumLocks
(
long
handle
,
long
inplaceUpdateNumLocks
)
throws
RocksDBException
;
long
handle
,
long
inplaceUpdateNumLocks
)
throws
IllegalArgumentException
;
private
native
long
inplaceUpdateNumLocks
(
long
handle
);
private
native
long
inplaceUpdateNumLocks
(
long
handle
);
private
native
void
setMemtablePrefixBloomBits
(
private
native
void
setMemtablePrefixBloomBits
(
long
handle
,
int
memtablePrefixBloomBits
);
long
handle
,
int
memtablePrefixBloomBits
);
...
@@ -1301,7 +1294,8 @@ public class Options extends RocksObject
...
@@ -1301,7 +1294,8 @@ public class Options extends RocksObject
long
handle
,
int
bloomLocality
);
long
handle
,
int
bloomLocality
);
private
native
int
bloomLocality
(
long
handle
);
private
native
int
bloomLocality
(
long
handle
);
private
native
void
setMaxSuccessiveMerges
(
private
native
void
setMaxSuccessiveMerges
(
long
handle
,
long
maxSuccessiveMerges
)
throws
RocksDBException
;
long
handle
,
long
maxSuccessiveMerges
)
throws
IllegalArgumentException
;
private
native
long
maxSuccessiveMerges
(
long
handle
);
private
native
long
maxSuccessiveMerges
(
long
handle
);
private
native
void
setMinPartialMergeOperands
(
private
native
void
setMinPartialMergeOperands
(
long
handle
,
int
minPartialMergeOperands
);
long
handle
,
int
minPartialMergeOperands
);
...
...
java/src/main/java/org/rocksdb/SkipListMemTableConfig.java
浏览文件 @
51da3aab
...
@@ -43,7 +43,8 @@ public class SkipListMemTableConfig extends MemTableConfig {
...
@@ -43,7 +43,8 @@ public class SkipListMemTableConfig extends MemTableConfig {
return
newMemTableFactoryHandle0
(
lookahead_
);
return
newMemTableFactoryHandle0
(
lookahead_
);
}
}
private
native
long
newMemTableFactoryHandle0
(
long
lookahead
);
private
native
long
newMemTableFactoryHandle0
(
long
lookahead
)
throws
IllegalArgumentException
;
private
long
lookahead_
;
private
long
lookahead_
;
}
}
java/src/main/java/org/rocksdb/VectorMemTableConfig.java
浏览文件 @
51da3aab
...
@@ -39,6 +39,7 @@ public class VectorMemTableConfig extends MemTableConfig {
...
@@ -39,6 +39,7 @@ public class VectorMemTableConfig extends MemTableConfig {
return
newMemTableFactoryHandle
(
reservedSize_
);
return
newMemTableFactoryHandle
(
reservedSize_
);
}
}
private
native
long
newMemTableFactoryHandle
(
long
reservedSize
);
private
native
long
newMemTableFactoryHandle
(
long
reservedSize
)
throws
IllegalArgumentException
;
private
int
reservedSize_
;
private
int
reservedSize_
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录