[ 
https://issues.apache.org/jira/browse/ARTEMIS-2336?focusedWorklogId=240909&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-240909
 ]

ASF GitHub Bot logged work on ARTEMIS-2336:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/May/19 07:06
            Start Date: 13/May/19 07:06
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on pull request #2666: ARTEMIS-2336 
Use zero copy to replicate journal/page/large message file
URL: https://github.com/apache/activemq-artemis/pull/2666#discussion_r283209491
 
 

 ##########
 File path: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
 ##########
 @@ -395,19 +425,18 @@ private static void flushAndWait(final Channel channel, 
final ChannelPromise pro
       }
    }
 
-   private ChannelFuture writeBatch(final ByteBuf bytes, final int 
readableBytes, final ChannelPromise promise) {
+   private ChannelFuture writeBatch(final ByteBuf bytes, Object fileObject, 
final int readableBytes, final ChannelPromise promise) {
       final int batchBufferSize = batchBufferSize(channel, 
this.writeBufferHighWaterMark);
       final int nextBatchSize = batchBufferSize + readableBytes;
       if (nextBatchSize > batchLimit) {
          //request to flush before writing, to create the chance to make the 
channel writable again
          channel.flush();
-         //let netty use its write batching ability
-         return channel.write(bytes, promise);
-      } else if (nextBatchSize == batchLimit) {
-         return channel.writeAndFlush(bytes, promise);
+      }
+      if (fileObject == null) {
+         return nextBatchSize == batchLimit ? channel.writeAndFlush(bytes, 
promise) : channel.write(bytes, promise);
       } else {
-         //let netty use its write batching ability
-         return channel.write(bytes, promise);
+         channel.write(bytes);
 
 Review comment:
   The ChannelFuture associated with this write is lost here
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 240909)
    Time Spent: 50m  (was: 40m)

> Use zero copy to replicate journal/page/large message file
> ----------------------------------------------------------
>
>                 Key: ARTEMIS-2336
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2336
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: yangwei
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Use sendfile to replicate files during backup sever bootstrap.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to