[jboss-jira] [JBoss JIRA] (JGRP-1781) Message: write/read the payload last when marshalling
Bela Ban (JIRA)
issues at jboss.org
Wed Jan 22 10:14:29 EST 2014
[ https://issues.jboss.org/browse/JGRP-1781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12937910#comment-12937910 ]
Bela Ban commented on JGRP-1781:
--------------------------------
When moving the payload to the end, we might omit the length field (int) when writing / reading a single message, as the length is implied as the current position until the end of the buffer.
> Message: write/read the payload last when marshalling
> -----------------------------------------------------
>
> Key: JGRP-1781
> URL: https://issues.jboss.org/browse/JGRP-1781
> Project: JGroups
> Issue Type: Enhancement
> Reporter: Bela Ban
> Assignee: Bela Ban
> Fix For: 3.5
>
>
> When (un)marshalling a message, we process the fields in this order:
> # Sender and receiver addresses
> # Flags
> # Payload
> # Headers
> I'd like to change this to move processing of the payload to the end because
> * If payload refers to a different buffer (JGRP-1773), then we don't need to read the bytes, but currently have to skip N bytes to read the headers. If the payload was at the end, this wouldn't be needed
> * Once we use NIO.2 and gathering writes, we'd pass a couple of buffers to the socket write and therefore it's simpler if the payload is written last. Ditto for scattering reads.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list