franz1981 commented on a change in pull request #2845: ARTEMIS-2336 Use zero
copy to replicate journal/page/large message file (AGAIN)
URL: https://github.com/apache/activemq-artemis/pull/2845#discussion_r326896991
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java
##########
@@ -258,7 +258,19 @@ public void decodeRest(final ActiveMQBuffer buffer) {
private void readFile(ByteBuffer buffer) {
try {
- fileChannel.read(buffer, offset);
+ if (buffer.hasArray()) {
+ raf.seek(offset);
+ final int position = buffer.position();
+ final int read = raf.read(buffer.array(), buffer.arrayOffset() +
position, buffer.remaining());
Review comment:
This one should use the same optimization on
https://github.com/apache/activemq-artemis/pull/2844
----------------------------------------------------------------
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]
With regards,
Apache Git Services