Class AtomicDataStructureProxy<V extends AtomicDataStructureValue>
- java.lang.Object
-
- org.apache.ignite.internal.processors.datastructures.AtomicDataStructureProxy<V>
-
- All Implemented Interfaces:
IgniteChangeGlobalStateSupport,GridCacheRemovable
- Direct Known Subclasses:
GridCacheAtomicLongImpl,GridCacheAtomicReferenceImpl,GridCacheAtomicSequenceImpl,GridCacheAtomicStampedImpl,GridCacheCountDownLatchImpl,GridCacheLockImpl,GridCacheSemaphoreImpl
public abstract class AtomicDataStructureProxy<V extends AtomicDataStructureValue> extends Object implements GridCacheRemovable, IgniteChangeGlobalStateSupport
Represents base class for atomic data structures.
-
-
Field Summary
Fields Modifier and Type Field Description protected IgniteInternalCache<GridCacheInternalKey,V>cacheViewStructure projection.protected GridCacheContext<GridCacheInternalKey,V>ctxCache context.protected GridCacheInternalKeykeyStructure key.protected IgniteLoggerlogLogger.protected StringnameStructure name.protected booleanrmvdRemoved flag.
-
Constructor Summary
Constructors Constructor Description AtomicDataStructureProxy()Empty constructor required byExternalizable.AtomicDataStructureProxy(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,V> cacheView)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckRemoved()Check removed status.protected IgniteExceptioncheckRemovedAfterFail(Exception cause)Checks removed status after fail.protected voidinvalidateLocalState()Invalidates local state.GridCacheInternalKeykey()Stringname()voidneedCheckNotRemoved()voidonActivate(GridKernalContext kctx)Called when cluster performing activation.voidonDeActivate(GridKernalContext kctx)Called when cluster performing deactivation.booleanonRemoved()Set status of data structure as removed.booleanremoved()voidrestart(IgniteInternalCache cache)Would return this object work to normal.voidsuspend()Would suspend calls for this object.
-
-
-
Field Detail
-
log
protected IgniteLogger log
Logger.
-
rmvd
protected volatile boolean rmvd
Removed flag.
-
name
protected String name
Structure name.
-
key
protected GridCacheInternalKey key
Structure key.
-
cacheView
protected IgniteInternalCache<GridCacheInternalKey,V extends AtomicDataStructureValue> cacheView
Structure projection.
-
ctx
protected volatile GridCacheContext<GridCacheInternalKey,V extends AtomicDataStructureValue> ctx
Cache context.
-
-
Constructor Detail
-
AtomicDataStructureProxy
public AtomicDataStructureProxy()
Empty constructor required byExternalizable.
-
AtomicDataStructureProxy
public AtomicDataStructureProxy(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,V> cacheView)
Default constructor.- Parameters:
name- Structure name.key- Structure key.cacheView- Cache projection.
-
-
Method Detail
-
name
public String name()
- Returns:
- Datastructure name.
-
key
public GridCacheInternalKey key()
- Returns:
- Key value.
-
removed
public boolean removed()
- Returns:
- Removed flag.
-
checkRemoved
protected void checkRemoved() throws IgniteExceptionCheck removed status.- Throws:
IgniteException- If removed.
-
checkRemovedAfterFail
protected IgniteException checkRemovedAfterFail(Exception cause)
Checks removed status after fail.- Parameters:
cause- Initial exception.- Returns:
- Ignite runtime exception that corresponds the original
cause.
-
onRemoved
public boolean onRemoved()
Set status of data structure as removed.- Specified by:
onRemovedin interfaceGridCacheRemovable- Returns:
- Current status.
-
needCheckNotRemoved
public void needCheckNotRemoved()
- Specified by:
needCheckNotRemovedin interfaceGridCacheRemovable
-
suspend
public void suspend()
Would suspend calls for this object.- Specified by:
suspendin interfaceGridCacheRemovable
-
restart
public void restart(IgniteInternalCache cache)
Would return this object work to normal.- Specified by:
restartin interfaceGridCacheRemovable- Parameters:
cache- To update with.
-
onActivate
public void onActivate(GridKernalContext kctx) throws IgniteCheckedException
Called when cluster performing activation.- Specified by:
onActivatein interfaceIgniteChangeGlobalStateSupport- Parameters:
kctx- Kernal context.- Throws:
IgniteCheckedException- If failed.
-
onDeActivate
public void onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.- Specified by:
onDeActivatein interfaceIgniteChangeGlobalStateSupport- Parameters:
kctx- Kernal context.
-
invalidateLocalState
protected void invalidateLocalState()
Invalidates local state.
-
-