Package org.jgroups.protocols.pbcast
Class DeltaView
- java.lang.Object
-
- org.jgroups.View
-
- org.jgroups.protocols.pbcast.DeltaView
-
- All Implemented Interfaces:
java.lang.Comparable<View>
,java.lang.Iterable<Address>
,Constructable<View>
,SizeStreamable
,Streamable
public class DeltaView extends View
Subclass ofView
with a null members field. Adds an array for left members and one for joined members compared to the previous view. A recipient receiving a DeltaView can construct a new view by grabbing the view corresponding toView.view_id
, removing the left members and adding the new members. This class is only used with VIEW messages in GMS to install new views (not merge views). When a VIEW message is received, the DeltaView is read from theGMS.GmsHeader
, a View is constructured and the header discarded. Therefore, the lifetime of a DeltaView is short: it is created and set in a GmsHeader, the header is then marshalled. On the receiving side, the DeltaView is created from the stream, a View is created and the DeltaView discarded again. Instances of this class are created byCoordGmsImpl.handleMembershipChange(java.util.Collection)
. JIRA issue: https://issues.redhat.com/browse/JGRP-1354- Since:
- 3.4
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected Address[]
left_members
Members which left the view corresponding to ref_view_idprotected Address[]
new_members
Members which joined the view corresponding to ref_view_idprotected ViewId
ref_view_id
The fields left_members and new_members refer to the view corresponding to ref_view_id-
Fields inherited from class org.jgroups.View
members, suppress_view_size, view_id
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Address[]
getLeftMembers()
Address[]
getNewMembers()
ViewId
getRefViewId()
java.util.Iterator<Address>
iterator()
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 closedint
serializedSize()
Returns the size (in bytes) of the marshalled objectjava.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, containsMembers, create, create, create, deepEquals, diff, equals, getCoord, getCreator, getMembers, getMembersRaw, getViewId, hashCode, leftMembers, newMembers, printDiff, sameMembers, sameMembersOrdered, sameViews, sameViews, size
-
-
-
-
Field Detail
-
ref_view_id
protected ViewId ref_view_id
The fields left_members and new_members refer to the view corresponding to ref_view_id
-
left_members
protected Address[] left_members
Members which left the view corresponding to ref_view_id
-
new_members
protected Address[] new_members
Members which joined the view corresponding to ref_view_id
-
-
Method Detail
-
getRefViewId
public ViewId getRefViewId()
-
getLeftMembers
public Address[] getLeftMembers()
-
getNewMembers
public Address[] getNewMembers()
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamable
Returns the size (in bytes) of the marshalled object- Specified by:
serializedSize
in interfaceSizeStreamable
- Overrides:
serializedSize
in classView
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException
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:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
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:
java.io.IOException
java.lang.ClassNotFoundException
-
iterator
public java.util.Iterator<Address> iterator()
-
-