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

Kai Zheng commented on HADOOP-11707:
------------------------------------

Hi [~umamaheswararao],

Thanks for your review and comments. Yes I agree, sounds a bit too many 
factories since we're having one for each pair of raw encoder and decoder. A 
good suggestion to have only one factory for all raw coders to create 
encoder/decoder with a type. Static type or enum doesn't allow to support new 
coders as we have to add new entries for them; dynamic type like string name 
will need a registry to support dynamic lookup, to fill the registry will also 
need some work like service locators. Both ways seem a bit heavier. Considering 
raw coders are only used by {{ErasureCoder}}, where it's clear to use which 
erasure codes and therefore raw coders, so what's really needed here is to 
support creating different implementation of raw coders in certain codes. The 
factory groups raw encoder and decoder together, to ease configuration of them 
for a {{ErasureCoder}} since we don't need to configure encoder and decoder 
respectively. It's a little like socket factory that creates server socket and 
client sockets. Currently the factory logic is quite simple, but later when we 
support multiple modes or derivations for a code, the factory logic will have 
more sense then.

Please kindly let me know if I'm clear or more worse. :) Thanks.

> Add factory to create raw erasure coder
> ---------------------------------------
>
>                 Key: HADOOP-11707
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11707
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: io
>            Reporter: Kai Zheng
>            Assignee: Kai Zheng
>             Fix For: HDFS-7285
>
>         Attachments: HADOOP-11707-v1.patch
>
>
> We have {{RawErasureEncoder}} and {{RawErasureDecoder}} interface separately, 
> which simplifies the implementation of raw coders. This would require to 
> configure raw encoder and decoder respectively for a {{ErasureCoder}}, which 
> isn't convenient. To simplify the configuration, we would have coder factory 
> to group encoder and decoder together so only a factory class needs to be 
> configured.



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

Reply via email to