Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1941

Fork channels: support state transfer

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.6.5
    • Labels:
      None

      Description

      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:

      | main-channel | state | fork-channel1 | state | fork-channel2 | state | ...
      

      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 whole thing is designed as a one-shot state transfer, to be called once after the main channel and all fork-channels have been created. It is not meant to be called repeatedly (although this works).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                belaban Bela Ban
                Reporter:
                belaban Bela Ban
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: