You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Tsz Wo Nicholas Sze (Jira)" <ji...@apache.org> on 2019/09/23 22:38:00 UTC

[jira] [Moved] (HDDS-2169) Avoid buffer copies while submitting client requests in Ratis

     [ https://issues.apache.org/jira/browse/HDDS-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo Nicholas Sze moved RATIS-688 to HDDS-2169:
-------------------------------------------------

         Component/s:     (was: server)
                          (was: client)
       Fix Version/s:     (was: 0.4.0)
                 Key: HDDS-2169  (was: RATIS-688)
    Target Version/s:   (was: 0.4.0)
            Workflow: patch-available, re-open possible  (was: no-reopen-closed, patch-avail)
          Issue Type: Improvement  (was: Bug)
             Project: Hadoop Distributed Data Store  (was: Ratis)

> Avoid buffer copies while submitting client requests in Ratis
> -------------------------------------------------------------
>
>                 Key: HDDS-2169
>                 URL: https://issues.apache.org/jira/browse/HDDS-2169
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>            Reporter: Shashikant Banerjee
>            Assignee: Tsz Wo Nicholas Sze
>            Priority: Major
>
> Currently, while sending write requests to Ratis from ozone, a protobuf object containing data encoded  and then resultant protobuf is again converted to a byteString which internally does a copy of the buffer embedded inside the protobuf again so that it can be submitted over to Ratis client. Again, while sending the appendRequest as well while building up the appendRequestProto, it might be again copying the data. The idea here is to provide client so pass the raw data(stateMachine data) separately to ratis client without copying overhead. 
>  
> {code:java}
> private CompletableFuture<RaftClientReply> sendRequestAsync(
>     ContainerCommandRequestProto request) {
>   try (Scope scope = GlobalTracer.get()
>       .buildSpan("XceiverClientRatis." + request.getCmdType().name())
>       .startActive(true)) {
>     ContainerCommandRequestProto finalPayload =
>         ContainerCommandRequestProto.newBuilder(request)
>             .setTraceID(TracingUtil.exportCurrentSpan())
>             .build();
>     boolean isReadOnlyRequest = HddsUtils.isReadOnly(finalPayload);
> //  finalPayload already has the byteString data embedded. 
>     ByteString byteString = finalPayload.toByteString(); -----> It involves a copy again.
>     if (LOG.isDebugEnabled()) {
>       LOG.debug("sendCommandAsync {} {}", isReadOnlyRequest,
>           sanitizeForDebug(finalPayload));
>     }
>     return isReadOnlyRequest ?
>         getClient().sendReadOnlyAsync(() -> byteString) :
>         getClient().sendAsync(() -> byteString);
>   }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org