Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
23757ef5
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
23757ef5
编写于
8月 07, 2019
作者:
R
rensilin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code_style
Change-Id: I147d05d662d17ab45546a77333e915d7ad34b09f
上级
b4d692cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
10 deletion
+9
-10
paddle/fluid/train/custom_trainer/feed/io/hadoop_file_system.cc
.../fluid/train/custom_trainer/feed/io/hadoop_file_system.cc
+9
-10
未找到文件。
paddle/fluid/train/custom_trainer/feed/io/hadoop_file_system.cc
浏览文件 @
23757ef5
...
...
@@ -93,7 +93,7 @@ public:
if
(
path
==
""
)
{
return
{};
}
auto
paths
=
_
split_path
(
path
);
auto
paths
=
split_path
(
path
);
int
err_no
=
0
;
std
::
vector
<
std
::
string
>
list
;
...
...
@@ -115,7 +115,7 @@ public:
if
(
line
.
size
()
!=
8
)
{
continue
;
}
list
.
push_back
(
_
get_prefix
(
paths
)
+
line
[
7
]);
list
.
push_back
(
get_prefix
(
paths
)
+
line
[
7
]);
}
}
while
(
err_no
==
-
1
);
return
list
;
...
...
@@ -151,7 +151,7 @@ public:
}
std
::
string
hdfs_command
(
const
std
::
string
&
path
)
{
auto
paths
=
_
split_path
(
path
);
auto
paths
=
split_path
(
path
);
auto
it
=
_ugi
.
find
(
std
::
get
<
1
>
(
paths
).
ToString
());
if
(
it
!=
_ugi
.
end
())
{
return
hdfs_command_with_ugi
(
it
->
second
);
...
...
@@ -166,20 +166,19 @@ public:
}
private:
std
::
string
_
get_prefix
(
const
std
::
tuple
<
string
::
Piece
,
string
::
Piece
,
string
::
Piece
>&
paths
)
{
std
::
string
get_prefix
(
const
std
::
tuple
<
string
::
Piece
,
string
::
Piece
,
string
::
Piece
>&
paths
)
{
if
(
std
::
get
<
1
>
(
paths
).
len
()
==
0
)
{
return
std
::
get
<
0
>
(
paths
).
ToString
();
}
return
std
::
get
<
0
>
(
paths
).
ToString
()
+
"//"
+
std
::
get
<
1
>
(
paths
).
ToString
();
}
std
::
tuple
<
string
::
Piece
,
string
::
Piece
,
string
::
Piece
>
_split_path
(
string
::
Piece
path
)
{
// parse "xxx://abc.def:8756/user" as "xxx:", "abc.def:8756
", "/user"
// parse "xxx:/user" as "xxx:", "", "/user
"
// parse "xxx://abc.def:8756" as "xxx:", "abc.def:8756", "
"
// parse "other" as "", "", "other"
// parse "xxx://abc.def:8756/user" as "xxx:", "abc.def:8756", "/user"
// parse "xxx:/user" as "xxx:", "
", "/user"
// parse "xxx://abc.def:8756" as "xxx:", "abc.def:8756", "
"
// parse "other" as "", "", "other
"
std
::
tuple
<
string
::
Piece
,
string
::
Piece
,
string
::
Piece
>
split_path
(
string
::
Piece
path
)
{
std
::
tuple
<
string
::
Piece
,
string
::
Piece
,
string
::
Piece
>
result
{
string
::
SubStr
(
path
,
0
,
0
),
string
::
SubStr
(
path
,
0
,
0
),
path
};
auto
fs_pos
=
string
::
Find
(
path
,
':'
,
0
)
+
1
;
if
(
path
.
len
()
>
fs_pos
)
{
std
::
get
<
0
>
(
result
)
=
string
::
SubStr
(
path
,
0
,
fs_pos
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录