[jboss-jira] [JBoss JIRA] (JGRP-1941) Fork channels: support state transfer
Bela Ban (JIRA)
issues at jboss.org
Thu Jul 16 02:45:03 EDT 2015
[ https://issues.jboss.org/browse/JGRP-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13089931#comment-13089931 ]
Bela Ban commented on JGRP-1941:
--------------------------------
# If a fork-channel is present on the state provider but not on the requester, that part of the state is simply dropped at the requester.
# If a fork-channel is present on the state requester but not on the provider, the state requester's fork-channel won't get any state.
Re 1: to skip a state for a given fork-channel, we have to know how many bytes to skip. Therefore we either need to pass the length with each \{channel | state\} pair, or insert a special symbol into the stream to mark the end of a pair.
Re 2: It is the application's responsibility to make sure that this doesn't happen
> Fork channels: support state transfer
> -------------------------------------
>
> Key: JGRP-1941
> URL: https://issues.jboss.org/browse/JGRP-1941
> Project: JGroups
> Issue Type: Feature Request
> Reporter: Bela Ban
> Assignee: Bela Ban
> Fix For: 3.6.5
>
>
> Currently state transfer is not supported for ForkChannels: {{ForkChannel.getState()}} throws an exception.
> State transfer could be implemented by catching events {{STATE_TRANSFER_OUTPUTSTREAM}} (get-state) and {{STATE_TRANSFER_INPUTSTREAM}} (set-state) in {{FORK}}.
> When {{getState()}} is called (on the main or fork channel), the state provider gets a get-state in {{FORK}}. It then asks the main channel and all fork channels to write their states to the output stream, as follows:
> {noformat}
> | main-channel | state | fork-channel1 | state | fork-channel2 | state | ...
> {noformat}
> This is a list of \{channel-name | state\} pairs, where each state is prefixed with the name of the channel.
> This can be implemented by simply passing the {{STATE_TRANSFER_OUTPUTSTREAM}} event up the main stack and each of its fork stacks.
> On the state requester, the {{STATE_TRANSFER_INPUTSTREAM}} event is caught by {{FORK}}. Each \{channel | state\} pair is parsed for the channel name and then the input stream is passed to the corresponding channel for {{setState(InputStream)}} to be invoked.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list