public class GridAffinityProcessor extends GridProcessorAdapter
GridComponent.DiscoveryDataExchangeTypectx, diagnosticLog| Constructor and Description |
|---|
GridAffinityProcessor(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
Object |
affinityKey(String cacheName,
Object key)
Gets affinity key for cache key.
|
<K> org.apache.ignite.internal.processors.affinity.GridAffinityProcessor.CacheAffinityProxy<K> |
affinityProxy(String cacheName) |
<K> Map<ClusterNode,Collection<K>> |
mapKeysToNodes(String cacheName,
Collection<? extends K> keys)
Maps keys to nodes for given cache.
|
<K> ClusterNode |
mapKeyToNode(String cacheName,
K key)
Maps single key to a node.
|
<K> ClusterNode |
mapKeyToNode(String cacheName,
K key,
AffinityTopologyVersion topVer)
Maps single key to a node.
|
<K> List<ClusterNode> |
mapKeyToPrimaryAndBackups(String cacheName,
K key,
AffinityTopologyVersion topVer)
Map single key to primary and backup nodes.
|
ClusterNode |
mapPartitionToNode(String cacheName,
int partId,
AffinityTopologyVersion topVer)
Maps partition to a node.
|
void |
onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.
|
void |
onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.
|
int |
partition(String cacheName,
Object key) |
int |
partition(String cacheName,
Object key,
org.apache.ignite.internal.processors.affinity.GridAffinityProcessor.AffinityInfo aff) |
int |
partition0(String cacheName,
Object key,
org.apache.ignite.internal.processors.affinity.GridAffinityProcessor.AffinityInfo aff) |
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
void |
removeCachedAffinity(AffinityTopologyVersion topVer)
Removes cached affinity instances with affinity topology versions less than
topVer. |
Object |
similaryAffinityKey(AffinityFunction aff,
IgnitePredicate<ClusterNode> nodeFilter,
int backups,
int parts) |
void |
start()
Starts grid component.
|
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onReconnected, stop, toString, validateNode, validateNodepublic GridAffinityProcessor(GridKernalContext ctx)
ctx - Context.public void start()
throws IgniteCheckedException
start in interface GridComponentstart in class GridProcessorAdapterIgniteCheckedException - Throws in case of any errors.public void onKernalStop(boolean cancel)
onKernalStop in interface GridComponentonKernalStop in class GridProcessorAdaptercancel - Flag indicating whether jobs should be canceled.public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
onDisconnected in interface GridComponentonDisconnected in class GridProcessorAdapterreconnectFut - Reconnect future.IgniteCheckedException - If failed.public int partition(String cacheName, Object key) throws IgniteCheckedException
cacheName - Cache name.key - Key.IgniteCheckedException - If failed.public int partition(String cacheName, Object key, @Nullable org.apache.ignite.internal.processors.affinity.GridAffinityProcessor.AffinityInfo aff) throws IgniteCheckedException
cacheName - Cache name (needed only if aff is not provided.key - Key.aff - Affinity information.IgniteCheckedException - If failed.public int partition0(String cacheName, Object key, @Nullable org.apache.ignite.internal.processors.affinity.GridAffinityProcessor.AffinityInfo aff) throws IgniteCheckedException
cacheName - Cache name (needed only if aff is not provided.key - Key.aff - Affinity.IgniteCheckedException - If failed.@Nullable public ClusterNode mapPartitionToNode(String cacheName, int partId, AffinityTopologyVersion topVer) throws IgniteCheckedException
cacheName - Cache name.partId - partition.topVer - Affinity topology version.IgniteCheckedException - If failed.public void removeCachedAffinity(AffinityTopologyVersion topVer)
topVer.topVer - topology version.public <K> Map<ClusterNode,Collection<K>> mapKeysToNodes(String cacheName, @Nullable Collection<? extends K> keys) throws IgniteCheckedException
cacheName - Cache name.keys - Keys to map.IgniteCheckedException - If failed.@Nullable public <K> ClusterNode mapKeyToNode(String cacheName, K key) throws IgniteCheckedException
cacheName - Cache name.key - Key to map.IgniteCheckedException - If failed.@Nullable public <K> ClusterNode mapKeyToNode(String cacheName, K key, AffinityTopologyVersion topVer) throws IgniteCheckedException
cacheName - Cache name.key - Key to map.IgniteCheckedException - If failed.public <K> List<ClusterNode> mapKeyToPrimaryAndBackups(String cacheName, K key, AffinityTopologyVersion topVer) throws IgniteCheckedException
cacheName - Cache name.key - Key to map.topVer - Topology version.IgniteCheckedException - If failed.@Nullable public Object affinityKey(String cacheName, @Nullable Object key) throws IgniteCheckedException
cacheName - Cache name.key - Cache key.IgniteCheckedException - In case of error.public <K> org.apache.ignite.internal.processors.affinity.GridAffinityProcessor.CacheAffinityProxy<K> affinityProxy(String cacheName)
cacheName - Cache name.public Object similaryAffinityKey(AffinityFunction aff, IgnitePredicate<ClusterNode> nodeFilter, int backups, int parts)
aff - Affinity function.nodeFilter - Node class.backups - Number of backups.parts - Number of partitions.public void printMemoryStats()
printMemoryStats in interface GridComponentprintMemoryStats in class GridProcessorAdapter
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019