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

Zhe Zhang commented on HDFS-8499:
---------------------------------

Thanks for the discussions Nicholas and Jing.

Basically, I think the long term solution to this multi-inheritance is to 
eliminate {{BlockInfo}} subclassing altogether and using feature / op classes 
instead, like {{INodeFile}} features. It is more explicit, clearer, and safer 
than relying on {{instanceof}} and type casting. Moreover, it allows scaling to 
more types of {{BlockInfo}}. For example, as mentioned above, in phase II of 
erasure coding we will likely support contiguous + erasure coded blocks.

*If* we agree upon the long term solution, then *A* and *B*, as Nicholas 
summarized, are both intermediate states. I chose option *A* primarily to 
minimize change and keep trunk more stable. A secondary reason is to get rid of 
duplicate code between the two UC classes. I started writing a patch to make UC 
an Op class but found it much more change than contiguous / striped Op classes.

> Refactor BlockInfo class hierarchy with static helper class
> -----------------------------------------------------------
>
>                 Key: HDFS-8499
>                 URL: https://issues.apache.org/jira/browse/HDFS-8499
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>    Affects Versions: 2.7.0
>            Reporter: Zhe Zhang
>            Assignee: Zhe Zhang
>             Fix For: 2.8.0
>
>         Attachments: HDFS-8499.00.patch, HDFS-8499.01.patch, 
> HDFS-8499.02.patch, HDFS-8499.03.patch, HDFS-8499.04.patch, 
> HDFS-8499.05.patch, HDFS-8499.06.patch, HDFS-8499.07.patch, 
> HDFS-8499.UCFeature.patch, HDFS-bistriped.patch
>
>
> In HDFS-7285 branch, the {{BlockInfoUnderConstruction}} interface provides a 
> common abstraction for striped and contiguous UC blocks. This JIRA aims to 
> merge it to trunk.



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

Reply via email to