public final class DataStructuresProcessor extends GridProcessorAdapter implements IgniteChangeGlobalStateSupport
GridComponent.DiscoveryDataExchangeType
Modifier and Type | Field and Description |
---|---|
static String |
ATOMICS_CACHE_NAME
Atomics system cache name.
|
static String |
DEFAULT_VOLATILE_DS_GROUP_NAME |
static String |
VOLATILE_DATA_REGION_NAME
DataRegionConfiguration name reserved for volatile caches.
|
ctx, diagnosticLog, log
Constructor and Description |
---|
DataStructuresProcessor(GridKernalContext ctx) |
Modifier and Type | Method and Description |
---|---|
IgniteAtomicLong |
atomicLong(String name,
@Nullable AtomicConfiguration cfg,
long initVal,
boolean create)
Gets an atomic long from cache or creates one if it's not cached.
|
<T> IgniteAtomicReference<T> |
atomicReference(String name,
@Nullable AtomicConfiguration cfg,
T initVal,
boolean create)
Gets an atomic reference from cache or creates one if it's not cached.
|
<T,S> IgniteAtomicStamped<T,S> |
atomicStamped(String name,
@Nullable AtomicConfiguration cfg,
T initVal,
S initStamp,
boolean create)
Gets an atomic stamped from cache or creates one if it's not cached.
|
IgniteCountDownLatch |
countDownLatch(String name,
@Nullable AtomicConfiguration cfg,
int cnt,
boolean autoDel,
boolean create)
Gets or creates count down latch.
|
static boolean |
isDataStructureCache(String cacheName) |
static boolean |
isReservedGroup(@Nullable String grpName) |
void |
onActivate(GridKernalContext ctx)
Called when cluster performing activation.
|
void |
onBeforeActivate() |
void |
onDeActivate(GridKernalContext ctx)
Called when cluster performing deactivation.
|
void |
onKernalStart(boolean active)
Callback that notifies that kernal has successfully started,
including all managers and processors.
|
void |
onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.
|
IgniteInternalFuture<?> |
onReconnected(boolean clusterRestarted)
Client reconnected callback.
|
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
<T> IgniteQueue<T> |
queue(String name,
@Nullable String grpName,
int cap,
@Nullable CollectionConfiguration cfg)
Gets a queue from cache or creates one if it's not cached.
|
IgniteLock |
reentrantLock(String name,
@Nullable AtomicConfiguration cfg,
boolean failoverSafe,
boolean fair,
boolean create)
Gets or creates reentrant lock.
|
void |
removeCountDownLatch(String name,
String grpName)
Removes count down latch from cache.
|
void |
removeQueue(String name,
GridCacheContext cctx) |
void |
removeReentrantLock(String name,
String grpName,
boolean broken)
Removes reentrant lock from cache.
|
void |
removeSemaphore(String name,
String grpName)
Removes semaphore from cache.
|
void |
removeSet(String name,
GridCacheContext cctx) |
void |
restart(String cacheName,
IgniteInternalCache cache)
Would return this cache to normal work if it was suspened (and if it is atomics cache).
|
void |
restoreStructuresState(GridKernalContext ctx) |
static <R> R |
retry(IgniteLogger log,
Callable<R> call) |
IgniteSemaphore |
semaphore(String name,
@Nullable AtomicConfiguration cfg,
int cnt,
boolean failoverSafe,
boolean create)
Gets or creates semaphore.
|
IgniteAtomicSequence |
sequence(String name,
@Nullable AtomicConfiguration cfg,
long initVal,
boolean create)
Gets a sequence from cache or creates one if it's not cached.
|
<T> @Nullable IgniteSet<T> |
set(String name,
@Nullable String grpName,
@Nullable CollectionConfiguration cfg)
Gets a set from cache or creates one if it's not cached.
|
void |
start()
Starts grid component.
|
void |
suspend(String cacheName)
Would suspend calls for this cache if it is atomics cache.
|
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, stop, toString, validateNode, validateNode
public static final String VOLATILE_DATA_REGION_NAME
public static final String DEFAULT_VOLATILE_DS_GROUP_NAME
public static final String ATOMICS_CACHE_NAME
public DataStructuresProcessor(GridKernalContext ctx)
ctx
- Context.public void start()
start
in interface GridComponent
start
in class GridProcessorAdapter
public void onKernalStart(boolean active)
onKernalStart
in interface GridComponent
onKernalStart
in class GridProcessorAdapter
active
- Cluster active flag (note: should be used carefully since state can
change concurrently).public void onBeforeActivate()
public void onKernalStop(boolean cancel)
onKernalStop
in interface GridComponent
onKernalStop
in class GridProcessorAdapter
cancel
- Flag indicating whether jobs should be canceled.public void onActivate(GridKernalContext ctx)
onActivate
in interface IgniteChangeGlobalStateSupport
ctx
- Kernal context.public void restoreStructuresState(GridKernalContext ctx)
ctx
- Context.public void onDeActivate(GridKernalContext ctx)
onDeActivate
in interface IgniteChangeGlobalStateSupport
ctx
- Kernal context.public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted) throws IgniteCheckedException
onReconnected
in interface GridComponent
onReconnected
in class GridProcessorAdapter
clusterRestarted
- Cluster restarted flag.IgniteCheckedException
- If failed.public static boolean isDataStructureCache(String cacheName)
cacheName
- Cache name.True
if cache with such name is used to store data structures.public static boolean isReservedGroup(@Nullable @Nullable String grpName)
grpName
- Group name.True
if group name is reserved to store data structures.public final IgniteAtomicSequence sequence(String name, @Nullable @Nullable AtomicConfiguration cfg, long initVal, boolean create) throws IgniteCheckedException
name
- Sequence name.cfg
- Configuration.initVal
- Initial value for sequence. If sequence already cached, initVal
will be ignored.create
- If true
sequence will be created in case it is not in cache.IgniteCheckedException
- If loading failed.public final IgniteAtomicLong atomicLong(String name, @Nullable @Nullable AtomicConfiguration cfg, long initVal, boolean create) throws IgniteCheckedException
name
- Name of atomic long.cfg
- Configuration.initVal
- Initial value for atomic long. If atomic long already cached, initVal
will be ignored.create
- If true
atomic long will be created in case it is not in cache.IgniteCheckedException
- If loading failed.public void suspend(String cacheName)
cacheName
- To suspend.public void restart(String cacheName, IgniteInternalCache cache)
cacheName
- To restart.public final <T> IgniteAtomicReference<T> atomicReference(String name, @Nullable @Nullable AtomicConfiguration cfg, T initVal, boolean create) throws IgniteCheckedException
name
- Name of atomic reference.cfg
- Configuration.initVal
- Initial value for atomic reference. If atomic reference already cached, initVal
will be ignored.create
- If true
atomic reference will be created in case it is not in cache.IgniteCheckedException
- If loading failed.public final <T,S> IgniteAtomicStamped<T,S> atomicStamped(String name, @Nullable @Nullable AtomicConfiguration cfg, T initVal, S initStamp, boolean create) throws IgniteCheckedException
name
- Name of atomic stamped.cfg
- Configuration.initVal
- Initial value for atomic stamped. If atomic stamped already cached, initVal
will be ignored.initStamp
- Initial stamp for atomic stamped. If atomic stamped already cached, initStamp
will be ignored.create
- If true
atomic stamped will be created in case it is not in cache.IgniteCheckedException
- If loading failed.public final <T> IgniteQueue<T> queue(String name, @Nullable @Nullable String grpName, int cap, @Nullable @Nullable CollectionConfiguration cfg) throws IgniteCheckedException
name
- Name of queue.grpName
- Group name. If present, will override groupName from configuration.cap
- Max size of queue.cfg
- Non-null queue configuration if new queue should be created.IgniteCheckedException
- If failed.public void removeQueue(String name, GridCacheContext cctx) throws IgniteCheckedException
name
- Queue name.cctx
- Queue cache context.IgniteCheckedException
- If failed.public IgniteCountDownLatch countDownLatch(String name, @Nullable @Nullable AtomicConfiguration cfg, int cnt, boolean autoDel, boolean create) throws IgniteCheckedException
name
- Name of the latch.cfg
- Configuration.cnt
- Initial count.autoDel
- True
to automatically delete latch from cache when
its count reaches zero.create
- If true
latch will be created in case it is not in cache,
if it is false
all parameters except name
are ignored.null
if it is not found and
create
is false.IgniteCheckedException
- If operation failed.public void removeCountDownLatch(String name, String grpName) throws IgniteCheckedException
name
- Name of the latch.grpName
- Cache group name.IgniteCheckedException
- If operation failed.public IgniteSemaphore semaphore(String name, @Nullable @Nullable AtomicConfiguration cfg, int cnt, boolean failoverSafe, boolean create) throws IgniteCheckedException
name
- Name of the semaphore.cfg
- Configuration.cnt
- Initial count.failoverSafe
- True
FailoverSafe parameter.create
- If true
semaphore will be created in case it is not in cache,
if it is false
all parameters except name
are ignored.null
if it is not found and
create
is false.IgniteCheckedException
- If operation failed.public void removeSemaphore(String name, String grpName) throws IgniteCheckedException
name
- Name of the semaphore.grpName
- Group name.IgniteCheckedException
- If operation failed.public IgniteLock reentrantLock(String name, @Nullable @Nullable AtomicConfiguration cfg, boolean failoverSafe, boolean fair, boolean create) throws IgniteCheckedException
name
- Name of the reentrant lock.cfg
- Configuration.failoverSafe
- Flag indicating behaviour in case of failure.fair
- Flag indicating fairness policy of this lock.create
- If true
reentrant lock will be created in case it is not in cache.null
if it is not found and
create
is false.IgniteCheckedException
- If operation failed.public void removeReentrantLock(String name, String grpName, boolean broken) throws IgniteCheckedException
name
- Name of the reentrant lock.grpName
- Group name.broken
- Flag indicating the reentrant lock is broken and should be removed unconditionally.IgniteCheckedException
- If operation failed.@Nullable public <T> @Nullable IgniteSet<T> set(String name, @Nullable @Nullable String grpName, @Nullable @Nullable CollectionConfiguration cfg) throws IgniteCheckedException
name
- Set name.grpName
- Group name. If present, will override groupName from configuration.cfg
- Set configuration if new set should be created.IgniteCheckedException
- If failed.public void removeSet(String name, GridCacheContext cctx) throws IgniteCheckedException
name
- Set name.cctx
- Set cache context.IgniteCheckedException
- If failed.public static <R> R retry(IgniteLogger log, Callable<R> call) throws IgniteCheckedException
log
- Logger.call
- Callable.IgniteCheckedException
- If all retries failed.public void printMemoryStats()
printMemoryStats
in interface GridComponent
printMemoryStats
in class GridProcessorAdapter
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021