public final class GridCacheAtomicStampedImpl<T,S> extends Object implements GridCacheAtomicStampedEx<T,S>, IgniteChangeGlobalStateSupport, Externalizable
Constructor and Description |
---|
GridCacheAtomicStampedImpl()
Empty constructor required by
Externalizable . |
GridCacheAtomicStampedImpl(String name,
GridCacheInternalKey key,
IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicStampedValue<T,S>> atomicView,
GridCacheContext ctx)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Removes this atomic stamped.
|
boolean |
compareAndSet(T expVal,
T newVal,
S expStamp,
S newStamp)
Conditionally sets the new value and new stamp.
|
IgniteBiTuple<T,S> |
get()
Gets both current value and current stamp of atomic stamped.
|
GridCacheInternalKey |
key()
Get current atomic stamped key.
|
String |
name()
Name of atomic stamped.
|
void |
needCheckNotRemoved() |
void |
onActivate(GridKernalContext kctx)
Called when cluster performing activation.
|
void |
onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.
|
boolean |
onRemoved()
Set status of data structure as removed.
|
void |
readExternal(ObjectInput in) |
boolean |
removed()
Gets status of atomic.
|
void |
set(T val,
S stamp)
Unconditionally sets the value and the stamp.
|
S |
stamp()
Gets current stamp.
|
String |
toString() |
T |
value()
Gets current value.
|
void |
writeExternal(ObjectOutput out) |
public GridCacheAtomicStampedImpl()
Externalizable
.public GridCacheAtomicStampedImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicStampedValue<T,S>> atomicView, GridCacheContext ctx)
name
- Atomic stamped name.key
- Atomic stamped key.atomicView
- Atomic projection.ctx
- Cache context.public String name()
name
in interface IgniteAtomicStamped<T,S>
public IgniteBiTuple<T,S> get()
get
in interface IgniteAtomicStamped<T,S>
public void set(T val, S stamp)
set
in interface IgniteAtomicStamped<T,S>
val
- Value.stamp
- Stamp.public boolean compareAndSet(T expVal, T newVal, S expStamp, S newStamp)
expVal
and expStamp
are equal to current value and current stamp respectively.compareAndSet
in interface IgniteAtomicStamped<T,S>
expVal
- Expected value.newVal
- New value.expStamp
- Expected stamp.newStamp
- New stamp.true
than value and stamp will be updated.public S stamp()
stamp
in interface IgniteAtomicStamped<T,S>
public T value()
value
in interface IgniteAtomicStamped<T,S>
public boolean onRemoved()
onRemoved
in interface GridCacheRemovable
public void needCheckNotRemoved()
needCheckNotRemoved
in interface GridCacheRemovable
public GridCacheInternalKey key()
key
in interface GridCacheAtomicStampedEx<T,S>
public boolean removed()
removed
in interface IgniteAtomicStamped<T,S>
true
if atomic stamped was removed from cache, false
otherwise.public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IgniteAtomicStamped<T,S>
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
public void onActivate(GridKernalContext kctx) throws IgniteCheckedException
onActivate
in interface IgniteChangeGlobalStateSupport
kctx
- Kernal context.IgniteCheckedException
- If failed.public void onDeActivate(GridKernalContext kctx) throws IgniteCheckedException
onDeActivate
in interface IgniteChangeGlobalStateSupport
kctx
- Kernal context.IgniteCheckedException
- If failed.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017