Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
8b7caaa2
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b7caaa2
编写于
2月 12, 2016
作者:
A
Aljoscha Krettek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[hotfix] Fix field names in RocksDBStateBackend
上级
f5d71909
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
16 deletion
+16
-16
flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java
...he/flink/contrib/streaming/state/RocksDBStateBackend.java
+16
-16
未找到文件。
flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java
浏览文件 @
8b7caaa2
...
...
@@ -83,10 +83,10 @@ public class RocksDBStateBackend extends AbstractStateBackend {
// DB storage directories
/** Base paths for RocksDB directory, as configured. May be null. */
private
Path
[]
d
bBasePaths
;
private
Path
[]
configuredD
bBasePaths
;
/** Base paths for RocksDB directory, as initialized */
private
File
[]
dbStorageDirectorie
s
;
private
File
[]
initializedDbBasePath
s
;
private
int
nextDirectory
;
...
...
@@ -171,15 +171,15 @@ public class RocksDBStateBackend extends AbstractStateBackend {
this
.
jobId
=
env
.
getJobID
();
// initialize the paths where the local RocksDB files should be stored
if
(
d
bBasePaths
==
null
)
{
if
(
configuredD
bBasePaths
==
null
)
{
// initialize from the temp directories
dbStorageDirectorie
s
=
env
.
getIOManager
().
getSpillingDirectories
();
initializedDbBasePath
s
=
env
.
getIOManager
().
getSpillingDirectories
();
}
else
{
List
<
File
>
dirs
=
new
ArrayList
<>(
d
bBasePaths
.
length
);
List
<
File
>
dirs
=
new
ArrayList
<>(
configuredD
bBasePaths
.
length
);
String
errorMessage
=
""
;
for
(
Path
path
:
d
bBasePaths
)
{
for
(
Path
path
:
configuredD
bBasePaths
)
{
File
f
=
new
File
(
path
.
toUri
().
getPath
());
if
(!
f
.
exists
()
&&
!
f
.
mkdirs
())
{
String
msg
=
"Local DB files directory '"
+
f
.
getAbsolutePath
()
...
...
@@ -193,11 +193,11 @@ public class RocksDBStateBackend extends AbstractStateBackend {
if
(
dirs
.
isEmpty
())
{
throw
new
Exception
(
"No local storage directories available. "
+
errorMessage
);
}
else
{
dbStorageDirectorie
s
=
dirs
.
toArray
(
new
File
[
dirs
.
size
()]);
initializedDbBasePath
s
=
dirs
.
toArray
(
new
File
[
dirs
.
size
()]);
}
}
nextDirectory
=
new
Random
().
nextInt
(
dbStorageDirectorie
s
.
length
);
nextDirectory
=
new
Random
().
nextInt
(
initializedDbBasePath
s
.
length
);
}
@Override
...
...
@@ -225,15 +225,15 @@ public class RocksDBStateBackend extends AbstractStateBackend {
}
File
[]
getStoragePaths
()
{
return
dbStorageDirectorie
s
;
return
initializedDbBasePath
s
;
}
File
getNextStoragePath
()
{
int
ni
=
nextDirectory
+
1
;
ni
=
ni
>=
dbStorageDirectorie
s
.
length
?
0
:
ni
;
ni
=
ni
>=
initializedDbBasePath
s
.
length
?
0
:
ni
;
nextDirectory
=
ni
;
return
dbStorageDirectorie
s
[
ni
];
return
initializedDbBasePath
s
[
ni
];
}
// ------------------------------------------------------------------------
...
...
@@ -330,7 +330,7 @@ public class RocksDBStateBackend extends AbstractStateBackend {
*/
public
void
setDbStoragePaths
(
String
...
paths
)
{
if
(
paths
==
null
)
{
d
bBasePaths
=
null
;
configuredD
bBasePaths
=
null
;
}
else
if
(
paths
.
length
==
0
)
{
throw
new
IllegalArgumentException
(
"empty paths"
);
...
...
@@ -350,7 +350,7 @@ public class RocksDBStateBackend extends AbstractStateBackend {
}
}
d
bBasePaths
=
pp
;
configuredD
bBasePaths
=
pp
;
}
}
...
...
@@ -359,12 +359,12 @@ public class RocksDBStateBackend extends AbstractStateBackend {
* @return The configured DB storage paths, or null, if none were configured.
*/
public
String
[]
getDbStoragePaths
()
{
if
(
d
bBasePaths
==
null
)
{
if
(
configuredD
bBasePaths
==
null
)
{
return
null
;
}
else
{
String
[]
paths
=
new
String
[
d
bBasePaths
.
length
];
String
[]
paths
=
new
String
[
configuredD
bBasePaths
.
length
];
for
(
int
i
=
0
;
i
<
paths
.
length
;
i
++)
{
paths
[
i
]
=
d
bBasePaths
[
i
].
toString
();
paths
[
i
]
=
configuredD
bBasePaths
[
i
].
toString
();
}
return
paths
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录