hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiqun Lin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11298) Add storage policy info in FileStatus
Date Fri, 17 Feb 2017 05:24:41 GMT

    [ https://issues.apache.org/jira/browse/HDFS-11298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15871197#comment-15871197

Yiqun Lin commented on HDFS-11298:

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
+++ 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);
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

To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org

View raw message