org.jgroups
Class MergeView

java.lang.Object
  extended by org.jgroups.View
      extended by org.jgroups.MergeView
All Implemented Interfaces:
java.lang.Comparable<View>, java.lang.Iterable<Address>, Streamable

public class MergeView
extends View

A view that is sent as a result of a cluster merge. Whenever a group splits into subgroups, e.g., due to a network partition, and later the subgroups merge back together, a MergeView instead of a View will be received by the application. The MergeView class is a subclass of View and contains as additional instance variable: the list of views that were merged. For example, if the group denoted by view V1:(p,q,r,s,t) splits into subgroups V2:(p,q,r) and V2:(s,t), the merged view might be V3:(p,q,r,s,t). In this case the MergeView would contain a list of 2 views: V2:(p,q,r) and V2:(s,t).

Since:
2.0
Author:
Bela Ban

Field Summary
protected  java.util.List<View> subgroups
           
 
Fields inherited from class org.jgroups.View
members, vid
 
Constructor Summary
MergeView()
          Used by externalization
MergeView(Address creator, long id, java.util.List<Address> members, java.util.List<View> subgroups)
          Creates a new view
MergeView(ViewId vid, java.util.List<Address> members, java.util.List<View> subgroups)
          Creates a new view
 
Method Summary
 View copy()
           
 java.util.List<View> getSubgroups()
           
 void readFrom(java.io.DataInput in)
          Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
 int serializedSize()
           
 java.lang.String toString()
           
 void writeTo(java.io.DataOutput out)
          Write the entire state of the current object (including superclasses) to outstream.
 
Methods inherited from class org.jgroups.View
compareTo, containsMember, equals, getCreator, getMembers, getVid, getViewId, hashCode, iterator, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

subgroups

protected java.util.List<View> subgroups
Constructor Detail

MergeView

public MergeView()
Used by externalization


MergeView

public MergeView(ViewId vid,
                 java.util.List<Address> members,
                 java.util.List<View> subgroups)
Creates a new view

Parameters:
vid - The view id of this view (can not be null)
members - Contains a list of all the members in the view, can be empty but not null.
subgroups - A list of Views representing the former subgroups

MergeView

public MergeView(Address creator,
                 long id,
                 java.util.List<Address> members,
                 java.util.List<View> subgroups)
Creates a new view

Parameters:
creator - The creator of this view (can not be null)
id - The lamport timestamp of this view
members - Contains a list of all the members in the view, can be empty but not null.
subgroups - A list of Views representing the former subgroups
Method Detail

getSubgroups

public java.util.List<View> getSubgroups()

copy

public View copy()
Overrides:
copy in class View

toString

public java.lang.String toString()
Overrides:
toString in class View

writeTo

public void writeTo(java.io.DataOutput out)
             throws java.lang.Exception
Description copied from interface: Streamable
Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed

Specified by:
writeTo in interface Streamable
Overrides:
writeTo in class View
Throws:
java.lang.Exception

readFrom

public void readFrom(java.io.DataInput in)
              throws java.lang.Exception
Description copied from interface: Streamable
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed

Specified by:
readFrom in interface Streamable
Overrides:
readFrom in class View
Throws:
java.lang.Exception

serializedSize

public int serializedSize()
Overrides:
serializedSize in class View


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.