Package org.jgroups
Class MergeView
java.lang.Object
org.jgroups.View
org.jgroups.MergeView
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Streamable
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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
creates a copy of this viewvoid
void
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedint
toString()
void
void
writeTo
(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 Details
-
subgroups
-
-
Constructor Details
-
MergeView
public MergeView()Used by externalization -
MergeView
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
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 Details
-
getSubgroups
-
clone
creates a copy of this view -
toString
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classView
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classView
- Throws:
IOException
ClassNotFoundException
-
writeTo
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 interfaceStreamable
- Overrides:
writeTo
in classView
- Throws:
IOException
-
readFrom
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException 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 interfaceStreamable
- Overrides:
readFrom
in classView
- Throws:
IOException
IllegalAccessException
InstantiationException
-
serializedSize
public int serializedSize()- Overrides:
serializedSize
in classView
-