Package org.jgroups
Class MergeView
java.lang.Object
org.jgroups.View
org.jgroups.MergeView
- All Implemented Interfaces:
Comparable<View>,Iterable<Address>,Constructable<View>,SizeStreamable,Streamable
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
-
Field Summary
FieldsFields inherited from class org.jgroups.View
members, suppress_view_size, view_id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()create()Creates an instance of the class implementing this interfacebooleandeepEquals(View other) protected Addressget(int index) protected intprotected static View[]listToArray(List<View> list) voidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedintReturns the size (in bytes) of the marshalled objecttoString()voidwriteTo(DataOutput out) Write the entire state of the current object (including superclasses) to outstream.Methods inherited from class org.jgroups.View
compareTo, containsMember, containsMembers, create, create, diff, equals, getCoord, getCreator, getMembers, getMembersRaw, getViewId, hashCode, iterator, leftMembers, newMembers, printDiff, sameMembers, sameMembersOrdered, sameViews, sameViews, sizeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
subgroups
-
-
Constructor Details
-
MergeView
public MergeView() -
MergeView
Creates a new merge view- Parameters:
view_id- 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
-
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
-
create
Description copied from interface:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin interfaceConstructable<View>- Overrides:
createin classView
-
getSubgroups
-
copy
-
deepEquals
- Overrides:
deepEqualsin classView
-
toString
-
writeTo
Description 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:
IOException
-
readFrom
Description 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:
IOExceptionClassNotFoundException
-
serializedSize
public int serializedSize()Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object- Specified by:
serializedSizein interfaceSizeStreamable- Overrides:
serializedSizein classView
-
listToArray
-
get
-
get
-