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

Brahma Reddy Battula commented on HDFS-8805:
--------------------------------------------

@jing zhao and [~huizane] thanks a lot for your inputs..just we need remove the 
superuser check in {{FSDirStatAndListingOp#getFileInfo}}, Attached the patch 
for same.. I verfied manually,following is the result for same.Did not seen 
better way to write the testcase.

{noformat}
$ ./hdfs storagepolicies -setStoragePolicy -path /BBP -policy COLD
Set storage policy COLD on /BBP
{noformat}
 *without Patch* 
{noformat}
host1 bin# ./hdfs storagepolicies -getStoragePolicy -path /BBP
The storage policy of /BBP is unspecified
{noformat}
 *with Patch* 
{noformat}
host1 bin# ./hdfs storagepolicies -getStoragePolicy -path /BBP
The storage policy of /BBP:
BlockStoragePolicy{COLD:2, storageTypes=[ARCHIVE], creationFallbacks=[], 
replicationFallbacks=[]}
{noformat}

> Archival Storage: getStoragePolicy should not need superuser privilege
> ----------------------------------------------------------------------
>
>                 Key: HDFS-8805
>                 URL: https://issues.apache.org/jira/browse/HDFS-8805
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: balancer & mover, namenode
>            Reporter: Hui Zheng
>            Assignee: Brahma Reddy Battula
>             Fix For: 2.6.0
>
>         Attachments: HDFS-8805.patch
>
>
> The result of getStoragePolicy command is always 'unspecified' even we has 
> set a StoragePolicy on a directory.But the real placement of blocks is 
> correct. 
> The result of fsck is not correct either.
> {code}
> $ hdfs storagepolicies -setStoragePolicy -path /tmp/cold  -policy COLD
> Set storage policy COLD on /tmp/cold
> $ hdfs storagepolicies -getStoragePolicy -path /tmp/cold
> The storage policy of /tmp/cold is unspecified
> $ hdfs fsck -storagepolicies /tmp/cold
> Blocks NOT satisfying the specified storage policy:
> Storage Policy                  Specified Storage Policy      # of blocks     
>   % of blocks
> ARCHIVE:4(COLD)                     HOT                           5           
>    55.5556%
> ARCHIVE:3(COLD)                     HOT                           4           
>    44.4444%
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to