[
https://issues.apache.org/jira/browse/HDFS-6133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979488#comment-13979488
]
Vinayakumar B commented on HDFS-6133:
-------------------------------------
Thanks [~zhaoyunjiong] for the patch.
Approach looks good,
I have following comments.
1. {code}+ .setDatanode(PBHelper.convert((DatanodeID)
datanode)).setSize(size)
+ .setPathPrefix(pathPrefix).build();{code}
Since {{pathPrefix}} is optional, you need not set an empty string when its
null. You need not set at all.
Similarly, you need to check for {{request.hasPathPrefix}} before using
{{request.getPathPrefix()}}. if its not set then you can pass null from
NamenodeProtocolServerSideTranslatorPB.java itself. This is the usual
convention followed for optional parameters.
2. {{pathPrefix}} can be renamed to appropriate one, such as
"excludePathPrefix" in all places.
3. in Test, why need to extract to one more method
testBalancerWithExcludeDirectory ?. i think its not required unless its re-used.
{quote}NamenodeProtocol.proto
My understanding is that the newly added optional parameter should have no
impact in compatibility. But other more experienced reviewers please
confirm.{quote}
Yes you are correct, it provides compatibility. But since NameNodeProtocol is
only a server protocol, not used by any client application, I feel no need to
worry about it.
> Make Balancer support exclude specified path
> --------------------------------------------
>
> Key: HDFS-6133
> URL: https://issues.apache.org/jira/browse/HDFS-6133
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: balancer, namenode
> Reporter: zhaoyunjiong
> Assignee: zhaoyunjiong
> Attachments: HDFS-6133.patch
>
>
> Currently, run Balancer will destroying Regionserver's data locality.
> If getBlocks could exclude blocks belongs to files which have specific path
> prefix, like "/hbase", then we can run Balancer without destroying
> Regionserver's data locality.
--
This message was sent by Atlassian JIRA
(v6.2#6252)