public class IgniteKernal extends Object implements IgniteEx, IgniteMXBean, Externalizable
| Constructor and Description |
|---|
IgniteKernal()
No-arg constructor is required by externalization.
|
IgniteKernal(GridSpringResourceContext rsrcCtx) |
| Modifier and Type | Method and Description |
|---|---|
<K> CacheAffinity<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.
|
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,
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. |
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,
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. |
<K,V> GridCache<K,V> |
cache(String name) |
Collection<GridCache<?,?>> |
caches() |
Collection<GridCache<?,?>> |
cachesx(IgnitePredicate<? super GridCache<?,?>>[] p)
Gets configured cache instance that satisfy all provided predicates including non-public caches.
|
<K,V> GridCache<K,V> |
cachex()
Gets default cache instance if one is configured or null otherwise returning even non-public caches.
|
<K,V> GridCache<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 |
close()
Closes
this instance of grid. |
IgniteClusterEx |
cluster()
Gets an instance of
IgniteCluster interface. |
Collection<String> |
compatibleVersions()
Gets list of compatible versions.
|
IgniteCompute |
compute()
Gets
compute functionality over this grid projection. |
IgniteCompute |
compute(ClusterGroup grp) |
IgniteConfiguration |
configuration()
Gets the configuration of this grid instance.
|
GridKernalContext |
context()
It's intended for use by internal marshalling implementation only.
|
IgniteCountDownLatch |
countDownLatch(String name,
int cnt,
boolean autoDel,
boolean create)
Gets or creates count down latch.
|
<K,V> IgniteDataStreamer<K,V> |
dataStreamer(String cacheName)
Gets a new instance of data streamer associated with given cache name.
|
IgniteEvents |
events()
Gets
events functionality over this grid projection. |
IgniteEvents |
events(ClusterGroup grp) |
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 new
ExecutorService which will execute all submitted
Callable and Runnable jobs on nodes in this grid projection. |
ExecutorService |
executorService(ClusterGroup grp) |
IgniteFileSystem |
fileSystem(String name)
Gets an instance of IGFS (Ignite In-Memory File System).
|
Collection<IgniteFileSystem> |
fileSystems()
Gets all instances of IGFS (Ignite In-Memory File System).
|
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 |
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.
|
Collection<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.
|
String |
getMBeanServerFormatted()
Gets a formatted instance of MBean server instance.
|
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.
|
String |
getSwapSpaceSpiFormatted()
Gets a formatted instance of configured swapspace SPI implementations.
|
long |
getUpTime()
Gets up-time of the kernal.
|
String |
getUpTimeFormatted()
Gets string presentation of up-time for the kernal.
|
Collection<String> |
getUserAttributesFormatted()
Gets a collection of formatted user-defined attributes added to this node.
|
String |
getVmName()
Gets VM name.
|
Hadoop |
hadoop()
Get Hadoop facade.
|
IgniteFileSystem |
igfsx(String name)
Get IGFS instance returning null if it doesn't exist.
|
<K,V> GridCacheAdapter<K,V> |
internalCache()
USED ONLY FOR TESTING.
|
<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 |
isPeerClassLoadingEnabled()
Returns
true if peer class loading is enabled, false
otherwise. |
boolean |
isRestartEnabled()
Whether or not node restart is enabled.
|
<K,V> IgniteCache<K,V> |
jcache(String name)
Gets an instance of
IgniteCache API. |
String |
latestVersion()
Get latest version in string form.
|
ClusterNode |
localNode()
Gets local grid node.
|
IgniteLogger |
log()
Gets grid's logger.
|
IgniteMessaging |
message()
Gets
messaging functionality over this grid projection. |
IgniteMessaging |
message(ClusterGroup prj) |
String |
name()
Gets the name of the grid this grid instance (and correspondingly its local node) belongs to.
|
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> 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() |
boolean |
removeCheckpoint(String key)
This method allows manually remove the checkpoint with given
key. |
IgniteScheduler |
scheduler()
Gets an instance of cron-based scheduler.
|
IgniteServices |
services()
Gets
services functionality over this grid projection. |
IgniteServices |
services(ClusterGroup grp) |
<T> 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. |
void |
start(IgniteConfiguration cfg,
ExecutorService utilityCachePool,
ExecutorService marshCachePool,
ExecutorService execSvc,
ExecutorService sysExecSvc,
ExecutorService p2pExecSvc,
ExecutorService mgmtExecSvc,
ExecutorService igfsExecSvc,
ExecutorService restExecSvc,
GridAbsClosure errHnd) |
void |
stop(boolean cancel)
Stops grid instance.
|
IgniteStreamer |
streamer(String name)
Gets an instance of streamer by name, if one does not exist then
IllegalArgumentException will be thrown. |
Collection<IgniteStreamer> |
streamers()
Gets all instances of streamers.
|
String |
toString() |
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(Class<K> keyCls,
Class<V> valCls)
Gets utility cache.
|
IgniteProductVersion |
version()
Gets Ignite version.
|
void |
writeExternal(ObjectOutput out) |
public IgniteKernal()
public IgniteKernal(@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 functionality over this grid projection. All operations
on the returned IgniteCompute instance will only include nodes from
this projection.public IgniteMessaging message()
messaging functionality over this grid projection. All operations
on the returned IgniteMessaging instance will only include nodes from
this projection.public IgniteEvents events()
events functionality over this grid projection. All operations
on the returned IgniteEvents instance will only include nodes from
this projection.public IgniteServices services()
services functionality over this grid projection. All operations
on the returned IgniteMessaging instance will only include nodes from
this projection.public ExecutorService executorService()
ExecutorService which will execute all submitted
Callable and Runnable jobs on nodes in this grid projection.
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)
public final IgniteMessaging message(ClusterGroup prj)
public final IgniteEvents events(ClusterGroup grp)
public IgniteServices services(ClusterGroup grp)
public ExecutorService executorService(ClusterGroup grp)
executorService in interface Ignitegrp - Cluster group.ExecutorService which will execute jobs on nodes in given cluster group.public String name()
If default grid instance is used, then
null is returned. Refer to Ignition documentation
for information on how to start named grids.
public String getCopyright()
getCopyright in interface IgniteMXBeanpublic long getStartTimestamp()
getStartTimestamp in interface IgniteMXBeanpublic String getStartTimestampFormatted()
getStartTimestampFormatted in interface IgniteMXBeanpublic long getUpTime()
getUpTime in interface IgniteMXBeanpublic String getUpTimeFormatted()
getUpTimeFormatted in interface IgniteMXBeanpublic String getFullVersion()
getFullVersion in interface IgniteMXBeanpublic String getCheckpointSpiFormatted()
getCheckpointSpiFormatted in interface IgniteMXBeanpublic String getSwapSpaceSpiFormatted()
getSwapSpaceSpiFormatted 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 Collection<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 Collection<String> getLifecycleBeansFormatted()
toString() representation of of lifecycle beans configured
with Ignite.getLifecycleBeansFormatted in interface IgniteMXBeantoString() representation of all lifecycle beans configured
with Ignite.public void start(IgniteConfiguration cfg, ExecutorService utilityCachePool, ExecutorService marshCachePool, ExecutorService execSvc, ExecutorService sysExecSvc, ExecutorService p2pExecSvc, ExecutorService mgmtExecSvc, ExecutorService igfsExecSvc, ExecutorService restExecSvc, GridAbsClosure errHnd) throws IgniteCheckedException
cfg - Configuration to use.utilityCachePool - Utility cache pool.execSvc - Executor service.sysExecSvc - System executor service.p2pExecSvc - P2P executor service.mgmtExecSvc - Management executor service.igfsExecSvc - IGFS executor service.restExecSvc - Reset executor service.errHnd - Error handler to use for notification about startup problems.IgniteCheckedException - Thrown in case of any errors.public void stop(boolean cancel)
cancel - Whether or not to cancel running jobs.public <K,V> GridCacheAdapter<K,V> internalCache()
K - Key type.V - Value type.public <K,V> GridCacheAdapter<K,V> internalCache(@Nullable 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> GridCache<K,V> cache(@Nullable String name)
name - Cache name.public <K,V> IgniteCache<K,V> jcache(@Nullable String name)
IgniteCache API. IgniteCache is a fully-compatible
implementation of JCache (JSR 107) specification.public Collection<GridCache<?,?>> caches()
public <K extends GridCacheUtilityKey,V> GridCacheProjectionEx<K,V> utilityCache(Class<K> keyCls, Class<V> valCls)
utilityCache in interface IgniteExkeyCls - Key class.valCls - Value class.public <K,V> GridCache<K,V> cachex(@Nullable String name)
public <K,V> GridCache<K,V> cachex()
CacheProjection.name() method on default instance returns null.public Collection<GridCache<?,?>> cachesx(IgnitePredicate<? super GridCache<?,?>>[] p)
public <K,V> IgniteDataStreamer<K,V> dataStreamer(@Nullable String cacheName)
IgniteDataStreamer documentation.dataStreamer in interface IgnitecacheName - Cache name (null for default cache).public IgniteFileSystem fileSystem(String name)
IllegalArgumentException will be thrown.
IGFS is fully compliant with Hadoop FileSystem APIs and can
be plugged into Hadoop installations. For more information refer to
documentation on Hadoop integration shipped with Ignite.
fileSystem in interface Ignitename - IGFS name.@Nullable public IgniteFileSystem igfsx(@Nullable String name)
public Collection<IgniteFileSystem> fileSystems()
fileSystems in interface Ignitepublic Hadoop hadoop()
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 IgniteStreamer streamer(@Nullable String name)
IllegalArgumentException will be thrown.public Collection<IgniteStreamer> streamers()
public IgniteProductVersion version()
public String latestVersion()
latestVersion in interface IgniteExpublic IgniteScheduler scheduler()
public Collection<String> compatibleVersions()
compatibleVersions in interface IgniteExpublic void close()
throws IgniteException
this instance of grid. This method is identical to calling
G.stop(gridName, 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> CacheAffinity<K> affinity(String cacheName)
@Nullable public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create)
create flag
is true.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 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 <T> IgniteAtomicReference<T> atomicReference(String name, @Nullable T initVal, boolean create)
create flag
is true.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.@Nullable public <T,S> 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.@Nullable public 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 <T> 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> IgniteSet<T> set(String name, CollectionConfiguration cfg)
cfg is not
null.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.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015