Package org.jgroups
Class MergeView
- java.lang.Object
-
- org.jgroups.View
-
- org.jgroups.MergeView
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,Streamable
public class MergeView extends View
A view that is sent as a result of a 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).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MergeView()Used by externalizationMergeView(Address creator, long id, java.util.Vector<Address> members, java.util.Vector<View> subgroups)Creates a new viewMergeView(ViewId vid, java.util.Vector<Address> members, java.util.Vector<View> subgroups)Creates a new view
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()creates a copy of this viewjava.util.Vector<View>getSubgroups()voidreadExternal(java.io.ObjectInput in)voidreadFrom(java.io.DataInputStream in)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedintserializedSize()java.lang.StringtoString()voidwriteExternal(java.io.ObjectOutput out)voidwriteTo(java.io.DataOutputStream out)Write the entire state of the current object (including superclasses) to outstream.-
Methods inherited from class org.jgroups.View
addPayload, containsMember, equals, getCreator, getMembers, getPayload, getVid, hashCode, printDetails, size
-
-
-
-
Field Detail
-
subgroups
protected java.util.Vector<View> subgroups
-
-
Constructor Detail
-
MergeView
public MergeView()
Used by externalization
-
MergeView
public MergeView(ViewId vid, java.util.Vector<Address> members, java.util.Vector<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.Vector<Address> members, java.util.Vector<View> subgroups)
Creates a new view- Parameters:
creator- The creator of this view (can not be null)id- The lamport timestamp of this viewmembers- 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.Vector<View> getSubgroups()
-
clone
public java.lang.Object clone()
creates a copy of this view
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Overrides:
writeExternalin classView- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Overrides:
readExternalin classView- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeTo
public void writeTo(java.io.DataOutputStream out) throws java.io.IOExceptionDescription copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Overrides:
writeToin classView- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInputStream in) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationExceptionDescription copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classView- Throws:
java.io.IOExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationException
-
serializedSize
public int serializedSize()
- Overrides:
serializedSizein classView
-
-