public class GridCacheProcessor extends GridProcessorAdapter
GridComponent.DiscoveryDataExchangeTypectx, diagnosticLog, log| Constructor and Description |
|---|
GridCacheProcessor(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCacheConfiguration(CacheConfiguration cacheCfg) |
void |
awaitStarted() |
void |
blockGateways()
Blocks all available gateways
|
<K,V> IgniteInternalCache<K,V> |
cache(String name) |
CacheConfiguration |
cacheConfiguration(String name)
Get configuration for the given cache.
|
DynamicCacheDescriptor |
cacheDescriptor(int cacheId) |
DynamicCacheDescriptor |
cacheDescriptor(String name)
Get registered cache descriptor.
|
Map<String,DynamicCacheDescriptor> |
cacheDescriptors() |
CacheGroupContext |
cacheGroup(int grpId) |
Map<Integer,CacheGroupDescriptor> |
cacheGroupDescriptors() |
Collection<CacheGroupContext> |
cacheGroups() |
CacheMode |
cacheMode(String cacheName)
Gets cache mode.
|
Collection<String> |
cacheNames()
Gets a collection of currently started caches.
|
Collection<IgniteInternalCache<?,?>> |
caches() |
List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> |
cachesToStartOnLocalJoin() |
CacheType |
cacheType(String cacheName) |
<T> T |
clone(T obj) |
void |
collectGridNodeData(DiscoveryDataBag dataBag)
Collects discovery data on nodes already in grid on receiving
TcpDiscoveryNodeAddedMessage. |
void |
collectJoiningNodeData(DiscoveryDataBag dataBag)
Collects discovery data on joining node before sending
TcpDiscoveryJoinRequestMessage request. |
<K,V> GridCacheSharedContext<K,V> |
context() |
IgniteInternalFuture<?> |
createFromTemplate(String cacheName)
Dynamically starts cache using template configuration.
|
void |
createMissingQueryCaches()
Starts client caches that do not exist yet.
|
GridComponent.DiscoveryDataExchangeType |
discoveryDataType()
Gets unique component type to distinguish components providing discovery data.
|
IgniteInternalFuture<Boolean> |
dynamicDestroyCache(String cacheName,
boolean sql,
boolean checkThreadTx,
boolean restart) |
IgniteInternalFuture<?> |
dynamicDestroyCaches(Collection<String> cacheNames,
boolean checkThreadTx,
boolean restart) |
IgniteInternalFuture<?> |
dynamicDestroyCaches(Collection<String> cacheNames,
boolean checkThreadTx,
boolean restart,
boolean destroy) |
IgniteInternalFuture<Boolean> |
dynamicStartCache(CacheConfiguration ccfg,
String cacheName,
NearCacheConfiguration nearCfg,
boolean failIfExists,
boolean failIfNotStarted,
boolean checkThreadTx)
Dynamically starts cache.
|
IgniteInternalFuture<Boolean> |
dynamicStartCache(CacheConfiguration ccfg,
String cacheName,
NearCacheConfiguration nearCfg,
CacheType cacheType,
boolean sql,
boolean failIfExists,
boolean failIfNotStarted,
boolean checkThreadTx)
Dynamically starts cache.
|
IgniteInternalFuture<?> |
dynamicStartCaches(Collection<CacheConfiguration> ccfgList,
boolean failIfExists,
boolean checkThreadTx)
Dynamically starts multiple caches.
|
IgniteInternalFuture<Boolean> |
dynamicStartSqlCache(CacheConfiguration ccfg)
Dynamically starts cache as a result of SQL
CREATE TABLE command. |
CachePartitionExchangeWorkerTask |
exchangeTaskForCustomDiscoveryMessage(DiscoveryCustomMessage msg)
Create exchange worker task for custom discovery message.
|
CacheConfiguration |
getConfigFromTemplate(String cacheName) |
IgniteInternalFuture<?> |
getOrCreateFromTemplate(String cacheName,
boolean checkThreadTx)
Dynamically starts cache using template configuration.
|
<K,V> IgniteInternalCache<K,V> |
getOrStartCache(String name) |
<K,V> IgniteInternalCache<K,V> |
getOrStartCache(String name,
CacheConfiguration ccfg) |
IgniteCacheProxy<?,?> |
getOrStartPublicCache(boolean start,
boolean inclLoc)
Gets public cache that can be used for query execution.
|
<K,V> GridCacheAdapter<K,V> |
internalCache(String name) |
Collection<GridCacheAdapter<?,?>> |
internalCaches() |
<K,V> IgniteCacheProxy<K,V> |
jcache(String name) |
IgniteCacheProxy |
jcacheProxy(String name) |
Collection<IgniteCacheProxy<?,?>> |
jcaches() |
long |
lastDataVersion() |
boolean |
onCustomEvent(DiscoveryCustomMessage msg,
AffinityTopologyVersion topVer,
ClusterNode node)
Callback invoked from discovery thread when discovery custom message is received.
|
void |
onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.
|
void |
onDiscoveryEvent(int type,
DiscoveryCustomMessage customMsg,
ClusterNode node,
AffinityTopologyVersion topVer,
DiscoveryDataClusterState state) |
void |
onExchangeDone(AffinityTopologyVersion topVer,
ExchangeActions exchActions,
Throwable err)
Callback invoked when first exchange future for dynamic cache is completed.
|
void |
onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
Receives discovery data object from remote nodes (called
on new node during discovery process).
|
void |
onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
Method is called on nodes that are already in grid (not on joining node).
|
void |
onKernalStart(boolean active)
Callback that notifies that kernal has successfully started,
including all managers and processors.
|
void |
onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.
|
void |
onKernalStopCaches(boolean cancel) |
IgniteInternalFuture<?> |
onReconnected(boolean clusterRestarted)
Client reconnected callback.
|
void |
onStateChangeFinish(ChangeGlobalStateFinishMessage msg) |
ExchangeActions |
onStateChangeRequest(ChangeGlobalStateMessage msg,
AffinityTopologyVersion topVer) |
void |
onUndeployed(ClassLoader ldr)
Callback invoked by deployment manager for whenever a class loader gets undeployed.
|
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
<K,V> IgniteInternalCache<K,V> |
publicCache(String name) |
Collection<String> |
publicCacheNames()
Gets a collection of currently started public cache names.
|
Collection<IgniteCacheProxy<?,?>> |
publicCaches() |
<K,V> IgniteCacheProxy<K,V> |
publicJCache(String cacheName) |
<K,V> IgniteCacheProxy<K,V> |
publicJCache(String cacheName,
boolean failIfNotStarted,
boolean checkThreadTx) |
IgniteInternalFuture<?> |
resetCacheState(Collection<String> cacheNames)
Resets cache state after the cache has been moved to recovery state.
|
void |
resetRestartingCaches()
Reset restarting caches.
|
void |
start()
Starts grid component.
|
void |
startCachesOnLocalJoin(List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> caches,
AffinityTopologyVersion exchTopVer) |
Collection<DynamicCacheDescriptor> |
startReceivedCaches(UUID nodeId,
AffinityTopologyVersion exchTopVer)
Starts statically configured caches received from remote nodes during exchange.
|
void |
stop(boolean cancel)
Stops grid component.
|
void |
stopCaches(boolean cancel) |
boolean |
systemCache(String name) |
IgniteTransactionsEx |
transactions() |
<K,V> IgniteInternalCache<K,V> |
utilityCache()
Gets utility cache.
|
IgniteNodeValidationResult |
validateNode(ClusterNode node)
Validates that new node can join grid topology, this method is called on coordinator
node before new node joins topology.
|
assertParameter, toStringpublic GridCacheProcessor(GridKernalContext ctx)
ctx - Kernal context.public CachePartitionExchangeWorkerTask exchangeTaskForCustomDiscoveryMessage(DiscoveryCustomMessage msg)
msg - Custom discovery message.null if message doesn't require any special processing.public void start()
throws IgniteCheckedException
start in interface GridComponentstart in class GridProcessorAdapterIgniteCheckedException - Throws in case of any errors.@Nullable public CacheGroupContext cacheGroup(int grpId)
grpId - Group ID.public Collection<CacheGroupContext> cacheGroups()
public void onKernalStart(boolean active)
throws IgniteCheckedException
onKernalStart in interface GridComponentonKernalStart in class GridProcessorAdapteractive - Cluster active flag (note: should be used carefully since state can
change concurrently).IgniteCheckedException - Thrown in case of any errors.public void stop(boolean cancel)
throws IgniteCheckedException
stop in interface GridComponentstop in class GridProcessorAdaptercancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException - Thrown in case of any errors.public void stopCaches(boolean cancel)
cancel - Cancel.public void blockGateways()
public void onKernalStop(boolean cancel)
onKernalStop in interface GridComponentonKernalStop in class GridProcessorAdaptercancel - Flag indicating whether jobs should be canceled.public void onKernalStopCaches(boolean cancel)
cancel - Cancel.public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
onDisconnected in interface GridComponentonDisconnected in class GridProcessorAdapterreconnectFut - Reconnect future.IgniteCheckedException - If failed.public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted) throws IgniteCheckedException
onReconnected in interface GridComponentonReconnected in class GridProcessorAdapterclusterRestarted - Cluster restarted flag.IgniteCheckedException - If failed.public void awaitStarted()
throws IgniteCheckedException
IgniteCheckedException - If failed to wait.public Collection<String> cacheNames()
public IgniteCacheProxy<?,?> getOrStartPublicCache(boolean start, boolean inclLoc) throws IgniteCheckedException
start - Start cache.inclLoc - Include local caches.null if there is no suitable cache.IgniteCheckedExceptionpublic Collection<String> publicCacheNames()
public CacheMode cacheMode(String cacheName)
cacheName - Cache name to check.public List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> cachesToStartOnLocalJoin()
public void startCachesOnLocalJoin(List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> caches, AffinityTopologyVersion exchTopVer) throws IgniteCheckedException
caches - Caches to start.exchTopVer - Current exchange version.IgniteCheckedException - If failed.public Collection<DynamicCacheDescriptor> startReceivedCaches(UUID nodeId, AffinityTopologyVersion exchTopVer) throws IgniteCheckedException
nodeId - Joining node ID.exchTopVer - Current exchange version.IgniteCheckedException - If failed.public void onExchangeDone(AffinityTopologyVersion topVer, @Nullable ExchangeActions exchActions, @Nullable Throwable err)
topVer - Completed topology version.exchActions - Change requests.err - Error.@Nullable public GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectJoiningNodeData(DiscoveryDataBag)
or GridComponent.collectGridNodeData(DiscoveryDataBag).discoveryDataType in interface GridComponentdiscoveryDataType in class GridProcessorAdapterpublic void collectJoiningNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryJoinRequestMessage request.collectJoiningNodeData in interface GridComponentcollectJoiningNodeData in class GridProcessorAdapterdataBag - container object to store discovery data in.public void collectGridNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryNodeAddedMessage.collectGridNodeData in interface GridComponentcollectGridNodeData in class GridProcessorAdapterdataBag - container object to store discovery data in.public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
onJoiningNodeDataReceived in interface GridComponentonJoiningNodeDataReceived in class GridProcessorAdapterdata - DiscoveryDataBag.JoiningNodeDiscoveryData interface to retrieve discovery data of joining node.public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
onGridDataReceived in interface GridComponentonGridDataReceived in class GridProcessorAdapterdata - DiscoveryDataBag.GridDiscoveryData interface to retrieve discovery data collected on remote nodes
(data common for all nodes in grid and specific for each node).public void onStateChangeFinish(ChangeGlobalStateFinishMessage msg)
msg - Message.public ExchangeActions onStateChangeRequest(ChangeGlobalStateMessage msg, AffinityTopologyVersion topVer) throws IgniteCheckedException
msg - Message.topVer - Current topology version.IgniteCheckedException - If configuration validation failed.public IgniteInternalFuture<?> createFromTemplate(String cacheName)
cacheName - Cache name.public IgniteInternalFuture<?> getOrCreateFromTemplate(String cacheName, boolean checkThreadTx)
cacheName - Cache name.checkThreadTx - If true checks that current thread does not have active transactions.public CacheConfiguration getConfigFromTemplate(String cacheName) throws IgniteCheckedException
cacheName - Cache name.null if no template with matching name found.IgniteCheckedException - If failed.public IgniteInternalFuture<Boolean> dynamicStartCache(@Nullable CacheConfiguration ccfg, String cacheName, @Nullable NearCacheConfiguration nearCfg, boolean failIfExists, boolean failIfNotStarted, boolean checkThreadTx)
ccfg - Cache configuration.cacheName - Cache name.nearCfg - Near cache configuration.failIfExists - Fail if exists flag.failIfNotStarted - If true fails if cache is not started.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<Boolean> dynamicStartSqlCache(CacheConfiguration ccfg)
CREATE TABLE command.ccfg - Cache configuration.public IgniteInternalFuture<Boolean> dynamicStartCache(@Nullable CacheConfiguration ccfg, String cacheName, @Nullable NearCacheConfiguration nearCfg, CacheType cacheType, boolean sql, boolean failIfExists, boolean failIfNotStarted, boolean checkThreadTx)
ccfg - Cache configuration.cacheName - Cache name.nearCfg - Near cache configuration.cacheType - Cache type.sql - If the cache needs to be created as the result of SQL CREATE TABLE command.failIfExists - Fail if exists flag.failIfNotStarted - If true fails if cache is not started.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<?> dynamicStartCaches(Collection<CacheConfiguration> ccfgList, boolean failIfExists, boolean checkThreadTx)
ccfgList - Collection of cache configuration.failIfExists - Fail if exists flag.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<Boolean> dynamicDestroyCache(String cacheName, boolean sql, boolean checkThreadTx, boolean restart)
cacheName - Cache name to destroy.sql - If the cache needs to be destroyed only if it was created as the result of SQL CREATE TABLE
command.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<?> dynamicDestroyCaches(Collection<String> cacheNames, boolean checkThreadTx, boolean restart)
cacheNames - Collection of cache names to destroy.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<?> dynamicDestroyCaches(Collection<String> cacheNames, boolean checkThreadTx, boolean restart, boolean destroy)
cacheNames - Collection of cache names to destroy.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<?> resetCacheState(Collection<String> cacheNames)
cacheNames - Cache names.public void onDiscoveryEvent(int type,
@Nullable
DiscoveryCustomMessage customMsg,
ClusterNode node,
AffinityTopologyVersion topVer,
DiscoveryDataClusterState state)
type - Event type.customMsg - Custom message instance.node - Event node.topVer - Topology version.state - Cluster state.public boolean onCustomEvent(DiscoveryCustomMessage msg, AffinityTopologyVersion topVer, ClusterNode node)
msg - Customer message.topVer - Current topology version.node - Node sent message.True if minor topology version should be increased.@Nullable public IgniteNodeValidationResult validateNode(ClusterNode node)
validateNode in interface GridComponentvalidateNode in class GridProcessorAdapternode - Joining node.null in case of success.public void resetRestartingCaches()
public long lastDataVersion()
public <K,V> IgniteInternalCache<K,V> cache(String name)
K - type of keys.V - type of values.name - Cache name.public <K,V> IgniteInternalCache<K,V> getOrStartCache(String name) throws IgniteCheckedException
name - Cache name.IgniteCheckedException - If failed.public <K,V> IgniteInternalCache<K,V> getOrStartCache(String name, CacheConfiguration ccfg) throws IgniteCheckedException
name - Cache name.IgniteCheckedException - If failed.public Collection<IgniteInternalCache<?,?>> caches()
public Collection<IgniteCacheProxy<?,?>> jcaches()
public <K,V> IgniteInternalCache<K,V> utilityCache()
public <K,V> IgniteInternalCache<K,V> publicCache(String name)
K - type of keys.V - type of values.name - Cache name.public <K,V> IgniteCacheProxy<K,V> publicJCache(String cacheName) throws IgniteCheckedException
K - type of keys.V - type of values.cacheName - Cache name.IgniteCheckedException - If failed.@Nullable public <K,V> IgniteCacheProxy<K,V> publicJCache(String cacheName, boolean failIfNotStarted, boolean checkThreadTx) throws IgniteCheckedException
cacheName - Cache name.failIfNotStarted - If true throws IllegalArgumentException if cache is not started,
otherwise returns null in this case.checkThreadTx - If true checks that current thread does not have active transactions.IgniteCheckedException - If failed.public CacheConfiguration cacheConfiguration(String name)
name - Cache name.public DynamicCacheDescriptor cacheDescriptor(String name)
name - Name.public Map<String,DynamicCacheDescriptor> cacheDescriptors()
public Map<Integer,CacheGroupDescriptor> cacheGroupDescriptors()
@Nullable public DynamicCacheDescriptor cacheDescriptor(int cacheId)
cacheId - Cache ID.public void addCacheConfiguration(CacheConfiguration cacheCfg) throws IgniteCheckedException
cacheCfg - Cache configuration template.IgniteCheckedException - If failed.public <K,V> IgniteCacheProxy<K,V> jcache(String name)
name - Cache name.@Nullable public IgniteCacheProxy jcacheProxy(String name)
name - Cache name.public Collection<IgniteCacheProxy<?,?>> publicCaches()
public <K,V> GridCacheAdapter<K,V> internalCache(String name)
K - type of keys.V - type of values.name - Cache name.public Collection<GridCacheAdapter<?,?>> internalCaches()
public boolean systemCache(String name)
name - Cache name.True if specified cache is system, false otherwise.public void printMemoryStats()
printMemoryStats in interface GridComponentprintMemoryStats in class GridProcessorAdapterpublic void onUndeployed(ClassLoader ldr)
ldr - Class loader.public <K,V> GridCacheSharedContext<K,V> context()
public IgniteTransactionsEx transactions()
public void createMissingQueryCaches()
throws IgniteCheckedException
IgniteCheckedException - In case of error.public <T> T clone(T obj)
throws IgniteCheckedException
obj - Object to clone.IgniteCheckedException - If failed.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017