Class GridCacheAtomicStampedImpl<T,S>
- java.lang.Object
-
- org.apache.ignite.internal.processors.datastructures.AtomicDataStructureProxy<GridCacheAtomicStampedValue<T,S>>
-
- org.apache.ignite.internal.processors.datastructures.GridCacheAtomicStampedImpl<T,S>
-
- All Implemented Interfaces:
Closeable,Externalizable,Serializable,AutoCloseable,IgniteAtomicStamped<T,S>,IgniteChangeGlobalStateSupport,GridCacheAtomicStampedEx<T,S>,GridCacheRemovable
public final class GridCacheAtomicStampedImpl<T,S> extends AtomicDataStructureProxy<GridCacheAtomicStampedValue<T,S>> implements GridCacheAtomicStampedEx<T,S>, IgniteChangeGlobalStateSupport, Externalizable
Cache atomic stamped implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GridCacheAtomicStampedImpl()Empty constructor required byExternalizable.GridCacheAtomicStampedImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicStampedValue<T,S>> atomicView)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Removes this atomic stamped.booleancompareAndSet(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.voidreadExternal(ObjectInput in)voidset(T val, S stamp)Unconditionally sets the value and the stamp.Sstamp()Gets current stamp.StringtoString()Tvalue()Gets current value.voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.apache.ignite.internal.processors.datastructures.AtomicDataStructureProxy
checkRemoved, checkRemovedAfterFail, invalidateLocalState, key, name, needCheckNotRemoved, onActivate, onDeActivate, onRemoved, removed, restart, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.datastructures.GridCacheAtomicStampedEx
key
-
Methods inherited from interface org.apache.ignite.internal.processors.datastructures.GridCacheRemovable
needCheckNotRemoved, onRemoved, restart, suspend
-
Methods inherited from interface org.apache.ignite.IgniteAtomicStamped
name, removed
-
Methods inherited from interface org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport
onActivate, onDeActivate
-
-
-
-
Constructor Detail
-
GridCacheAtomicStampedImpl
public GridCacheAtomicStampedImpl()
Empty constructor required byExternalizable.
-
GridCacheAtomicStampedImpl
public GridCacheAtomicStampedImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicStampedValue<T,S>> atomicView)
Default constructor.- Parameters:
name- Atomic stamped name.key- Atomic stamped key.atomicView- Atomic projection.
-
-
Method Detail
-
get
public IgniteBiTuple<T,S> get()
Gets both current value and current stamp of atomic stamped.- Specified by:
getin interfaceIgniteAtomicStamped<T,S>- Returns:
- both current value and current stamp of atomic stamped.
-
set
public void set(T val, S stamp)
Unconditionally sets the value and the stamp.- Specified by:
setin interfaceIgniteAtomicStamped<T,S>- Parameters:
val- Value.stamp- Stamp.
-
compareAndSet
public boolean compareAndSet(T expVal, T newVal, S expStamp, S newStamp)
Conditionally sets the new value and new stamp. They will be set ifexpValandexpStampare equal to current value and current stamp respectively.- Specified by:
compareAndSetin interfaceIgniteAtomicStamped<T,S>- Parameters:
expVal- Expected value.newVal- New value.expStamp- Expected stamp.newStamp- New stamp.- Returns:
- Result of operation execution. If
truethan value and stamp will be updated.
-
stamp
public S stamp()
Gets current stamp.- Specified by:
stampin interfaceIgniteAtomicStamped<T,S>- Returns:
- Current stamp.
-
value
public T value()
Gets current value.- Specified by:
valuein interfaceIgniteAtomicStamped<T,S>- Returns:
- Current value.
-
close
public void close()
Removes this atomic stamped.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceIgniteAtomicStamped<T,S>
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-