[
https://issues.apache.org/jira/browse/HDFS-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13782099#comment-13782099
]
Luke Lu commented on HDFS-4885:
-------------------------------
I think this API change is problematic for several reasons:
# Loss of useful information by replacing the rack diff with a boolean. We
should preserve existing information as much as possible if we're generalizing
the API.
# Not general enough. minRacks is not general enough for a generic API.
# srcPath is useful for info/debug status.
Suggestion:
{code}
public BlockPlacementStatus verifyBlockPlacement(String srcPath, LocatedBlock
blk, BlockPlacementConstraints constraints);
{code}
Since override is covariant on return type (since java 5), new
BlockPlacementStatus can be implemented for new BlockPlacementPolicy later on
without any information loss.
> Update verifyBlockPlacement() API in BlockPlacementPolicy
> ---------------------------------------------------------
>
> Key: HDFS-4885
> URL: https://issues.apache.org/jira/browse/HDFS-4885
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Junping Du
> Assignee: Junping Du
> Labels: BlockPlacementPolicy
> Attachments: HDFS-4885.patch
>
>
> verifyBlockPlacement() has unused parameter -srcPath as its responsibility
> just verify single block rather than files under a specific path. Also the
> return value (int) does not make sense as the violation of block placement
> has other case than number of racks, so boolean value should be better.
--
This message was sent by Atlassian JIRA
(v6.1#6144)