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

Tsz Wo Nicholas Sze commented on HDFS-8499:
-------------------------------------------

> ..., but if you could share some thoughts on the comparison it'd be nice. ...

BlockInfoContiguous and BlockInfoStriped could be implemented using completely 
different data structures.  They also can be constructuced in a completely 
different way.  Indeed, BlockInfoContiguous is constructed by a write pipeline 
and BlockInfoStriped is constructed by parallel write.  Therefore, 
BlockInfoContiguousUC and BlockInfoStripedUC may not share a lot of common 
code.  However, Design #1 assumes both BlockInfoContiguous and BlockInfoStriped 
can be constructed in a similar way.

Also, if BlockInfoContiguousUC/BlockInfoStripedUC does not extend 
BlockInfoContiguous/BlockInfoStriped, their data structures cannot be made 
private to the classes.  HDFS-8499 adds ContiguousBlockStorageOp for 
BlockInfoContiguous and BlockInfoUnderConstructionContiguous so that the actual 
logic for contiguous BlockInfo is actually in the static methods in 
ContiguousBlockStorageOp.  It is a procedural langage apporach but not OO 
apporach.  BlockInfoContiguous/BlockInfoUnderConstructionContiguous become 
adapter-style classes -- they simply call the methods in 
ContiguousBlockStorageOp and there are a lot of code duplication between these 
two classes.  They same thing is going to happen to BlockInfoStriped and 
BlockInfoStripedUC in Design #1.

> ... I chose option A to avoid breaking the existing is-a relationship in 
> trunk. ...

Do you mean breaking the trunk code before HDFS-8499.  If yes, Could you 
explain how Design #2 breaks the existing is-a relationship?


> 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