Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
23757ef5
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
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:
...
@@ -93,7 +93,7 @@ public:
if
(
path
==
""
)
{
if
(
path
==
""
)
{
return
{};
return
{};
}
}
auto
paths
=
_
split_path
(
path
);
auto
paths
=
split_path
(
path
);
int
err_no
=
0
;
int
err_no
=
0
;
std
::
vector
<
std
::
string
>
list
;
std
::
vector
<
std
::
string
>
list
;
...
@@ -115,7 +115,7 @@ public:
...
@@ -115,7 +115,7 @@ public:
if
(
line
.
size
()
!=
8
)
{
if
(
line
.
size
()
!=
8
)
{
continue
;
continue
;
}
}
list
.
push_back
(
_
get_prefix
(
paths
)
+
line
[
7
]);
list
.
push_back
(
get_prefix
(
paths
)
+
line
[
7
]);
}
}
}
while
(
err_no
==
-
1
);
}
while
(
err_no
==
-
1
);
return
list
;
return
list
;
...
@@ -151,7 +151,7 @@ public:
...
@@ -151,7 +151,7 @@ public:
}
}
std
::
string
hdfs_command
(
const
std
::
string
&
path
)
{
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
());
auto
it
=
_ugi
.
find
(
std
::
get
<
1
>
(
paths
).
ToString
());
if
(
it
!=
_ugi
.
end
())
{
if
(
it
!=
_ugi
.
end
())
{
return
hdfs_command_with_ugi
(
it
->
second
);
return
hdfs_command_with_ugi
(
it
->
second
);
...
@@ -166,20 +166,19 @@ public:
...
@@ -166,20 +166,19 @@ public:
}
}
private:
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
)
{
if
(
std
::
get
<
1
>
(
paths
).
len
()
==
0
)
{
return
std
::
get
<
0
>
(
paths
).
ToString
();
return
std
::
get
<
0
>
(
paths
).
ToString
();
}
}
return
std
::
get
<
0
>
(
paths
).
ToString
()
+
"//"
+
std
::
get
<
1
>
(
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://abc.def:8756/user" as "xxx:", "abc.def:8756", "/user"
// parse "xxx:/user" as "xxx:", "", "/user"
// parse "xxx:/user" as "xxx:", "", "/user"
// parse "xxx://abc.def:8756" as "xxx:", "abc.def:8756", ""
// parse "xxx://abc.def:8756" as "xxx:", "abc.def:8756", ""
// parse "other" as "", "", "other"
// 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
};
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
;
auto
fs_pos
=
string
::
Find
(
path
,
':'
,
0
)
+
1
;
if
(
path
.
len
()
>
fs_pos
)
{
if
(
path
.
len
()
>
fs_pos
)
{
std
::
get
<
0
>
(
result
)
=
string
::
SubStr
(
path
,
0
,
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录