public class GridCacheProcessor extends GridProcessorAdapter
GridComponent.DiscoveryDataExchangeTypectx, log| Constructor and Description |
|---|
GridCacheProcessor(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCacheConfiguration(CacheConfiguration cacheCfg) |
<K,V> IgniteInternalCache<K,V> |
atomicsCache()
Gets utility cache for atomic data structures.
|
void |
awaitStarted() |
void |
blockGateway(DynamicCacheChangeRequest req) |
void |
blockGateways()
Blocks all available gateways
|
<K,V> IgniteInternalCache<K,V> |
cache() |
<K,V> IgniteInternalCache<K,V> |
cache(String name) |
CacheConfiguration |
cacheConfiguration(String name)
Get configuration for the given cache.
|
DynamicCacheDescriptor |
cacheDescriptor(int cacheId) |
Collection<DynamicCacheDescriptor> |
cacheDescriptors() |
CacheMode |
cacheMode(String cacheName)
Gets cache mode.
|
Collection<String> |
cacheNames()
Gets a collection of currently started caches.
|
Collection<IgniteInternalCache<?,?>> |
caches() |
<T> T |
clone(T obj) |
Serializable |
collectDiscoveryData(UUID nodeId)
Gets discovery data object that will be sent to new node
during discovery process.
|
void |
completeStartFuture(DynamicCacheChangeRequest req) |
<K,V> GridCacheSharedContext<K,V> |
context() |
IgniteInternalFuture<?> |
createFromTemplate(String cacheName)
Dynamically starts cache using template configuration.
|
void |
createMissingCaches()
Starts client caches that do not exist yet.
|
GridComponent.DiscoveryDataExchangeType |
discoveryDataType()
Gets unique component type to distinguish components providing discovery data.
|
IgniteInternalFuture<?> |
dynamicCloseCache(String cacheName) |
IgniteInternalFuture<?> |
dynamicDestroyCache(String cacheName,
boolean checkThreadTx) |
IgniteInternalFuture<?> |
dynamicStartCache(CacheConfiguration ccfg,
String cacheName,
NearCacheConfiguration nearCfg,
boolean failIfExists,
boolean failIfNotStarted,
boolean checkThreadTx)
Dynamically starts cache.
|
IgniteInternalFuture<?> |
dynamicStartCache(CacheConfiguration ccfg,
String cacheName,
NearCacheConfiguration nearCfg,
CacheType cacheType,
boolean failIfExists,
boolean failIfNotStarted,
boolean checkThreadTx)
Dynamically starts cache.
|
IgniteInternalFuture<?> |
getOrCreateFromTemplate(String cacheName,
boolean checkThreadTx)
Dynamically starts cache using template configuration.
|
<K,V> IgniteInternalCache<K,V> |
getOrStartCache(String name) |
IgniteCacheProxy<?,?> |
getOrStartPublicCache(boolean start,
boolean inclLoc)
Gets public cache that can be used for query execution.
|
<K,V> GridCacheAdapter<K,V> |
internalCache() |
<K,V> GridCacheAdapter<K,V> |
internalCache(String name) |
Collection<GridCacheAdapter<?,?>> |
internalCaches() |
<K,V> IgniteCacheProxy<K,V> |
jcache(String name) |
Collection<IgniteCacheProxy<?,?>> |
jcaches() |
long |
lastDataVersion() |
GridCacheAdapter<Integer,String> |
marshallerCache() |
boolean |
onCustomEvent(DiscoveryCustomMessage msg,
AffinityTopologyVersion topVer)
Callback invoked from discovery thread when discovery custom message is received.
|
void |
onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.
|
void |
onDiscoveryDataReceived(UUID joiningNodeId,
UUID rmtNodeId,
Serializable data)
Receives discovery data object from remote nodes (called
on new node during discovery process).
|
void |
onDiscoveryEvent(int type,
ClusterNode node,
AffinityTopologyVersion topVer) |
void |
onEvictFromSwap(String spaceName,
byte[] keyBytes,
byte[] valBytes) |
void |
onExchangeDone(AffinityTopologyVersion topVer,
Collection<DynamicCacheChangeRequest> reqs,
Throwable err)
Callback invoked when first exchange future for dynamic cache is completed.
|
void |
onKernalStart()
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.
|
IgniteInternalFuture<?> |
onReconnected(boolean clusterRestarted)
Client reconnected callback.
|
void |
onUndeployed(ClassLoader ldr)
Callback invoked by deployment manager for whenever a class loader gets undeployed.
|
void |
prepareCacheStart(DynamicCacheChangeRequest req,
AffinityTopologyVersion topVer) |
void |
prepareCacheStop(DynamicCacheChangeRequest req) |
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) |
void |
start()
Starts grid component.
|
Collection<DynamicCacheDescriptor> |
startReceivedCaches(AffinityTopologyVersion topVer)
Starts statically configured caches received from remote nodes during exchange.
|
void |
stop(boolean cancel)
Stops grid component.
|
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 void start()
throws IgniteCheckedException
start in interface GridComponentstart in class GridProcessorAdapterIgniteCheckedException - Throws in case of any errors.public void onKernalStart()
throws IgniteCheckedException
onKernalStart in interface GridComponentonKernalStart in class GridProcessorAdapterIgniteCheckedException - 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 blockGateways()
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 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 void prepareCacheStart(DynamicCacheChangeRequest req, AffinityTopologyVersion topVer) throws IgniteCheckedException
req - Cache start request.topVer - Topology version.IgniteCheckedException - If failed.public Collection<DynamicCacheDescriptor> startReceivedCaches(AffinityTopologyVersion topVer) throws IgniteCheckedException
topVer - Topology version.IgniteCheckedException - If failed.public void blockGateway(DynamicCacheChangeRequest req)
req - Stop request.public void prepareCacheStop(DynamicCacheChangeRequest req)
req - Stop request.public void onExchangeDone(AffinityTopologyVersion topVer, Collection<DynamicCacheChangeRequest> reqs, Throwable err)
topVer - Completed topology version.reqs - Change requests.err - Error.public void completeStartFuture(DynamicCacheChangeRequest req)
req - Request to complete future for.@Nullable public GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectDiscoveryData(UUID).discoveryDataType in interface GridComponentdiscoveryDataType in class GridProcessorAdapter@Nullable public Serializable collectDiscoveryData(UUID nodeId)
collectDiscoveryData in interface GridComponentcollectDiscoveryData in class GridProcessorAdapternodeId - ID of new node that joins topology.null if there is nothing
to send for this component.public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Serializable data)
onDiscoveryDataReceived in interface GridComponentonDiscoveryDataReceived in class GridProcessorAdapterjoiningNodeId - Joining node ID.rmtNodeId - Remote node ID for which data is provided.data - Discovery data object or null if nothing waspublic 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 IgniteInternalFuture<?> 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<?> dynamicStartCache(@Nullable CacheConfiguration ccfg, String cacheName, @Nullable NearCacheConfiguration nearCfg, CacheType cacheType, boolean failIfExists, boolean failIfNotStarted, boolean checkThreadTx)
ccfg - Cache configuration.cacheName - Cache name.nearCfg - Near cache configuration.cacheType - Cache type.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<?> dynamicDestroyCache(String cacheName, boolean checkThreadTx)
cacheName - Cache name to destroy.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<?> dynamicCloseCache(String cacheName)
cacheName - Cache name to close.public void onDiscoveryEvent(int type,
ClusterNode node,
AffinityTopologyVersion topVer)
type - Event type.node - Event node.topVer - Topology version.public boolean onCustomEvent(DiscoveryCustomMessage msg, AffinityTopologyVersion topVer)
msg - Customer message.topVer - Current topology version.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 onEvictFromSwap(String spaceName, byte[] keyBytes, byte[] valBytes)
spaceName - Space name.keyBytes - Key bytes.valBytes - Value bytes.public long lastDataVersion()
public <K,V> IgniteInternalCache<K,V> cache()
K - type of keys.V - type of values.public <K,V> IgniteInternalCache<K,V> cache(@Nullable String name)
K - type of keys.V - type of values.name - Cache name.public <K,V> IgniteInternalCache<K,V> getOrStartCache(@Nullable String name) throws IgniteCheckedException
name - Cache name.IgniteCheckedException - If failed.public Collection<IgniteInternalCache<?,?>> caches()
public Collection<IgniteCacheProxy<?,?>> jcaches()
public GridCacheAdapter<Integer,String> marshallerCache()
public <K,V> IgniteInternalCache<K,V> utilityCache()
public <K,V> IgniteInternalCache<K,V> atomicsCache()
public <K,V> IgniteInternalCache<K,V> publicCache(@Nullable String name)
K - type of keys.V - type of values.name - Cache name.public <K,V> IgniteCacheProxy<K,V> publicJCache(@Nullable 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(@Nullable 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 Collection<DynamicCacheDescriptor> cacheDescriptors()
@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(@Nullable String name)
name - Cache name.public Collection<IgniteCacheProxy<?,?>> publicCaches()
public <K,V> GridCacheAdapter<K,V> internalCache()
K - type of keys.V - type of values.public <K,V> GridCacheAdapter<K,V> internalCache(@Nullable String name)
K - type of keys.V - type of values.name - Cache name.public Collection<GridCacheAdapter<?,?>> internalCaches()
public boolean systemCache(@Nullable 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 createMissingCaches()
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. 1.6.0 Release Date : May 18 2016