[
https://issues.redhat.com/browse/JGRP-2430?page=com.atlassian.jira.plugin...
]
Bela Ban commented on JGRP-2430:
--------------------------------
There are 2 types of input/output: InputStream/OutputStream (TCP) and ByteBuffer
(TCP_NIO2).
* InputStream: there is no native way of transferring N bytes from input to outout for
1-1 messages. Ditto for 1-m messages; even if there was, we can't pass the same
InputStream transfer to multiple OutputStreams, as reading off of the input stream
advances the read pointer
* ByteBuffer: here, we can pass the ByteBuffer read from the input to multiple outputs,
but - as reading advances the {{position}} of a ByteBuffer, we need to call
{{duplicate()}} on the ByteBuffer before passing it to the output.
All in all, these are rather modest improvements...
GossipRouter: more efficient routing
------------------------------------
Key: JGRP-2430
URL:
https://issues.redhat.com/browse/JGRP-2430
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Priority: Major
Fix For: 5.1
GossipRouter supports both NIO (ByteBuffer) and TCP (stream-based) connections. In both
cases, however, the entire message is read and then routed to the destination address.
It would be better to only read the cluster name and target address, and then use
efficient stream-to-stream (or channel-to-channel) _transfer mechanisms_, which avoids
temporary copies of data and the full reading of messages.
Also look into routing of entire message _batches_.
Investigate whether this is possible.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)