Package org.onosproject.store.flow
Class ReplicaInfo
- java.lang.Object
-
- org.onosproject.store.flow.ReplicaInfo
-
public final class ReplicaInfo extends java.lang.Object
Class 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.boolean
equals(java.lang.Object other)
int
hashCode()
java.util.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, 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-