Package org.onosproject.store.flow
Class ReplicaInfo
- java.lang.Object
-
- org.onosproject.store.flow.ReplicaInfo
-
public final class ReplicaInfo extends java.lang.ObjectClass to represent placement information about Master/Backup copy.
-
-
Constructor Summary
Constructors Constructor Description ReplicaInfo(long term, NodeId master, java.util.List<NodeId> backups)Creates a ReplicaInfo instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<NodeId>backups()Returns the collection of NodeId, where backup copies should be placed.booleanequals(java.lang.Object other)inthashCode()java.util.Optional<NodeId>master()Returns the NodeId, if there is a Node where the master copy should be.longterm()Returns the mastership term.
-
-
-
Constructor Detail
-
ReplicaInfo
public ReplicaInfo(long term, NodeId master, java.util.List<NodeId> backups)Creates a ReplicaInfo instance.- Parameters:
term- monotonically increasing unique mastership termmaster- NodeId of the node where the master copy should bebackups- list of NodeId, where backup copies should be placed
-
-
Method Detail
-
term
public long term()
Returns the mastership term.- Returns:
- the mastership term
-
master
public java.util.Optional<NodeId> master()
Returns the NodeId, if there is a Node where the master copy should be.- Returns:
- NodeId, where the master copy should be placed
-
backups
public java.util.List<NodeId> backups()
Returns the collection of NodeId, where backup copies should be placed.- Returns:
- collection of NodeId, where backup copies should be placed
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-