public class IgniteKernal extends Object implements IgniteEx, IgniteMXBean, Externalizable
Ignite which is expanded by additional
methods of IgniteEx for the internal Ignite needs. It also controls the Ignite life cycle, checks
thread pools state for starvation, detects long JVM pauses and prints out the local node metrics.
Please, refer to the wiki http://en.wikipedia.org/wiki/Kernal for the information on the misspelling.
start(org.apache.ignite.configuration.IgniteConfiguration, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, org.apache.ignite.internal.util.StripedExecutor, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, org.apache.ignite.internal.util.StripedExecutor, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, org.apache.ignite.thread.IgniteStripedThreadPoolExecutor, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, java.util.concurrent.ExecutorService, org.apache.ignite.thread.IgniteStripedThreadPoolExecutor, java.util.Map<java.lang.String, ? extends java.util.concurrent.ExecutorService>, org.apache.ignite.internal.util.lang.GridAbsClosure, org.apache.ignite.internal.worker.WorkersRegistry, java.lang.Thread.UncaughtExceptionHandler, org.apache.ignite.internal.util.TimeBag).
It starts internal Ignite components (see GridComponent), for instance:
GridManager - a layer of indirection between kernal and SPI modules.GridProcessor - an objects responsible for particular internal process implementation.IgnitePlugin - an Ignite addition of user-provided functionality.start method also performs additional validation of the provided IgniteConfiguration and
prints some suggestions such as:
EventType events).JvmConfigurationSuggestions optimizations.OsConfigurationSuggestions optimizations.stop(boolean) method is used. The cancel argument of this method is used:
true value. To interrupt all currently acitve GridComponents related to the Ignite node.
For instance, ComputeJob will be interrupted by calling ComputeJob.cancel() method. Note that just
like with Thread.interrupt(), it is up to the actual job to exit from execution.false value. To stop the Ignite node gracefully. All jobs currently running will not be interrupted.
The Ignite node will wait for the completion of all GridComponents running on it before stopping.
| Modifier and Type | Field and Description |
|---|---|
static String |
COORDINATOR_PROPERTIES_SEPARATOR
The separator is used for coordinator properties formatted as a string.
|
static boolean |
DFLT_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED |
static boolean |
DFLT_LOG_CLASSPATH_CONTENT_ON_STARTUP |
static long |
DFLT_LONG_OPERATIONS_DUMP_TIMEOUT
Default timeout in milliseconds for dumping long running operations.
|
static long |
DFLT_PERIODIC_STARVATION_CHECK_FREQ
Default interval of checking thread pool state for the starvation.
|
static String |
SITE
Ignite web-site that is shown in log messages.
|
ACTIVE_DESC, CHECKPOINT_SPI_FORMATTED_DESC, CLUSTER_STATE_DESC, COLLISION_SPI_FORMATTED_DESC, COMMUNICATION_SPI_FORMATTED_DESC, COPYRIGHT_DESC, CUR_COORDINATOR_FORMATTED_DESC, DEPLOYMENT_SPI_FORMATTED_DESC, DISCOVERY_SPI_FORMATTED_DESC, EVT_STORAGE_SPI_FORMATTED_DESC, EXECUTOR_SRVC_FORMATTED_DESC, FAILOVER_SPI_FORMATTED_DESC, FULL_VER_DESC, GRID_LOG_FORMATTED_DESC, IGNITE_HOME_DESC, INSTANCE_NAME_DESC, IS_NODE_BASELINE_DESC, IS_PEER_CLS_LOADING_ENABLED_DESC, IS_REBALANCE_ENABLED_DESC, JDK_INFO_DESC, LAST_CLUSTER_STATE_CHANGE_TIME_DESC, LIFECYCLE_BEANS_FORMATTED_DESC, LOAD_BALANCING_SPI_FORMATTED_DESC, LOC_NODE_ID_DESC, LONG_JVM_PAUSE_LAST_EVENTS_DESC, LONG_JVM_PAUSES_CNT_DESC, LONG_JVM_PAUSES_TOTAL_DURATION_DESC, MBEAN_SERVER_FORMATTED_DESC, OS_INFO_DESC, OS_USER_DESC, READ_ONLY_MODE_DESC, READ_ONLY_MODE_DURATION_DESC, START_TIMESTAMP_DESC, START_TIMESTAMP_FORMATTED_DESC, UPTIME_DESC, UPTIME_FORMATTED_DESC, USER_ATTRS_FORMATTED_DESC, VM_NAME_DESC| Constructor and Description |
|---|
IgniteKernal()
No-arg constructor is required by externalization.
|
IgniteKernal(@Nullable GridSpringResourceContext rsrcCtx) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
active()
Checks Ignite grid is active or not active.
|
void |
active(boolean active)
Changes Ignite grid state to active or inactive.
|
<K,V> void |
addCacheConfiguration(CacheConfiguration<K,V> cacheCfg)
Adds cache configuration template.
|
<K> Affinity<K> |
affinity(String cacheName)
Gets affinity service to provide information about data partitioning and distribution.
|
boolean |
allEventsUserRecordable(int[] types)
Checks whether all provided events are user-recordable.
|
@Nullable IgniteAtomicLong |
atomicLong(String name,
AtomicConfiguration cfg,
long initVal,
boolean create)
Will get a atomic long from cache and create one if it has not been created yet and
create flag
is true. |
@Nullable IgniteAtomicLong |
atomicLong(String name,
long initVal,
boolean create)
Will get a atomic long from cache and create one if it has not been created yet and
create flag
is true. |
<T> IgniteAtomicReference<T> |
atomicReference(String name,
AtomicConfiguration cfg,
T initVal,
boolean create)
Will get a atomic reference from cache and create one if it has not been created yet and
create flag
is true. |
<T> @Nullable IgniteAtomicReference<T> |
atomicReference(String name,
T initVal,
boolean create)
Will get a atomic reference from cache and create one if it has not been created yet and
create flag
is true. |
@Nullable IgniteAtomicSequence |
atomicSequence(String name,
AtomicConfiguration cfg,
long initVal,
boolean create)
Will get an atomic sequence from cache and create one if it has not been created yet and
create flag
is true. |
@Nullable IgniteAtomicSequence |
atomicSequence(String name,
long initVal,
boolean create)
Will get an atomic sequence from cache and create one if it has not been created yet and
create flag
is true. |
<T,S> IgniteAtomicStamped<T,S> |
atomicStamped(String name,
AtomicConfiguration cfg,
T initVal,
S initStamp,
boolean create)
Will get a atomic stamped from cache and create one if it has not been created yet and
create flag
is true. |
<T,S> @Nullable IgniteAtomicStamped<T,S> |
atomicStamped(String name,
T initVal,
S initStamp,
boolean create)
Will get a atomic stamped from cache and create one if it has not been created yet and
create flag
is true. |
IgniteBinary |
binary()
Gets an instance of
IgniteBinary interface. |
<K,V> IgniteCache<K,V> |
cache(String name)
Gets an instance of
IgniteCache API for the given name if one is configured or null otherwise. |
Collection<String> |
cacheNames()
Gets the collection of names of currently available caches.
|
Collection<IgniteCacheProxy<?,?>> |
caches() |
Collection<IgniteInternalCache<?,?>> |
cachesx(IgnitePredicate<? super IgniteInternalCache<?,?>>[] p)
Gets configured cache instance that satisfy all provided predicates including non-public caches.
|
<K,V> IgniteInternalCache<K,V> |
cachex(String name)
Gets the cache instance for the given name if one is configured or
null otherwise returning even non-public caches.
|
void |
clearNodeLocalMap()
Clears node local map.
|
void |
close()
Closes
this instance of grid. |
IgniteClusterEx |
cluster()
Gets an instance of
IgniteCluster interface. |
String |
clusterState()
Checks cluster state.
|
void |
clusterState(String state)
Changes current cluster state.
|
IgniteCompute |
compute()
Gets
compute facade over all cluster nodes started in server mode. |
IgniteCompute |
compute(ClusterGroup grp)
Gets
compute facade over the specified cluster group. |
IgniteConfiguration |
configuration()
Gets the configuration of this Ignite instance.
|
GridKernalContext |
context()
It's intended for use by internal marshalling implementation only.
|
@Nullable IgniteCountDownLatch |
countDownLatch(String name,
int cnt,
boolean autoDel,
boolean create)
Gets or creates count down latch.
|
<K,V> IgniteCache<K,V> |
createCache(CacheConfiguration<K,V> cacheCfg)
Dynamically starts new cache with the given cache configuration.
|
<K,V> IgniteCache<K,V> |
createCache(CacheConfiguration<K,V> cacheCfg,
NearCacheConfiguration<K,V> nearCfg)
Dynamically starts new cache with the given cache configuration.
|
<K,V> IgniteCache<K,V> |
createCache(String cacheName)
Dynamically starts new cache using template configuration.
|
Collection<IgniteCache> |
createCaches(Collection<CacheConfiguration> cacheCfgs)
Dynamically starts new caches with the given cache configurations.
|
<K,V> IgniteCache<K,V> |
createNearCache(String cacheName,
NearCacheConfiguration<K,V> nearCfg)
Starts a near cache on local node if cache was previously started with one of the
Ignite.createCache(CacheConfiguration) or Ignite.createCache(CacheConfiguration, NearCacheConfiguration)
methods. |
Collection<DataRegionMetrics> |
dataRegionMetrics()
Returns a collection of
DataRegionMetrics that reflects page memory usage on this Apache Ignite node
instance. |
@Nullable DataRegionMetrics |
dataRegionMetrics(String memPlcName)
Returns the latest
DataRegionMetrics snapshot for the memory region of the given name. |
DataStorageMetrics |
dataStorageMetrics() |
static String |
dataStorageReport(IgniteCacheDatabaseSharedManager db,
boolean includeMemoryStatistics) |
<K,V> IgniteDataStreamer<K,V> |
dataStreamer(String cacheName)
Gets a new instance of data streamer associated with given cache name.
|
void |
destroyCache(String cacheName)
Destroys a cache with the given name and cleans data that was written to the cache.
|
boolean |
destroyCache0(String cacheName,
boolean sql)
Stops dynamically started cache.
|
IgniteInternalFuture<Boolean> |
destroyCacheAsync(String cacheName,
boolean sql,
boolean checkThreadTx) |
void |
destroyCaches(Collection<String> cacheNames)
Destroys caches with the given names and cleans data that was written to the caches.
|
IgniteInternalFuture<?> |
destroyCachesAsync(Collection<String> cacheNames,
boolean checkThreadTx) |
void |
dumpDebugInfo()
Dumps debug information for the current node.
|
IgniteEncryption |
encryption()
Gets an instance of
IgniteEncryption interface. |
IgniteEvents |
events()
Gets
events facade over all cluster nodes. |
IgniteEvents |
events(ClusterGroup grp)
Gets
events facade over nodes within the cluster group. |
boolean |
eventUserRecordable(int type)
Checks if the event type is user-recordable.
|
String |
executeTask(String taskName,
String arg)
A shortcut method that executes given task assuming single
java.lang.String argument
and java.lang.String return type. |
ExecutorService |
executorService()
Creates a new
ExecutorService which will execute all submitted
Callable and Runnable jobs on all cluster nodes. |
ExecutorService |
executorService(ClusterGroup grp)
Creates a new
ExecutorService which will execute all submitted
Callable and Runnable jobs on nodes in the specified cluster group. |
<K,V> IgniteInternalCache<K,V> |
getCache(String name) |
String |
getCheckpointSpiFormatted()
Gets a formatted instance of configured checkpoint SPI implementation.
|
String |
getCollisionSpiFormatted()
Gets a formatted instance of configured collision SPI implementations.
|
String |
getCommunicationSpiFormatted()
Gets a formatted instance of fully configured SPI communication implementation.
|
String |
getCopyright()
Gets copyright statement for Ignite product.
|
String |
getCurrentCoordinatorFormatted()
Gets a formatted properties of current coordinator.
|
String |
getDeploymentSpiFormatted()
Gets a formatted instance of fully configured deployment SPI implementation.
|
String |
getDiscoverySpiFormatted()
Gets a formatted instance of configured discovery SPI implementation.
|
String |
getEventStorageSpiFormatted()
Gets a formatted instance of fully configured event SPI implementation.
|
String |
getExecutorServiceFormatted()
Gets a formatted instance of fully configured thread pool that is used in grid.
|
String |
getFailoverSpiFormatted()
Gets a formatted instance of fully configured failover SPI implementations.
|
String |
getFullVersion()
Gets string presentation of the version.
|
String |
getGridLoggerFormatted()
Gets a formatted instance of logger that is in grid.
|
String |
getIgniteHome()
Gets Ignite installation home folder.
|
String |
getInstanceName()
Gets optional kernal instance name.
|
String |
getJdkInformation()
Gets JDK information.
|
List<String> |
getLifecycleBeansFormatted()
Gets
toString() representation of of lifecycle beans configured
with Ignite. |
String |
getLoadBalancingSpiFormatted()
Gets a formatted instance of fully configured load balancing SPI implementations.
|
UUID |
getLocalNodeId()
Unique identifier for this node within grid.
|
Map<Long,Long> |
getLongJVMPauseLastEvents()
Gets long JVM pause last events.
|
long |
getLongJVMPausesCount()
Gets long JVM pauses count.
|
long |
getLongJVMPausesTotalDuration()
Gets long JVM pauses total duration.
|
String |
getMBeanServerFormatted()
Gets a formatted instance of MBean server instance.
|
<K,V> IgniteCache<K,V> |
getOrCreateCache(CacheConfiguration<K,V> cacheCfg)
Gets existing cache with the given name or creates new one with the given configuration.
|
<K,V> IgniteCache<K,V> |
getOrCreateCache(CacheConfiguration<K,V> cacheCfg,
NearCacheConfiguration<K,V> nearCfg)
Gets existing cache with the given cache configuration or creates one if it does not exist.
|
<K,V> IgniteCache<K,V> |
getOrCreateCache(String cacheName)
Gets existing cache with the given name or creates new one using template configuration.
|
<K,V> IgniteBiTuple<IgniteCache<K,V>,Boolean> |
getOrCreateCache0(CacheConfiguration<K,V> cacheCfg,
boolean sql)
Gets existing cache with the given name or creates new one with the given configuration.
|
IgniteInternalFuture<?> |
getOrCreateCacheAsync(String cacheName,
String templateName,
CacheConfigurationOverride cfgOverride,
boolean checkThreadTx) |
Collection<IgniteCache> |
getOrCreateCaches(Collection<CacheConfiguration> cacheCfgs)
Gets existing caches with the given name or created one with the given configuration.
|
<K,V> IgniteCache<K,V> |
getOrCreateNearCache(String cacheName,
NearCacheConfiguration<K,V> nearCfg)
Gets existing near cache with the given name or creates a new one.
|
String |
getOsInformation()
Gets OS information.
|
String |
getOsUser()
Gets OS user.
|
long |
getStartTimestamp()
Get start timestamp of the kernal.
|
String |
getStartTimestampFormatted()
Gets string presentation of the kernal start timestamp.
|
long |
getUpTime()
Gets up-time of the kernal.
|
String |
getUpTimeFormatted()
Gets string presentation of up-time for the kernal.
|
List<String> |
getUserAttributesFormatted()
Gets a list of formatted user-defined attributes added to this node.
|
String |
getVmName()
Gets VM name.
|
<K,V> GridCacheAdapter<K,V> |
internalCache(String name)
USED ONLY FOR TESTING.
|
boolean |
isJmxRemoteEnabled()
Whether or not remote JMX management is enabled for this node.
|
boolean |
isNodeInBaseline()
Gets a flag whether local node is in baseline.
|
boolean |
isPeerClassLoadingEnabled()
Returns
true if peer class loading is enabled, false
otherwise. |
boolean |
isRebalanceEnabled()
Get rebalance enabled flag.
|
boolean |
isRestartEnabled()
Whether or not node restart is enabled.
|
boolean |
isStopping() |
long |
lastClusterStateChangeTime()
Gets last cluster state change operation.
|
String |
latestVersion()
Get latest version in string form.
|
ClusterNode |
localNode()
Gets local grid node.
|
IgniteLogger |
log()
Gets grid's logger.
|
Collection<MemoryMetrics> |
memoryMetrics() |
@Nullable MemoryMetrics |
memoryMetrics(String memPlcName) |
IgniteMessaging |
message()
Gets
messaging facade over all cluster nodes. |
IgniteMessaging |
message(ClusterGroup prj)
Gets
messaging facade over nodes within the cluster group. |
String |
name()
Gets the name of the Ignite instance.
|
void |
onDisconnected()
Method is responsible for handling the
EventType.EVT_CLIENT_NODE_DISCONNECTED event. |
void |
onReconnected(boolean clusterRestarted) |
PersistenceMetrics |
persistentStoreMetrics() |
boolean |
pingNode(String nodeId)
Pings node with given node ID to see whether it is alive.
|
boolean |
pingNodeByAddress(String host)
Pings node with given host name to see if it is alive.
|
<T extends IgnitePlugin> |
plugin(String name)
Gets an instance of deployed Ignite plugin.
|
void |
printLastErrors()
Prints errors.
|
<T> @Nullable IgniteQueue<T> |
queue(String name,
int cap,
CollectionConfiguration cfg)
Will get a named queue from cache and create one if it has not been created yet and
cfg is not
null. |
void |
readExternal(ObjectInput in) |
protected Object |
readResolve() |
void |
rebalanceEnabled(boolean rebalanceEnabled)
Set rebalance enable flag on node.
|
@Nullable IgniteLock |
reentrantLock(String name,
boolean failoverSafe,
boolean fair,
boolean create)
Gets or creates reentrant lock.
|
boolean |
removeCheckpoint(String key)
This method allows manually remove the checkpoint with given
key. |
void |
resetLostPartitions(Collection<String> cacheNames)
Clears partition's lost state and moves caches to a normal mode.
|
void |
runIoTest(long warmup,
long duration,
int threads,
long maxLatency,
int rangesCnt,
int payLoadSize,
boolean procFromNioThread)
Runs IO latency test against all remote server nodes in cluster.
|
IgniteScheduler |
scheduler()
Gets an instance of cron-based scheduler.
|
@Nullable IgniteSemaphore |
semaphore(String name,
int cnt,
boolean failoverSafe,
boolean create)
Gets or creates semaphore.
|
IgniteInternalFuture |
sendIoTest(ClusterNode node,
byte[] payload,
boolean procFromNioThread) |
IgniteInternalFuture |
sendIoTest(List<ClusterNode> nodes,
byte[] payload,
boolean procFromNioThread) |
IgniteServices |
services()
Gets
services facade over all cluster nodes started in server mode. |
IgniteServices |
services(ClusterGroup grp)
Gets
services facade over nodes within the cluster group. |
<T> @Nullable IgniteSet<T> |
set(String name,
CollectionConfiguration cfg)
Will get a named set from cache and create one if it has not been created yet and
cfg is not
null. |
IgniteSnapshot |
snapshot() |
void |
start(IgniteConfiguration cfg,
ExecutorService utilityCachePool,
ExecutorService execSvc,
ExecutorService svcExecSvc,
ExecutorService sysExecSvc,
StripedExecutor stripedExecSvc,
ExecutorService p2pExecSvc,
ExecutorService mgmtExecSvc,
StripedExecutor dataStreamExecSvc,
ExecutorService restExecSvc,
ExecutorService affExecSvc,
@Nullable ExecutorService idxExecSvc,
@Nullable ExecutorService buildIdxExecSvc,
IgniteStripedThreadPoolExecutor callbackExecSvc,
ExecutorService qryExecSvc,
ExecutorService schemaExecSvc,
ExecutorService rebalanceExecSvc,
IgniteStripedThreadPoolExecutor rebalanceStripedExecSvc,
@Nullable Map<String,? extends ExecutorService> customExecSvcs,
GridAbsClosure errHnd,
WorkersRegistry workerRegistry,
Thread.UncaughtExceptionHandler hnd,
TimeBag startTimer) |
void |
stop(boolean cancel)
Stops Ignite instance.
|
String |
toString() |
@NotNull TracingConfigurationManager |
tracingConfiguration()
Returns the
TracingConfigurationManager instance that allows to
Configure tracing parameters such as sampling rate for the specific tracing coordinates
such as scope and label. |
IgniteTransactions |
transactions()
Gets grid transactions facade.
|
void |
undeployTaskFromGrid(String taskName)
Makes the best attempt to undeploy a task from the whole grid.
|
<K extends GridCacheUtilityKey,V> |
utilityCache()
Gets utility cache.
|
IgniteProductVersion |
version()
Gets Ignite version.
|
void |
writeExternal(ObjectOutput out) |
public static final String SITE
public static final long DFLT_PERIODIC_STARVATION_CHECK_FREQ
IgniteSystemProperties.IGNITE_STARVATION_CHECK_INTERVAL system property is not set.
Value is 30 sec.
public static final String COORDINATOR_PROPERTIES_SEPARATOR
public static final long DFLT_LONG_OPERATIONS_DUMP_TIMEOUT
IgniteSystemProperties.IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT is not set.
Value is 60 sec.
public static final boolean DFLT_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED
public static final boolean DFLT_LOG_CLASSPATH_CONTENT_ON_STARTUP
public IgniteKernal()
public IgniteKernal(@Nullable
@Nullable GridSpringResourceContext rsrcCtx)
rsrcCtx - Optional Spring application context.public IgniteClusterEx cluster()
IgniteCluster interface.cluster in interface Ignitecluster in interface IgniteExIgniteCluster interface.public ClusterNode localNode()
public IgniteCompute compute()
compute facade over all cluster nodes started in server mode.public IgniteMessaging message()
messaging facade over all cluster nodes.public IgniteEvents events()
events facade over all cluster nodes.public IgniteServices services()
services facade over all cluster nodes started in server mode.public ExecutorService executorService()
ExecutorService which will execute all submitted
Callable and Runnable jobs on all cluster nodes.
This essentially creates a Distributed Thread Pool that can
be used as a replacement for local thread pools.executorService in interface IgniteExecutorService.public final IgniteCompute compute(ClusterGroup grp)
compute facade over the specified cluster group. All operations
on the returned IgniteCompute instance will only include nodes from
this cluster group.public final IgniteMessaging message(ClusterGroup prj)
messaging facade over nodes within the cluster group. All operations
on the returned IgniteMessaging instance will only include nodes from
the specified cluster group.public final IgniteEvents events(ClusterGroup grp)
events facade over nodes within the cluster group. All operations
on the returned IgniteEvents instance will only include nodes from
the specified cluster group.public IgniteServices services(ClusterGroup grp)
services facade over nodes within the cluster group. All operations
on the returned IgniteMessaging instance will only include nodes from
the specified cluster group.public ExecutorService executorService(ClusterGroup grp)
ExecutorService which will execute all submitted
Callable and Runnable jobs on nodes in the specified cluster group.
This essentially creates a Distributed Thread Pool that can be used as a
replacement for local thread pools.executorService in interface Ignitegrp - Cluster group.ExecutorService which will execute jobs on nodes in given cluster group.public String name()
If default Ignite instance is used, then null is returned.
Refer to Ignition documentation for information on how to start named ignite Instances.
public String getCopyright()
getCopyright in interface IgniteMXBeanpublic long getStartTimestamp()
getStartTimestamp in interface IgniteMXBeanpublic String getStartTimestampFormatted()
getStartTimestampFormatted in interface IgniteMXBeanpublic boolean isRebalanceEnabled()
isRebalanceEnabled in interface IgniteExisRebalanceEnabled in interface IgniteMXBeanTrue if rebalance enabled on node, False otherwise.public void rebalanceEnabled(boolean rebalanceEnabled)
rebalanceEnabled in interface IgniteExrebalanceEnabled in interface IgniteMXBeanrebalanceEnabled - rebalance enabled flag.public long getUpTime()
getUpTime in interface IgniteMXBeanpublic long getLongJVMPausesCount()
getLongJVMPausesCount in interface IgniteMXBeanpublic long getLongJVMPausesTotalDuration()
getLongJVMPausesTotalDuration in interface IgniteMXBeanpublic Map<Long,Long> getLongJVMPauseLastEvents()
getLongJVMPauseLastEvents in interface IgniteMXBeanpublic String getUpTimeFormatted()
getUpTimeFormatted in interface IgniteMXBeanpublic String getFullVersion()
getFullVersion in interface IgniteMXBeanpublic String getCheckpointSpiFormatted()
getCheckpointSpiFormatted in interface IgniteMXBeanpublic String getCurrentCoordinatorFormatted()
getCurrentCoordinatorFormatted in interface IgniteMXBeanpublic boolean isNodeInBaseline()
isNodeInBaseline in interface IgniteMXBeanpublic String getCommunicationSpiFormatted()
getCommunicationSpiFormatted in interface IgniteMXBeanpublic String getDeploymentSpiFormatted()
getDeploymentSpiFormatted in interface IgniteMXBeanpublic String getDiscoverySpiFormatted()
getDiscoverySpiFormatted in interface IgniteMXBeanpublic String getEventStorageSpiFormatted()
getEventStorageSpiFormatted in interface IgniteMXBeanpublic String getCollisionSpiFormatted()
getCollisionSpiFormatted in interface IgniteMXBeanpublic String getFailoverSpiFormatted()
getFailoverSpiFormatted in interface IgniteMXBeanpublic String getLoadBalancingSpiFormatted()
getLoadBalancingSpiFormatted in interface IgniteMXBeanpublic String getOsInformation()
getOsInformation in interface IgniteMXBeanpublic String getJdkInformation()
getJdkInformation in interface IgniteMXBeanpublic String getOsUser()
getOsUser in interface IgniteMXBeanpublic void printLastErrors()
printLastErrors in interface IgniteMXBeanpublic String getVmName()
getVmName in interface IgniteMXBeanpublic String getInstanceName()
null.getInstanceName in interface IgniteMXBeanpublic String getExecutorServiceFormatted()
getExecutorServiceFormatted in interface IgniteMXBeanpublic String getIgniteHome()
getIgniteHome in interface IgniteMXBeanpublic String getGridLoggerFormatted()
getGridLoggerFormatted in interface IgniteMXBeanpublic String getMBeanServerFormatted()
getMBeanServerFormatted in interface IgniteMXBeanpublic UUID getLocalNodeId()
getLocalNodeId in interface IgniteMXBeanpublic List<String> getUserAttributesFormatted()
Note that grid will add all System properties and environment properties to grid node attributes also. SPIs may also add node attributes that are used for SPI implementation.
getUserAttributesFormatted in interface IgniteMXBeanpublic boolean isPeerClassLoadingEnabled()
true if peer class loading is enabled, false
otherwise. Default value is true.
When peer class loading is enabled and task is not deployed on local node, local node will try to load classes from the node that initiated task execution. This way, a task can be physically deployed only on one node and then internally penetrate to all other nodes.
isPeerClassLoadingEnabled in interface IgniteMXBeantrue if peer class loading is enabled, false
otherwise.public List<String> getLifecycleBeansFormatted()
toString() representation of of lifecycle beans configured
with Ignite.getLifecycleBeansFormatted in interface IgniteMXBeantoString() representation of all lifecycle beans configured
with Ignite.public String clusterState()
clusterState in interface IgniteMXBeanClusterState.public long lastClusterStateChangeTime()
lastClusterStateChangeTime in interface IgniteMXBeanpublic void start(IgniteConfiguration cfg, ExecutorService utilityCachePool, ExecutorService execSvc, ExecutorService svcExecSvc, ExecutorService sysExecSvc, StripedExecutor stripedExecSvc, ExecutorService p2pExecSvc, ExecutorService mgmtExecSvc, StripedExecutor dataStreamExecSvc, ExecutorService restExecSvc, ExecutorService affExecSvc, @Nullable @Nullable ExecutorService idxExecSvc, @Nullable @Nullable ExecutorService buildIdxExecSvc, IgniteStripedThreadPoolExecutor callbackExecSvc, ExecutorService qryExecSvc, ExecutorService schemaExecSvc, ExecutorService rebalanceExecSvc, IgniteStripedThreadPoolExecutor rebalanceStripedExecSvc, @Nullable @Nullable Map<String,? extends ExecutorService> customExecSvcs, GridAbsClosure errHnd, WorkersRegistry workerRegistry, Thread.UncaughtExceptionHandler hnd, TimeBag startTimer) throws IgniteCheckedException
cfg - Ignite configuration to use.utilityCachePool - Utility cache pool.execSvc - Executor service.svcExecSvc - Services executor service.sysExecSvc - System executor service.stripedExecSvc - Striped executor.p2pExecSvc - P2P executor service.mgmtExecSvc - Management executor service.dataStreamExecSvc - Data streamer executor service.restExecSvc - Reset executor service.affExecSvc - Affinity executor service.idxExecSvc - Indexing executor service.buildIdxExecSvc - Create/rebuild indexes executor service.callbackExecSvc - Callback executor service.qryExecSvc - Query executor service.schemaExecSvc - Schema executor service.rebalanceExecSvc - Rebalance excutor service.rebalanceStripedExecSvc - Striped rebalance excutor service.customExecSvcs - Custom named executors.errHnd - Error handler to use for notification about startup problems.workerRegistry - Worker registry.hnd - Default uncaught exception handler used by thread pools.IgniteCheckedException - Thrown in case of any errors.public static String dataStorageReport(IgniteCacheDatabaseSharedManager db, boolean includeMemoryStatistics)
public void stop(boolean cancel)
cancel - Whether or not to cancel running jobs.public boolean isStopping()
True if node started shutdown sequence.public <K,V> GridCacheAdapter<K,V> internalCache(String name)
K - Key type.V - Value type.name - Cache name.public GridKernalContext context()
public boolean isJmxRemoteEnabled()
com.sun.management.jmxremoteisJmxRemoteEnabled in interface IgniteExTrue if remote JMX management is enabled - false otherwise.public boolean isRestartEnabled()
bin/ignite.{sh|bat} script using -r argument. Node can be programmatically restarted using Ignition.restart(boolean)} method.isRestartEnabled in interface IgniteExTrue if restart mode is enabled, false otherwise.Ignition.restart(boolean)public IgniteConfiguration configuration()
NOTE:
SPIs obtains through this method should never be used directly. SPIs provide
internal view on the subsystem and is used internally by Ignite kernal. In rare use cases when
access to a specific implementation of this SPI is required - an instance of this SPI can be obtained
via this method to check its configuration properties or call other non-SPI
methods.
configuration in interface Ignitepublic IgniteLogger log()
public boolean removeCheckpoint(String key)
key.removeCheckpoint in interface IgniteMXBeankey - Checkpoint key.true if specified checkpoint was indeed removed, false
otherwise.public boolean pingNode(String nodeId)
pingNode in interface IgniteMXBeannodeId - String presentation of node ID. See UUID.fromString(String) for
details on string formatting.public void undeployTaskFromGrid(String taskName) throws JMException
Note that Ignite maintains internal versions for grid tasks in case of redeployment. This method will attempt to undeploy all versions on the grid task with given name.
undeployTaskFromGrid in interface IgniteMXBeantaskName - Name of the task to undeploy. If task class has ComputeTaskName annotation,
then task was deployed under a name specified within annotation. Otherwise, full
class name should be used as task's name.JMException - Thrown if undeploy failed.public String executeTask(String taskName, String arg) throws JMException
java.lang.String argument
and java.lang.String return type.executeTask in interface IgniteMXBeantaskName - Name of the task to execute.arg - Single task execution argument (can be null).java.lang.String type).JMException - Thrown in case when execution failed.public boolean pingNodeByAddress(String host)
pingNodeByAddress in interface IgniteMXBeanhost - Host name or IP address of the node to ping.public boolean eventUserRecordable(int type)
eventUserRecordable in interface IgniteExtype - Event type to check.true if passed event should be recorded, false - otherwise.public boolean allEventsUserRecordable(int[] types)
Note that this method supports only predefined Ignite events.
allEventsUserRecordable in interface IgniteExtypes - Event types.public IgniteTransactions transactions()
transactions in interface Ignitepublic <K,V> IgniteInternalCache<K,V> getCache(String name)
name - Cache name.public <K,V> IgniteCache<K,V> cache(String name)
IgniteCache API for the given name if one is configured or null otherwise.
IgniteCache is a fully-compatible implementation of JCache (JSR 107) specification.public <K,V> IgniteCache<K,V> createCache(CacheConfiguration<K,V> cacheCfg)
If local node is an affinity node, this method will return the instance of started cache. Otherwise, it will create a client cache on local node.
If a cache with the same name already exists in the grid, an exception will be thrown regardless whether the given configuration matches the configuration of the existing cache or not.
createCache in interface IgnitecacheCfg - Cache configuration to use.public Collection<IgniteCache> createCaches(Collection<CacheConfiguration> cacheCfgs)
If local node is an affinity node, this method will return the instance of started caches. Otherwise, it will create a client caches on local node.
If for one of configurations a cache with the same name already exists in the grid, an exception will be thrown regardless whether the given configuration matches the configuration of the existing cache or not.
createCaches in interface IgnitecacheCfgs - Collection of cache configuration to use.public <K,V> IgniteCache<K,V> createCache(String cacheName)
If local node is an affinity node, this method will return the instance of started cache. Otherwise, it will create a client cache on local node.
If a cache with the same name already exists in the grid, an exception will be thrown.
createCache in interface IgnitecacheName - Cache name.public <K,V> IgniteCache<K,V> getOrCreateCache(CacheConfiguration<K,V> cacheCfg)
If a cache with the same name already exist, this method will not check that the given configuration matches the configuration of existing cache and will return an instance of the existing cache.
getOrCreateCache in interface IgnitecacheCfg - Cache configuration to use.public <K,V> IgniteBiTuple<IgniteCache<K,V>,Boolean> getOrCreateCache0(CacheConfiguration<K,V> cacheCfg, boolean sql)
If a cache with the same name already exists, this method will not check that the given configuration matches the configuration of existing cache and will return an instance of the existing cache.
getOrCreateCache0 in interface IgniteExcacheCfg - Cache configuration to use.sql - true if this call is triggered by SQL command CREATE TABLE, false otherwise.true if cache was newly crated, false otherwise]public Collection<IgniteCache> getOrCreateCaches(Collection<CacheConfiguration> cacheCfgs)
If a cache with the same name already exist, this method will not check that the given configuration matches the configuration of existing cache and will return an instance of the existing cache.
getOrCreateCaches in interface IgnitecacheCfgs - Collection of cache configuration to use.public <K,V> IgniteCache<K,V> createCache(CacheConfiguration<K,V> cacheCfg, NearCacheConfiguration<K,V> nearCfg)
If local node is an affinity node, this method will return the instance of started cache. Otherwise, it will create a near cache with the given configuration on local node.
If a cache with the same name already exists in the grid, an exception will be thrown regardless whether the given configuration matches the configuration of the existing cache or not.
createCache in interface IgnitecacheCfg - Cache configuration to use.nearCfg - Near cache configuration to use on local node in case it is not an
affinity node.public <K,V> IgniteCache<K,V> getOrCreateCache(CacheConfiguration<K,V> cacheCfg, NearCacheConfiguration<K,V> nearCfg)
If a cache with the same name already exist, this method will not check that the given configuration matches the configuration of existing cache and will return an instance of the existing cache.
If local node is not an affinity node and a client cache without near cache has been already started on this node, an exception will be thrown.
getOrCreateCache in interface IgnitecacheCfg - Cache configuration.nearCfg - Near cache configuration for client.IgniteCache instance.public <K,V> IgniteCache<K,V> createNearCache(String cacheName, NearCacheConfiguration<K,V> nearCfg)
Ignite.createCache(CacheConfiguration) or Ignite.createCache(CacheConfiguration, NearCacheConfiguration)
methods.createNearCache in interface IgnitecacheName - Cache name.nearCfg - Near cache configuration.public <K,V> IgniteCache<K,V> getOrCreateNearCache(String cacheName, NearCacheConfiguration<K,V> nearCfg)
getOrCreateNearCache in interface IgnitecacheName - Cache name.nearCfg - Near configuration.IgniteCache instance.public void destroyCache(String cacheName)
All existing instances of IgniteCache will be invalidated, subsequent calls to the API
will throw exceptions.
If a cache with the specified name does not exist in the grid, the operation has no effect.
destroyCache in interface IgnitecacheName - Cache name to destroy.public boolean destroyCache0(String cacheName, boolean sql) throws javax.cache.CacheException
destroyCache0 in interface IgniteExcacheName - Cache name to stop.sql - true if only cache created with SQL command CREATE TABLE should be affected,
false otherwise.true if cache has been stopped as the result of this call, false otherwise.javax.cache.CacheException - If error occurs.public void destroyCaches(Collection<String> cacheNames)
All existing instances of IgniteCache will be invalidated, subsequent calls to the API
will throw exceptions.
If the specified collection contains null or an empty value,
this method will throw IllegalArgumentException and the caches will not be destroyed.
If a cache with the specified name does not exist in the grid, the specified value will be skipped.
destroyCaches in interface IgnitecacheNames - Collection of cache names to destroy.public IgniteInternalFuture<Boolean> destroyCacheAsync(String cacheName, boolean sql, boolean checkThreadTx)
cacheName - Cache name.sql - If the cache needs to be destroyed only if it was created by SQL CREATE TABLE command.checkThreadTx - If true checks that current thread does not have active transactions.public IgniteInternalFuture<?> destroyCachesAsync(Collection<String> cacheNames, boolean checkThreadTx)
cacheNames - Collection of cache names.checkThreadTx - If true checks that current thread does not have active transactions.public <K,V> IgniteCache<K,V> getOrCreateCache(String cacheName)
getOrCreateCache in interface IgnitecacheName - Cache name.public IgniteInternalFuture<?> getOrCreateCacheAsync(String cacheName, String templateName, CacheConfigurationOverride cfgOverride, boolean checkThreadTx)
cacheName - Cache name.templateName - Template name.cfgOverride - Cache config properties to override.checkThreadTx - If true checks that current thread does not have active transactions.public <K,V> void addCacheConfiguration(CacheConfiguration<K,V> cacheCfg)
addCacheConfiguration in interface IgnitecacheCfg - Cache configuration template.public Collection<IgniteCacheProxy<?,?>> caches()
public Collection<String> cacheNames()
cacheNames in interface Ignitepublic <K extends GridCacheUtilityKey,V> IgniteInternalCache<K,V> utilityCache()
utilityCache in interface IgniteExpublic <K,V> IgniteInternalCache<K,V> cachex(String name)
public Collection<IgniteInternalCache<?,?>> cachesx(IgnitePredicate<? super IgniteInternalCache<?,?>>[] p)
public <K,V> IgniteDataStreamer<K,V> dataStreamer(String cacheName)
IgniteDataStreamer documentation.dataStreamer in interface IgnitecacheName - Cache name.public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException
plugin in interface IgniteT - Plugin type.name - Plugin name.PluginNotFoundException - If plugin for the given name was not found.public IgniteBinary binary()
IgniteBinary interface.binary in interface IgniteIgniteBinary interface.public IgniteProductVersion version()
public String latestVersion()
latestVersion in interface IgniteExpublic IgniteScheduler scheduler()
public void close()
throws IgniteException
this instance of grid. This method is identical to calling
G.stop(igniteInstanceName, true).
The method is invoked automatically on objects managed by the
try-with-resources statement.
close in interface AutoCloseableclose in interface IgniteIgniteException - If failed to stop grid.public <K> Affinity<K> affinity(String cacheName)
public boolean active()
active in interface Igniteactive in interface IgniteMXBeanTrue if grid is active. False If grid is not active.public void active(boolean active)
NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.
active in interface Igniteactive in interface IgniteMXBeanactive - If True start activation process. If False start deactivation process.public void resetLostPartitions(Collection<String> cacheNames)
To avoid permanent data loss for persistent caches it's recommended to return all previously failed baseline nodes to the topology before calling this method.
resetLostPartitions in interface Ignitepublic Collection<DataRegionMetrics> dataRegionMetrics()
DataRegionMetrics that reflects page memory usage on this Apache Ignite node
instance.
Returns the collection that contains the latest snapshots for each memory region
configured with configuration on this Ignite node instance.dataRegionMetrics in interface IgniteDataRegionMetrics snapshots.@Nullable public @Nullable DataRegionMetrics dataRegionMetrics(String memPlcName)
DataRegionMetrics snapshot for the memory region of the given name.
To get the metrics for the default memory region use
DataStorageConfiguration.DFLT_DATA_REG_DEFAULT_NAME as the name
or a custom name if the default memory region has been renamed.dataRegionMetrics in interface IgnitememPlcName - Name of memory region configured with config.DataRegionMetrics snapshot or null if no memory region is configured under specified name.public DataStorageMetrics dataStorageMetrics()
dataStorageMetrics in interface IgniteDataStorageMetrics snapshot.@NotNull public @NotNull TracingConfigurationManager tracingConfiguration()
TracingConfigurationManager instance that allows to
tracingConfiguration in interface IgniteTracingConfigurationManager instance.public IgniteEncryption encryption()
IgniteEncryption interface.encryption in interface IgniteIgniteEncryption interface.public IgniteSnapshot snapshot()
public Collection<MemoryMetrics> memoryMetrics()
memoryMetrics in interface IgniteMemoryMetrics snapshots.@Nullable public @Nullable MemoryMetrics memoryMetrics(String memPlcName)
memoryMetrics in interface IgniteMemoryMetrics snapshot or null if no memory region is configured under specified name.public PersistenceMetrics persistentStoreMetrics()
persistentStoreMetrics in interface IgnitePersistenceMetrics snapshot.@Nullable public @Nullable IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create)
create flag
is true. It will use configuration from IgniteConfiguration.getAtomicConfiguration().atomicSequence in interface Ignitename - Sequence name.initVal - Initial value for sequence. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.@Nullable public @Nullable IgniteAtomicSequence atomicSequence(String name, AtomicConfiguration cfg, long initVal, boolean create) throws IgniteException
create flag
is true.atomicSequence in interface Ignitename - Sequence name.cfg - Configuration.initVal - Initial value for sequence. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.IgniteException - If sequence could not be fetched or created.@Nullable public @Nullable IgniteAtomicLong atomicLong(String name, long initVal, boolean create)
create flag
is true.atomicLong in interface Ignitename - Name of atomic long.initVal - Initial value for atomic long. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.@Nullable public @Nullable IgniteAtomicLong atomicLong(String name, AtomicConfiguration cfg, long initVal, boolean create) throws IgniteException
create flag
is true.atomicLong in interface Ignitename - Name of atomic long.cfg - Configuration.initVal - Initial value for atomic long. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.IgniteException - If atomic long could not be fetched or created.@Nullable public <T> @Nullable IgniteAtomicReference<T> atomicReference(String name, @Nullable T initVal, boolean create)
create flag
is true. It will use configuration from IgniteConfiguration.getAtomicConfiguration().atomicReference in interface Ignitename - Atomic reference name.initVal - Initial value for atomic reference. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.public <T> IgniteAtomicReference<T> atomicReference(String name, AtomicConfiguration cfg, @Nullable T initVal, boolean create) throws IgniteException
create flag
is true.atomicReference in interface Ignitename - Atomic reference name.cfg - Configuration.initVal - Initial value for atomic reference. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.IgniteException - If atomic reference could not be fetched or created.@Nullable public <T,S> @Nullable IgniteAtomicStamped<T,S> atomicStamped(String name, @Nullable T initVal, @Nullable S initStamp, boolean create)
create flag
is true.atomicStamped in interface Ignitename - Atomic stamped name.initVal - Initial value for atomic stamped. Ignored if create flag is false.initStamp - Initial stamp for atomic stamped. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.public <T,S> IgniteAtomicStamped<T,S> atomicStamped(String name, AtomicConfiguration cfg, @Nullable T initVal, @Nullable S initStamp, boolean create) throws IgniteException
create flag
is true.atomicStamped in interface Ignitename - Atomic stamped name.cfg - Configuration.initVal - Initial value for atomic stamped. Ignored if create flag is false.initStamp - Initial stamp for atomic stamped. Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.IgniteException - If atomic stamped could not be fetched or created.@Nullable public @Nullable IgniteCountDownLatch countDownLatch(String name, int cnt, boolean autoDel, boolean create)
create flag
is true, it is created using provided name and count parameter.countDownLatch in interface Ignitename - Name of the latch.cnt - Count for new latch creation. Ignored if create flag is false.autoDel - True to automatically delete latch from cache when its count reaches zero.
Ignored if create flag is false.create - Boolean flag indicating whether data structure should be created if does not exist.@Nullable public @Nullable IgniteSemaphore semaphore(String name, int cnt, boolean failoverSafe, boolean create)
create flag
is true, it is created using provided name and count parameter.semaphore in interface Ignitename - Name of the semaphore.cnt - Count for new semaphore creation. Ignored if create flag is false.failoverSafe - True to create failover safe semaphore which means that
if any node leaves topology permits already acquired by that node are silently released
and become available for alive nodes to acquire. If flag is false then
all threads waiting for available permits get interrupted.create - Boolean flag indicating whether data structure should be created if does not exist.@Nullable public @Nullable IgniteLock reentrantLock(String name, boolean failoverSafe, boolean fair, boolean create)
create flag
is true, it is created using provided name.reentrantLock in interface Ignitename - Name of the lock.failoverSafe - True to create failover safe lock which means that
if any node leaves topology, all locks already acquired by that node are silently released
and become available for other nodes to acquire. If flag is false then
all threads on other nodes waiting to acquire lock are interrupted.fair - If True, fair lock will be created.create - Boolean flag indicating whether data structure should be created if does not exist.@Nullable public <T> @Nullable IgniteQueue<T> queue(String name, int cap, CollectionConfiguration cfg)
cfg is not
null.
If queue is present already, queue properties will not be changed. Use
collocation for CacheMode.PARTITIONED caches if you have lots of relatively
small queues as it will make fetching, querying, and iteration a lot faster. If you have
few very large queues, then you should consider turning off collocation as they simply
may not fit in a single node's memory.@Nullable public <T> @Nullable IgniteSet<T> set(String name, CollectionConfiguration cfg)
cfg is not
null.public void onDisconnected()
EventType.EVT_CLIENT_NODE_DISCONNECTED event. Notify all the
GridComponents that the such even has been occurred (e.g. if the local client node disconnected from the cluster
components will be notified with a future which will be completed when the client is reconnected).public void onReconnected(boolean clusterRestarted)
clusterRestarted - True if all cluster nodes restarted while client was disconnected.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionprotected Object readResolve() throws ObjectStreamException
ObjectStreamException - If failed.public void dumpDebugInfo()
dumpDebugInfo in interface IgniteMXBeanpublic IgniteInternalFuture sendIoTest(ClusterNode node, byte[] payload, boolean procFromNioThread)
node - Node.payload - Message payload.procFromNioThread - If true message is processed from NIO thread.public IgniteInternalFuture sendIoTest(List<ClusterNode> nodes, byte[] payload, boolean procFromNioThread)
nodes - Nodes.payload - Message payload.procFromNioThread - If true message is processed from NIO thread.public void runIoTest(long warmup,
long duration,
int threads,
long maxLatency,
int rangesCnt,
int payLoadSize,
boolean procFromNioThread)
runIoTest in interface IgniteMXBeanwarmup - Warmup duration in milliseconds.duration - Test duration in milliseconds.threads - Thread count.maxLatency - Max latency in nanoseconds.rangesCnt - Ranges count in resulting histogram.payLoadSize - Payload size in bytes.procFromNioThread - True to process requests in NIO threads.public void clearNodeLocalMap()
clearNodeLocalMap in interface IgniteMXBeanpublic void clusterState(String state)
NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.
clusterState in interface IgniteMXBeanstate - String representation of new cluster state.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021