public class IgniteSpringBean extends Object implements Ignite, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware, Externalizable
Ignition
methods.
Ignition
methods. This class can be wired directly from
Spring and can be referenced from within other Spring beans.
By virtue of implementing DisposableBean
and SmartInitializingSingleton
interfaces, IgniteSpringBean
automatically starts and stops underlying
grid instance.
A note should be taken that Ignite instance is started after all other
Spring beans have been initialized and right before Spring context is refreshed.
That implies that it's not valid to reference IgniteSpringBean from
any kind of Spring bean init methods like PostConstruct
.
If it's required to reference IgniteSpringBean for other bean
initialization purposes, it should be done from a ContextRefreshedEvent
listener method declared in that bean.
<bean id="mySpringBean" class="org.apache.ignite.IgniteSpringBean"> <property name="configuration"> <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="igniteInstanceName" value="mySpringGrid"/> </bean> </property> </bean>Or use default configuration:
<bean id="mySpringBean" class="org.apache.ignite.IgniteSpringBean"/>
AbstractApplicationContext ctx = new FileSystemXmlApplicationContext("/path/to/spring/file"); // Register Spring hook to destroy bean automatically. ctx.registerShutdownHook(); Ignite ignite = (Ignite)ctx.getBean("mySpringBean");
Constructor and Description |
---|
IgniteSpringBean() |
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.
|
void |
afterSingletonsInstantiated() |
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 . |
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(@Nullable 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.
|
protected void |
checkIgnite()
Checks if this bean is valid.
|
void |
close()
Closes
this instance of grid. |
IgniteCluster |
cluster()
Gets an instance of
IgniteCluster interface. |
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.
|
@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() |
<K,V> IgniteDataStreamer<K,V> |
dataStreamer(@Nullable String cacheName)
Gets a new instance of data streamer associated with given cache name.
|
void |
destroy() |
void |
destroyCache(String cacheName)
Destroys a cache with the given name and cleans data that was written to the cache.
|
void |
destroyCaches(Collection<String> cacheNames)
Destroys caches with the given names and cleans data that was written to the caches.
|
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. |
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. |
org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the spring application context this Ignite runs in.
|
IgniteConfiguration |
getConfiguration()
Gets the configuration of this Ignite 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.
|
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(@Nullable String cacheName,
NearCacheConfiguration<K,V> nearCfg)
Gets existing near cache with the given name or creates a new one.
|
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.
|
PersistenceMetrics |
persistentStoreMetrics() |
<T extends IgnitePlugin> |
plugin(String name)
Gets an instance of deployed Ignite plugin.
|
<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) |
@Nullable IgniteLock |
reentrantLock(String name,
boolean failoverSafe,
boolean fair,
boolean create)
Gets or creates reentrant lock.
|
void |
resetLostPartitions(Collection<String> cacheNames)
Clears partition's lost state and moves caches to a normal mode.
|
IgniteScheduler |
scheduler()
Gets an instance of cron-based scheduler.
|
@Nullable IgniteSemaphore |
semaphore(String name,
int cnt,
boolean failoverSafe,
boolean create)
Gets or creates semaphore.
|
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 . |
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx) |
void |
setConfiguration(IgniteConfiguration cfg)
Sets Ignite configuration.
|
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.
|
IgniteProductVersion |
version()
Gets Ignite version.
|
void |
writeExternal(ObjectOutput out) |
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 Ignite
public IgniteConfiguration getConfiguration()
This method is required for proper Spring integration and is the same as
configuration()
.
See https://issues.apache.org/jira/browse/IGNITE-1102 for details.
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()
public void setConfiguration(IgniteConfiguration cfg)
cfg
- Ignite configuration.public org.springframework.context.ApplicationContext getApplicationContext() throws org.springframework.beans.BeansException
org.springframework.beans.BeansException
public void setApplicationContext(org.springframework.context.ApplicationContext ctx) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
public void afterSingletonsInstantiated()
afterSingletonsInstantiated
in interface org.springframework.beans.factory.SmartInitializingSingleton
public IgniteLogger log()
public IgniteProductVersion version()
public IgniteCompute compute()
compute
facade over all cluster nodes started in server mode.public IgniteServices services()
services
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 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 Ignite
ExecutorService
.public IgniteCluster cluster()
IgniteCluster
interface.cluster
in interface Ignite
IgniteCluster
interface.public 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 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 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 Ignite
grp
- Cluster group.ExecutorService
which will execute jobs on nodes in given cluster group.public IgniteScheduler scheduler()
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 void resetLostPartitions(Collection<String> cacheNames)
To avoid data loss with persistence it's recommended to return all owners to the grid before calling this method.
resetLostPartitions
in interface Ignite
public 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 Ignite
DataRegionMetrics
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 Ignite
memPlcName
- 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 Ignite
DataStorageMetrics
snapshot.public IgniteEncryption encryption()
IgniteEncryption
interface.encryption
in interface Ignite
IgniteEncryption
interface.@NotNull public @NotNull TracingConfigurationManager tracingConfiguration()
TracingConfigurationManager
instance that allows to
tracingConfiguration
in interface Ignite
TracingConfigurationManager
instance.public Collection<MemoryMetrics> memoryMetrics()
memoryMetrics
in interface Ignite
MemoryMetrics
snapshots.@Nullable public @Nullable MemoryMetrics memoryMetrics(String memPlcName)
memoryMetrics
in interface Ignite
MemoryMetrics
snapshot or null
if no memory region is configured under specified name.public PersistenceMetrics persistentStoreMetrics()
persistentStoreMetrics
in interface Ignite
PersistenceMetrics
snapshot.public <K,V> IgniteCache<K,V> cache(@Nullable @Nullable 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 Collection<String> cacheNames()
cacheNames
in interface Ignite
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 Ignite
cacheCfg
- Cache configuration to use.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 Ignite
cacheCfg
- 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 Ignite
cacheCfg
- Cache configuration to use.nearCfg
- Near cache configuration to use on local node in case it is not an
affinity node.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 Ignite
cacheCfgs
- Collection of cache configuration to use.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 Ignite
cacheCfg
- 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 Ignite
cacheName
- Cache name.nearCfg
- Near cache configuration.public <K,V> IgniteCache<K,V> getOrCreateNearCache(@Nullable @Nullable String cacheName, NearCacheConfiguration<K,V> nearCfg)
getOrCreateNearCache
in interface Ignite
cacheName
- Cache name.nearCfg
- Near configuration.IgniteCache
instance.public <K,V> IgniteCache<K,V> getOrCreateCache(String cacheName)
getOrCreateCache
in interface Ignite
cacheName
- Cache name.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 Ignite
cacheCfgs
- 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 Ignite
cacheName
- Cache name.public <K,V> void addCacheConfiguration(CacheConfiguration<K,V> cacheCfg)
addCacheConfiguration
in interface Ignite
cacheCfg
- Cache configuration template.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 Ignite
cacheName
- Cache name to destroy.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 Ignite
cacheNames
- Collection of cache names to destroy.public IgniteTransactions transactions()
transactions
in interface Ignite
public <K,V> IgniteDataStreamer<K,V> dataStreamer(@Nullable @Nullable String cacheName)
IgniteDataStreamer
documentation.dataStreamer
in interface Ignite
cacheName
- Cache name.public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException
plugin
in interface Ignite
T
- Plugin type.name
- Plugin name.PluginNotFoundException
- If plugin for the given name was not found.public IgniteBinary binary()
IgniteBinary
interface.binary
in interface Ignite
IgniteBinary
interface.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 AutoCloseable
close
in interface Ignite
IgniteException
- If failed to stop grid.@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 Ignite
name
- 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.public IgniteAtomicSequence atomicSequence(String name, AtomicConfiguration cfg, long initVal, boolean create) throws IgniteException
create
flag
is true
.atomicSequence
in interface Ignite
name
- 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 Ignite
name
- 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.public IgniteAtomicLong atomicLong(String name, AtomicConfiguration cfg, long initVal, boolean create) throws IgniteException
Ignite
create
flag
is true
.atomicLong
in interface Ignite
name
- 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 Ignite
name
- Atomic reference name.initVal
- Initial value for atomic reference (may be null
). 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 Ignite
name
- Atomic reference name.cfg
- Configuration.initVal
- Initial value for atomic reference (may be null
). 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 Ignite
name
- Atomic stamped name.initVal
- Initial value for atomic stamped (may be null
). Ignored if create
flag is false
.initStamp
- Initial stamp for atomic stamped (may be null
). 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
Ignite
create
flag
is true
.atomicStamped
in interface Ignite
name
- Atomic stamped name.cfg
- Configuration.initVal
- Initial value for atomic stamped (may be null
). Ignored if create
flag is false
.initStamp
- Initial stamp for atomic stamped (may be null
). 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 Ignite
name
- 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 Ignite
name
- 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 Ignite
name
- 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.queue
in interface Ignite
name
- Name of queue.cap
- Capacity of queue, 0
for unbounded queue. Ignored if cfg
is null
.cfg
- Queue configuration if new queue should be created. If null
, will try to return
an existing queue.null
if queue was not created and does not exist.@Nullable public <T> @Nullable IgniteSet<T> set(String name, CollectionConfiguration cfg)
cfg
is not
null
.public <K> Affinity<K> affinity(String cacheName)
public boolean active()
public void active(boolean active)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
protected void checkIgnite() throws IllegalStateException
IllegalStateException
- If bean is not valid, i.e. Ignite has already been stopped
or has not yet been started.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024