|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.cluster.TerracottaClusterInfo
public class TerracottaClusterInfo
| Constructor Summary | |
|---|---|
TerracottaClusterInfo()
|
|
| Method Summary | ||
|---|---|---|
void |
addClusterListener(ClusterListener listener)
Adds a cluster events listener. |
|
boolean |
areOperationsEnabled()
Indicates whether operations are enabled on the current node. |
|
ClusterTopology |
getClusterTopology()
Retrieves a view of the topology of the cluster, as seen from the current node. |
|
ClusterNode |
getCurrentNode()
Retrieves the ClusterNode instance that corresponds to the current node. |
|
|
getKeysForLocalValues(Map<K,?> map)
Retrieve a set of keys for map values that are faulted on the current node out of a clustered map for which partialness is supported. |
|
|
getKeysForOrphanedValues(Map<K,?> map)
Retrieve a set of keys for map values that are not faulted anywhere out of a clustered map for which partialness is supported. |
|
|
getNodesWithKeys(Map<K,?> map,
Collection<? extends K> keys)
|
|
Map<?,Set<ClusterNode>> |
getNodesWithObjects(Collection<?> objects)
Determine where a collection of clustered objects is faulted. |
|
String |
getUniversallyUniqueClientID()
Returns a universally unique identifier for the life-time of this client in the cluster. |
|
boolean |
isClusterInitialized()
Indicates whether the cluster infrastructure was initialized when this info instance was created. |
|
boolean |
isNodeJoined()
Indicates whether the current node has joined the cluster. |
|
void |
removeClusterListener(ClusterListener listener)
Removes a cluster events listener. |
|
ClusterNode |
waitUntilNodeJoinsCluster()
Waits until the current node has successfully joined the cluster. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TerracottaClusterInfo()
| Method Detail |
|---|
public boolean isClusterInitialized()
ClusterInfoNote that a cluster needs to be initialized for any of the other methods to function. If there's a chance that the code that's using this cluster info instance is using it with an uninitialized cluster infrastructure, the return value of this method should be checked before using the cluster info.
isClusterInitialized in interface ClusterInfotrue when the cluster was initialized; or false when this was not the casepublic String getUniversallyUniqueClientID()
ClusterInfoIt will be the same for the entire life-time of this cluster client. However once the client is restarted, this identifier will be different. No two identifiers will ever be the same for different life-times or for different clients.
getUniversallyUniqueClientID in interface ClusterInfopublic void addClusterListener(ClusterListener listener)
ClusterInfoIf the cluster events listener instance has already been registered before, this method will not register it again.
When the cluster is already joined or the operations have already been enabled, those events will be immediately triggered on the listener when it's registered.
addClusterListener in interface ClusterInfolistener - the cluster listener instance that will be registeredpublic boolean areOperationsEnabled()
ClusterInfo
areOperationsEnabled in interface ClusterInfotrue if operations are enabled on the current node; false otherwisepublic ClusterTopology getClusterTopology()
ClusterInfo
Note that the returned topology instance will be updated internally as nodes joined and leave the cluster. If you
want a snapshot of the current nodes in the cluster, you should use the
ClusterTopology.getNodes() method.
getClusterTopology in interface ClusterInfopublic ClusterNode getCurrentNode()
ClusterInfoClusterNode instance that corresponds to the current node.
getCurrentNode in interface ClusterInfoClusterNode instance that corresponds to the current node
public <K> Set<K> getKeysForLocalValues(Map<K,?> map)
throws UnclusteredObjectException
ClusterInfo
getKeysForLocalValues in interface ClusterInfomap - the map with the values that will be checked
an empty set if the map doesn't support partialness;
this never returns null, so null checks aren't needed
UnclusteredObjectException - when the map isn't clustered
public <K> Set<K> getKeysForOrphanedValues(Map<K,?> map)
throws UnclusteredObjectException
ClusterInfo
getKeysForOrphanedValues in interface ClusterInfomap - the map with the values that will be checked
an empty set if the map doesn't support partialness;
this never returns null, so null checks aren't needed
UnclusteredObjectException - when the map isn't clustered
public <K> Map<K,Set<ClusterNode>> getNodesWithKeys(Map<K,?> map,
Collection<? extends K> keys)
public Map<?,Set<ClusterNode>> getNodesWithObjects(Collection<?> objects)
throws UnclusteredObjectException
ClusterInfoEach object will be a key in the map that is returned, with sets of nodes as values that indicate where the objects are faulted.
getNodesWithObjects in interface ClusterInfoobjects - the objects that will be checked
this never returns null, so null checks aren't needed
UnclusteredObjectException - when any of the objects isn't clusteredpublic boolean isNodeJoined()
ClusterInfo
isNodeJoined in interface ClusterInfotrue if the current node has joined the cluster; false otherwisepublic void removeClusterListener(ClusterListener listener)
ClusterInfoIf the cluster events listener instance was not registered before, this method will have no effect.
removeClusterListener in interface ClusterInfolistener - the cluster listener instance that will be unregisteredpublic ClusterNode waitUntilNodeJoinsCluster()
ClusterInfo
waitUntilNodeJoinsCluster in interface ClusterInfoClusterNode instance that corresponds to the current node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||