Class ViewId
java.lang.Object
org.jgroups.ViewId
- All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Comparable, Streamable
ViewIds are used for ordering views (each view has a ViewId and a list of members).
Ordering between views is important for example in a virtual synchrony protocol where
all views seen by a member have to be ordered.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Cloneable interface Returns a new ViewID object containing the same address and lamport timestamp as this viewintOld CompareintEstablishes an order between 2 ViewIds.copy()Old Copy method, deprecated because it is substituted by clone()booleanreturns the address of the member that issued this viewlonggetId()returns the lamport time of the viewinthashCode()voidvoidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedinttoString()voidvoidwriteTo(DataOutputStream out) Write the entire state of the current object (including superclasses) to outstream.
-
Constructor Details
-
ViewId
public ViewId() -
ViewId
Creates a ViewID with the coordinator address and a Lamport timestamp of 0.- Parameters:
coord_addr- the address of the member that issued this view
-
ViewId
Creates a ViewID with the coordinator address and the given Lamport timestamp.- Parameters:
coord_addr- - the address of the member that issued this viewid- - the Lamport timestamp of the view
-
-
Method Details
-
getId
public long getId()returns the lamport time of the view- Returns:
- the lamport time timestamp
-
getCoordAddress
returns the address of the member that issued this view- Returns:
- the Address of the the issuer
-
toString
-
clone
-
copy
Old Copy method, deprecated because it is substituted by clone() -
compareTo
Establishes an order between 2 ViewIds. First compare on id. Compare on coord_addr only if necessary (i.e. ids are equal) !- Specified by:
compareToin interfaceComparable- Returns:
- 0 for equality, value less than 0 if smaller, greater than 0 if greater.
-
compare
Old Compare -
equals
-
hashCode
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
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- Throws:
IOException
-
readFrom
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException 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- Throws:
IOExceptionIllegalAccessExceptionInstantiationException
-
serializedSize
public int serializedSize()
-