Package org.onosproject.store.flow
Class ReplicaInfo
- java.lang.Object
-
- org.onosproject.store.flow.ReplicaInfo
-
public final class ReplicaInfo extends Object
Class to represent placement information about Master/Backup copy.
-
-
Constructor Summary
Constructors Constructor Description ReplicaInfo(long term, NodeId master, List<NodeId> backups)
Creates a ReplicaInfo instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NodeId>
backups()
Returns the collection of NodeId, where backup copies should be placed.boolean
equals(Object other)
int
hashCode()
Optional<NodeId>
master()
Returns the NodeId, if there is a Node where the master copy should be.long
term()
Returns the mastership term.
-
-
-
Constructor Detail
-
ReplicaInfo
public ReplicaInfo(long term, NodeId master, 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 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 List<NodeId> backups()
Returns the collection of NodeId, where backup copies should be placed.- Returns:
- collection of NodeId, where backup copies should be placed
-
-