Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
indiff7643
Terarkdb
提交
ebdfe34c
T
Terarkdb
项目概览
indiff7643
/
Terarkdb
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Terarkdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ebdfe34c
编写于
6月 14, 2016
作者:
A
Adam Retter
提交者:
krad
8月 11, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Exposed further Java API options for controlling compaction
上级
d1be5946
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
229 addition
and
0 deletion
+229
-0
java/rocksjni/options.cc
java/rocksjni/options.cc
+88
-0
java/src/main/java/org/rocksdb/DBOptions.java
java/src/main/java/org/rocksdb/DBOptions.java
+30
-0
java/src/main/java/org/rocksdb/DBOptionsInterface.java
java/src/main/java/org/rocksdb/DBOptionsInterface.java
+41
-0
java/src/main/java/org/rocksdb/Options.java
java/src/main/java/org/rocksdb/Options.java
+30
-0
java/src/test/java/org/rocksdb/DBOptionsTest.java
java/src/test/java/org/rocksdb/DBOptionsTest.java
+20
-0
java/src/test/java/org/rocksdb/OptionsTest.java
java/src/test/java/org/rocksdb/OptionsTest.java
+20
-0
未找到文件。
java/rocksjni/options.cc
浏览文件 @
ebdfe34c
...
...
@@ -453,6 +453,28 @@ void Java_org_rocksdb_Options_setDeleteObsoleteFilesPeriodMicros(
static_cast
<
int64_t
>
(
micros
);
}
/*
* Class: org_rocksdb_Options
* Method: setBaseBackgroundCompactions
* Signature: (JI)V
*/
void
Java_org_rocksdb_Options_setBaseBackgroundCompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
,
jint
max
)
{
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
base_background_compactions
=
static_cast
<
int
>
(
max
);
}
/*
* Class: org_rocksdb_Options
* Method: baseBackgroundCompactions
* Signature: (J)I
*/
jint
Java_org_rocksdb_Options_baseBackgroundCompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
)
{
return
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
base_background_compactions
;
}
/*
* Class: org_rocksdb_Options
* Method: maxBackgroundCompactions
...
...
@@ -475,6 +497,28 @@ void Java_org_rocksdb_Options_setMaxBackgroundCompactions(
->
max_background_compactions
=
static_cast
<
int
>
(
max
);
}
/*
* Class: org_rocksdb_Options
* Method: setMaxSubcompactions
* Signature: (JI)V
*/
void
Java_org_rocksdb_Options_setMaxSubcompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
,
jint
max
)
{
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
max_subcompactions
=
static_cast
<
int32_t
>
(
max
);
}
/*
* Class: org_rocksdb_Options
* Method: maxSubcompactions
* Signature: (J)I
*/
jint
Java_org_rocksdb_Options_maxSubcompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
)
{
return
reinterpret_cast
<
rocksdb
::
Options
*>
(
jhandle
)
->
max_subcompactions
;
}
/*
* Class: org_rocksdb_Options
* Method: maxBackgroundFlushes
...
...
@@ -3769,6 +3813,28 @@ jlong Java_org_rocksdb_DBOptions_deleteObsoleteFilesPeriodMicros(
->
delete_obsolete_files_period_micros
;
}
/*
* Class: org_rocksdb_DBOptions
* Method: setBaseBackgroundCompactions
* Signature: (JI)V
*/
void
Java_org_rocksdb_DBOptions_setBaseBackgroundCompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
,
jint
max
)
{
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
base_background_compactions
=
static_cast
<
int
>
(
max
);
}
/*
* Class: org_rocksdb_DBOptions
* Method: baseBackgroundCompactions
* Signature: (J)I
*/
jint
Java_org_rocksdb_DBOptions_baseBackgroundCompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
)
{
return
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
base_background_compactions
;
}
/*
* Class: org_rocksdb_DBOptions
* Method: setMaxBackgroundCompactions
...
...
@@ -3791,6 +3857,28 @@ jint Java_org_rocksdb_DBOptions_maxBackgroundCompactions(
jhandle
)
->
max_background_compactions
;
}
/*
* Class: org_rocksdb_DBOptions
* Method: setMaxSubcompactions
* Signature: (JI)V
*/
void
Java_org_rocksdb_DBOptions_setMaxSubcompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
,
jint
max
)
{
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
max_subcompactions
=
static_cast
<
int32_t
>
(
max
);
}
/*
* Class: org_rocksdb_DBOptions
* Method: maxSubcompactions
* Signature: (J)I
*/
jint
Java_org_rocksdb_DBOptions_maxSubcompactions
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
jhandle
)
{
return
reinterpret_cast
<
rocksdb
::
DBOptions
*>
(
jhandle
)
->
max_subcompactions
;
}
/*
* Class: org_rocksdb_DBOptions
* Method: setMaxBackgroundFlushes
...
...
java/src/main/java/org/rocksdb/DBOptions.java
浏览文件 @
ebdfe34c
...
...
@@ -283,6 +283,19 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
return
deleteObsoleteFilesPeriodMicros
(
nativeHandle_
);
}
@Override
public
void
setBaseBackgroundCompactions
(
final
int
baseBackgroundCompactions
)
{
assert
(
isOwningHandle
());
setBaseBackgroundCompactions
(
nativeHandle_
,
baseBackgroundCompactions
);
}
@Override
public
int
baseBackgroundCompactions
()
{
assert
(
isOwningHandle
());
return
baseBackgroundCompactions
(
nativeHandle_
);
}
@Override
public
DBOptions
setMaxBackgroundCompactions
(
final
int
maxBackgroundCompactions
)
{
...
...
@@ -297,6 +310,18 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
return
maxBackgroundCompactions
(
nativeHandle_
);
}
@Override
public
void
setMaxSubcompactions
(
final
int
maxSubcompactions
)
{
assert
(
isOwningHandle
());
setMaxSubcompactions
(
nativeHandle_
,
maxSubcompactions
);
}
@Override
public
int
maxSubcompactions
()
{
assert
(
isOwningHandle
());
return
maxSubcompactions
(
nativeHandle_
);
}
@Override
public
DBOptions
setMaxBackgroundFlushes
(
final
int
maxBackgroundFlushes
)
{
...
...
@@ -586,9 +611,14 @@ public class DBOptions extends RocksObject implements DBOptionsInterface {
private
native
void
setDeleteObsoleteFilesPeriodMicros
(
long
handle
,
long
micros
);
private
native
long
deleteObsoleteFilesPeriodMicros
(
long
handle
);
private
native
void
setBaseBackgroundCompactions
(
long
handle
,
int
baseBackgroundCompactions
);
private
native
int
baseBackgroundCompactions
(
long
handle
);
private
native
void
setMaxBackgroundCompactions
(
long
handle
,
int
maxBackgroundCompactions
);
private
native
int
maxBackgroundCompactions
(
long
handle
);
private
native
void
setMaxSubcompactions
(
long
handle
,
int
maxSubcompactions
);
private
native
int
maxSubcompactions
(
long
handle
);
private
native
void
setMaxBackgroundFlushes
(
long
handle
,
int
maxBackgroundFlushes
);
private
native
int
maxBackgroundFlushes
(
long
handle
);
...
...
java/src/main/java/org/rocksdb/DBOptionsInterface.java
浏览文件 @
ebdfe34c
...
...
@@ -350,6 +350,25 @@ public interface DBOptionsInterface {
*/
long
deleteObsoleteFilesPeriodMicros
();
/**
* Suggested number of concurrent background compaction jobs, submitted to
* the default LOW priority thread pool.
* Default: 1
*
* @param baseBackgroundCompactions Suggested number of background compaction
* jobs
*/
void
setBaseBackgroundCompactions
(
int
baseBackgroundCompactions
);
/**
* Suggested number of concurrent background compaction jobs, submitted to
* the default LOW priority thread pool.
* Default: 1
*
* @return Suggested number of background compaction jobs
*/
int
baseBackgroundCompactions
();
/**
* Specifies the maximum number of concurrent background compaction jobs,
* submitted to the default LOW priority thread pool.
...
...
@@ -380,6 +399,28 @@ public interface DBOptionsInterface {
*/
int
maxBackgroundCompactions
();
/**
* This value represents the maximum number of threads that will
* concurrently perform a compaction job by breaking it into multiple,
* smaller ones that are run simultaneously.
* Default: 1 (i.e. no subcompactions)
*
* @param maxSubcompactions The maximum number of threads that will
* concurrently perform a compaction job
*/
void
setMaxSubcompactions
(
int
maxSubcompactions
);
/**
* This value represents the maximum number of threads that will
* concurrently perform a compaction job by breaking it into multiple,
* smaller ones that are run simultaneously.
* Default: 1 (i.e. no subcompactions)
*
* @return The maximum number of threads that will concurrently perform a
* compaction job
*/
int
maxSubcompactions
();
/**
* Specifies the maximum number of concurrent background flush jobs.
* If you're increasing this, also consider increasing number of threads in
...
...
java/src/main/java/org/rocksdb/Options.java
浏览文件 @
ebdfe34c
...
...
@@ -362,6 +362,19 @@ public class Options extends RocksObject
return
new
Statistics
(
statsPtr
);
}
@Override
public
void
setBaseBackgroundCompactions
(
final
int
baseBackgroundCompactions
)
{
assert
(
isOwningHandle
());
setBaseBackgroundCompactions
(
nativeHandle_
,
baseBackgroundCompactions
);
}
@Override
public
int
baseBackgroundCompactions
()
{
assert
(
isOwningHandle
());
return
baseBackgroundCompactions
(
nativeHandle_
);
}
@Override
public
Options
setMaxBackgroundCompactions
(
final
int
maxBackgroundCompactions
)
{
...
...
@@ -370,6 +383,18 @@ public class Options extends RocksObject
return
this
;
}
@Override
public
void
setMaxSubcompactions
(
final
int
maxSubcompactions
)
{
assert
(
isOwningHandle
());
setMaxSubcompactions
(
nativeHandle_
,
maxSubcompactions
);
}
@Override
public
int
maxSubcompactions
()
{
assert
(
isOwningHandle
());
return
maxSubcompactions
(
nativeHandle_
);
}
@Override
public
int
maxBackgroundFlushes
()
{
assert
(
isOwningHandle
());
...
...
@@ -1197,9 +1222,14 @@ public class Options extends RocksObject
private
native
void
setDeleteObsoleteFilesPeriodMicros
(
long
handle
,
long
micros
);
private
native
long
deleteObsoleteFilesPeriodMicros
(
long
handle
);
private
native
void
setBaseBackgroundCompactions
(
long
handle
,
int
baseBackgroundCompactions
);
private
native
int
baseBackgroundCompactions
(
long
handle
);
private
native
void
setMaxBackgroundCompactions
(
long
handle
,
int
maxBackgroundCompactions
);
private
native
int
maxBackgroundCompactions
(
long
handle
);
private
native
void
setMaxSubcompactions
(
long
handle
,
int
maxSubcompactions
);
private
native
int
maxSubcompactions
(
long
handle
);
private
native
void
setMaxBackgroundFlushes
(
long
handle
,
int
maxBackgroundFlushes
);
private
native
int
maxBackgroundFlushes
(
long
handle
);
...
...
java/src/test/java/org/rocksdb/DBOptionsTest.java
浏览文件 @
ebdfe34c
...
...
@@ -170,6 +170,16 @@ public class DBOptionsTest {
}
}
@Test
public
void
baseBackgroundCompactions
()
{
try
(
final
DBOptions
opt
=
new
DBOptions
())
{
final
int
intValue
=
rand
.
nextInt
();
opt
.
setBaseBackgroundCompactions
(
intValue
);
assertThat
(
opt
.
baseBackgroundCompactions
()).
isEqualTo
(
intValue
);
}
}
@Test
public
void
maxBackgroundCompactions
()
{
try
(
final
DBOptions
opt
=
new
DBOptions
())
{
...
...
@@ -179,6 +189,16 @@ public class DBOptionsTest {
}
}
@Test
public
void
maxSubcompactions
()
{
try
(
final
DBOptions
opt
=
new
DBOptions
())
{
final
int
intValue
=
rand
.
nextInt
();
opt
.
setMaxSubcompactions
(
intValue
);
assertThat
(
opt
.
maxSubcompactions
()).
isEqualTo
(
intValue
);
}
}
@Test
public
void
maxBackgroundFlushes
()
{
try
(
final
DBOptions
opt
=
new
DBOptions
())
{
...
...
java/src/test/java/org/rocksdb/OptionsTest.java
浏览文件 @
ebdfe34c
...
...
@@ -473,6 +473,16 @@ public class OptionsTest {
}
}
@Test
public
void
baseBackgroundCompactions
()
{
try
(
final
Options
opt
=
new
Options
())
{
final
int
intValue
=
rand
.
nextInt
();
opt
.
setBaseBackgroundCompactions
(
intValue
);
assertThat
(
opt
.
baseBackgroundCompactions
()).
isEqualTo
(
intValue
);
}
}
@Test
public
void
maxBackgroundCompactions
()
{
try
(
final
Options
opt
=
new
Options
())
{
...
...
@@ -483,6 +493,16 @@ public class OptionsTest {
}
}
@Test
public
void
maxSubcompactions
()
{
try
(
final
Options
opt
=
new
Options
())
{
final
int
intValue
=
rand
.
nextInt
();
opt
.
setMaxSubcompactions
(
intValue
);
assertThat
(
opt
.
maxSubcompactions
()).
isEqualTo
(
intValue
);
}
}
@Test
public
void
maxBackgroundFlushes
()
{
try
(
final
Options
opt
=
new
Options
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录