Package com.tangosol.net.partition
Class SimpleAssignmentStrategy.BackupStrength
- java.lang.Object
-
- com.tangosol.net.partition.SimpleAssignmentStrategy.BackupStrength
-
- Enclosing class:
- SimpleAssignmentStrategy
protected static class SimpleAssignmentStrategy.BackupStrength extends Object
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
Fields Modifier and Type Field Description protected int
m_nStrength
The strength (one of the *_SAFE constants).protected Set
m_setMachines
The set of machine names.protected Set
m_setRacks
The set of rack names.protected Set
m_setSites
The set of site names.protected static int
MACHINE_SAFE
Machine-safety (members are on different machines).protected static int
NODE_SAFE
Node-safety (members are different).protected static int
RACK_SAFE
Rack-safety (members are on different racks).protected static int
SITE_SAFE
Site-safety (members are on different sites).
-
Constructor Summary
Constructors Modifier Constructor Description protected
BackupStrength(int nStrength, Set setSites, Set setRacks, Set setMachines)
Construct a BackupStrength of the specified strength.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Return a human-readable description string of this backup-strength.int
getMachineCount()
Return the site count.int
getRackCount()
Return the rack count.int
getSiteCount()
Return the site count.protected SimpleAssignmentStrategy.BackupStrength
getWeaker()
Return the next weakest BackupStrength.protected boolean
isStrong(Member member1, Member member2)
Return true iff the specified members are mutually "strong".String
toString()
-
-
-
Field Detail
-
NODE_SAFE
protected static final int NODE_SAFE
Node-safety (members are different).- See Also:
- Constant Field Values
-
MACHINE_SAFE
protected static final int MACHINE_SAFE
Machine-safety (members are on different machines).- See Also:
- Constant Field Values
-
RACK_SAFE
protected static final int RACK_SAFE
Rack-safety (members are on different racks).- See Also:
- Constant Field Values
-
SITE_SAFE
protected static final int SITE_SAFE
Site-safety (members are on different sites).- See Also:
- Constant Field Values
-
m_nStrength
protected int m_nStrength
The strength (one of the *_SAFE constants).
-
m_setSites
protected Set m_setSites
The set of site names.
-
m_setRacks
protected Set m_setRacks
The set of rack names.
-
m_setMachines
protected Set m_setMachines
The set of machine names.
-
-
Constructor Detail
-
BackupStrength
protected BackupStrength(int nStrength, Set setSites, Set setRacks, Set setMachines)
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 Detail
-
getWeaker
protected SimpleAssignmentStrategy.BackupStrength getWeaker()
Return the next weakest BackupStrength.- Returns:
- a BackupStrength that is immediately weaker than this
-
isStrong
protected boolean isStrong(Member member1, Member member2)
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
public String getDescription()
Return a human-readable description string of this backup-strength.- Returns:
- a human-readable description string of this backup-strength
-
-