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

Lei (Eddy) Xu commented on HDFS-11036:
--------------------------------------

Hi, [~vagarychen]

Thanks a lot for the efforts. Would you mind to address a few extra concerns:

* Could you provide tests for this patch to prove the correctness for the basic 
cases?
* Would you consider to use {{ScheduledExecutorService#scheduleAtFixedRate()}} 
to invoke {{ClientCleaner#run()}}?
* Can {{ClientCleaner}} be private or package-private?
* As [~anu] mentioned, it'd nice to not hold lock when iterate the map. 
* {code}
        } catch (InterruptedException e) {

        }
{code}

Maybe {{LOG.warn()}} here?

* {code}

 synchronized (openClient) {
      info = openClient.get(containerName);
    }
....
  info = new XceiverClientWithAccessInfo(xceiverClient);
      info.incrementReference();
      synchronized (openClient) {
        openClient.put(containerName, info);
      }
{code}

I saw you are using container name as key here, would it be an issue if two 
clients / pipelines access the same container at the same time?

* {code}
  private static class XceiverClientWithAccessInfo {
     private XceiverClient xceiverClient;
    private AtomicInteger referenceCount;
{code}

Can these two fields be {{final}}?


Thanks.



> Ozone : reuse Xceiver connection
> --------------------------------
>
>                 Key: HDFS-11036
>                 URL: https://issues.apache.org/jira/browse/HDFS-11036
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Chen Liang
>            Assignee: Chen Liang
>         Attachments: HDFS-11036-HDFS-7240.001.patch, 
> HDFS-11036-HDFS-7240.002.patch, HDFS-11036-HDFS-7240.003.patch
>
>
> Currently for every IO operation calling into XceiverClientManager will 
> open/close a connection, this JIRA proposes to reuse connection to reduce 
> connection setup/shutdown overhead.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to