Package com.tangosol.net.partition
Class SimpleAssignmentStrategy.BackupStrength
java.lang.Object
com.tangosol.net.partition.SimpleAssignmentStrategy.BackupStrength
- Enclosing class:
SimpleAssignmentStrategy
BackupStrength represents a level of "strength" or "resiliency" between
the primary and backup owners of a partition. The BackupStrength is used
to determine which backup owners could serve as a "strong" backup for a
primary owner.
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
The strength (one of the *_SAFE constants).protected Set
The set of machine names.protected Set
The set of rack names.protected Set
The set of site names.protected static final int
Machine-safety (members are on different machines).protected static final int
Node-safety (members are different).protected static final int
Rack-safety (members are on different racks).protected static final int
Site-safety (members are on different sites). -
Constructor Summary
ModifierConstructorDescriptionprotected
BackupStrength
(int nStrength, Set setSites, Set setRacks, Set setMachines) Construct a BackupStrength of the specified strength. -
Method Summary
Modifier and TypeMethodDescriptionReturn a human-readable description string of this backup-strength.int
Return the site count.int
Return the rack count.int
Return the site count.protected SimpleAssignmentStrategy.BackupStrength
Return the next weakest BackupStrength.protected boolean
Return true iff the specified members are mutually "strong".toString()
-
Field Details
-
NODE_SAFE
protected static final int NODE_SAFENode-safety (members are different).- See Also:
-
MACHINE_SAFE
protected static final int MACHINE_SAFEMachine-safety (members are on different machines).- See Also:
-
RACK_SAFE
protected static final int RACK_SAFERack-safety (members are on different racks).- See Also:
-
SITE_SAFE
protected static final int SITE_SAFESite-safety (members are on different sites).- See Also:
-
m_nStrength
protected int m_nStrengthThe strength (one of the *_SAFE constants). -
m_setSites
The set of site names. -
m_setRacks
The set of rack names. -
m_setMachines
The set of machine names.
-
-
Constructor Details
-
BackupStrength
Construct a BackupStrength of the specified strength.- Parameters:
nStrength
- one of the BackupStrength.*_SAFE constantssetSites
- the site namessetRacks
- the rack namessetMachines
- the machine names
-
-
Method Details
-
getWeaker
Return the next weakest BackupStrength.- Returns:
- a BackupStrength that is immediately weaker than this
-
isStrong
Return true iff the specified members are mutually "strong".- Parameters:
member1
- the first member to comparemember2
- the second member to compare- Returns:
- true iff the specified members are mutually "strong"
-
getSiteCount
public int getSiteCount()Return the site count.- Returns:
- the site count
-
getRackCount
public int getRackCount()Return the rack count.- Returns:
- the rack count
-
getMachineCount
public int getMachineCount()Return the site count.- Returns:
- the site count
-
getDescription
Return a human-readable description string of this backup-strength.- Returns:
- a human-readable description string of this backup-strength
-
toString
-