[
https://issues.apache.org/jira/browse/ARTEMIS-2336?focusedWorklogId=240922&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-240922
]
ASF GitHub Bot logged work on ARTEMIS-2336:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 13/May/19 07:46
Start Date: 13/May/19 07:46
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_r283210480
##########
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);
+ return nextBatchSize == batchLimit ?
channel.writeAndFlush(fileObject, promise) : channel.write(fileObject, promise);
Review comment:
Try to check if it makes sense to batch writes if we are using
ChunkedFile/DefaultFileRegion
----------------------------------------------------------------
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: 240922)
Time Spent: 1h 10m (was: 1h)
> 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: 1h 10m
> Remaining Estimate: 0h
>
> Use sendfile to replicate files during backup sever bootstrap.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)