[
https://issues.apache.org/jira/browse/HDFS-11298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15871197#comment-15871197
]
Yiqun Lin edited comment on HDFS-11298 at 2/17/17 5:24 AM:
-----------------------------------------------------------
Hi [~surendrasingh], I have taken a look for this and your patch. I'm not so
sure if we need to add this storage policy info in {{FileStatus}}. From the
definition of class {{FileStatus}}, "Interface that represents the client side
information for a file.", the client need to know the storage policy info of
one file? Currently the field infos in {{FileStatus}} are all base info like
blocksize, modification_time etc. And some other info like storage policy info
is defined in {{HdfsFileStatus}}. So I'm +0 for this.
In addition, one comment for the patch
{code}
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
@@ -44,6 +44,7 @@
private String owner;
private String group;
private Path symlink;
+ private byte storagePolicy;
public FileStatus() { this(0, false, 0, 0, 0, 0, null, null, null, null); }
@@ -73,6 +74,15 @@ public FileStatus(long length, boolean isdir,
FsPermission permission, String owner, String group,
Path symlink,
Path path) {
+ this(length, isdir, block_replication, blocksize, modification_time,
+ access_time, permission, owner, group, symlink, path, (byte) 0);
{code}
Here the default policy id is not {{(byte) 0}}, it should be byte
7({{HdfsConstants.HOT_STORAGE_POLICY_ID}}). You may use this var to replace
with bytes 0.
was (Author: linyiqun):
Hi [~surendrasingh], I have taken a look for this and your patch. I'm not so
sure if we need to add this storage policy info in {{FileStatus}}. From the
definition of class {{FileStatus}}, "Interface that represents the client side
information for a file.", the client need to know the storage policy info of
one file? Currently the field infos in {{FileStatus}} are all base info like
blocksize, modification_time etc. And some other info like storage policy info
is defined in {{HdfsFileStatus}}. So I'm +0 for this.
In addition, one comment for the patch
{code}
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
@@ -44,6 +44,7 @@
private String owner;
private String group;
private Path symlink;
+ private byte storagePolicy;
public FileStatus() { this(0, false, 0, 0, 0, 0, null, null, null, null); }
@@ -73,6 +74,15 @@ public FileStatus(long length, boolean isdir,
FsPermission permission, String owner, String group,
Path symlink,
Path path) {
+ this(length, isdir, block_replication, blocksize, modification_time,
+ access_time, permission, owner, group, symlink, path, (byte) 0);
{code}
Here the default policy id is not {{(byte) 0}}, it should be byte 7({{
HdfsConstants.HOT_STORAGE_POLICY_ID}}). You may use this var to replace with
bytes 0.
> Add storage policy info in FileStatus
> -------------------------------------
>
> Key: HDFS-11298
> URL: https://issues.apache.org/jira/browse/HDFS-11298
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: hdfs-client
> Affects Versions: 2.7.2
> Reporter: Surendra Singh Lilhore
> Assignee: Surendra Singh Lilhore
> Attachments: HDFS-11298.001.patch
>
>
> Its good to add storagePolicy field in FileStatus. We no need to call
> getStoragePolicy() API to get the policy.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]