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

Brandon Li commented on HDFS-5230:
----------------------------------

Thank you, Haohui. We are almost there. 

A few more changes needed:
1. we can remove cacheSize from RpcProgram constructor since the retry cache is 
removed from this class
2. in RpcProgram class, need to wrap the out buffer as readonly in two places, 
otherwise it can't return any real rpc data to client, which could cause 
problem on Linux platform. 
{noformat}
ChannelBuffer b = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
{noformat}
3. in RpcProgramNfs3, the retry cache should be like the following:
{noformat}
    if (!isIdempotent(rpcCall)) {
      RpcCallCache.CacheEntry entry = rpcCallCache.checkOrAddToCache(client,
          xid);
      if (entry != null) { // in cache
        if (entry.isCompleted()) {
          LOG.info("Sending the cached reply to retransmitted request " + xid);
          RpcUtil.sendRpcResponse(ctx, entry.getResponse());
          return;
        } else { // else request is in progress
          LOG.info("Retransmitted request, transaction still in progress "
              + xid);
          // Ignore the request and do nothing
          return;
        }
       }
     }
{noformat}

4. at the end of RpcProgramNfs3.handleInternal(), it should simply return when 
response, otherwise it will cause the server to send empty rpc package to the 
client.
                
> Introduce RpcInfo to decouple XDR classes from the RPC API
> ----------------------------------------------------------
>
>                 Key: HDFS-5230
>                 URL: https://issues.apache.org/jira/browse/HDFS-5230
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: nfs
>            Reporter: Haohui Mai
>            Assignee: Haohui Mai
>         Attachments: HDFS-5230.002.patch, HDFS-5230.003.patch, 
> HDFS-5230.004.patch, HDFS-5230.005.patch, HDFS-5230.006.patch
>
>
> The XDR class is one fundamental aspect in the current implementation of NFS 
> server. While the client might potentially have a higher level APIs, it also 
> requires redundant copying since the upstream clients have insufficient 
> information.
> This JIRA introduces a new class, RpcInfo, which (1) decouples XDR from the 
> APIs, turning it into a utility class, and (2) exposes ChannelBuffer directly 
> to the client in order to open the opportunity for avoid copying.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to