public final class GridCacheAtomicSequenceImpl extends Object implements GridCacheAtomicSequenceEx, Externalizable
| Constructor and Description |
|---|
GridCacheAtomicSequenceImpl()
Empty constructor required by
Externalizable. |
GridCacheAtomicSequenceImpl(String name,
GridCacheInternalKey key,
GridCacheProjection<GridCacheInternalKey,GridCacheAtomicSequenceValue> seqView,
GridCacheContext ctx,
long locVal,
long upBound)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGet(long l)
Adds
l elements to atomic sequence and gets value of atomic sequence. |
int |
batchSize()
Get local batch size for this sequences.
|
void |
batchSize(int size)
Set local batch size for this sequences.
|
long |
get()
Gets current value of atomic sequence.
|
long |
getAndAdd(long l)
Gets current value of atomic sequence and adds
l elements. |
long |
getAndIncrement()
Gets and increments current value of atomic sequence.
|
long |
incrementAndGet()
Increments and returns the value of atomic sequence.
|
GridCacheInternalKey |
key()
Get current sequence key.
|
String |
name()
Name of atomic sequence.
|
void |
onInvalid(Exception err) |
boolean |
onRemoved()
Set status of data structure as removed.
|
void |
readExternal(ObjectInput in) |
boolean |
removed()
Gets status of atomic sequence.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public GridCacheAtomicSequenceImpl()
Externalizable.public GridCacheAtomicSequenceImpl(String name, GridCacheInternalKey key, GridCacheProjection<GridCacheInternalKey,GridCacheAtomicSequenceValue> seqView, GridCacheContext ctx, long locVal, long upBound)
name - Sequence name.key - Sequence key.seqView - Sequence projection.ctx - CacheContext.locVal - Local counter.upBound - Upper bound.public String name()
name in interface GridCacheAtomicSequencepublic long get()
throws GridException
get in interface GridCacheAtomicSequenceGridException - If operation failed.public long incrementAndGet()
throws GridException
incrementAndGet in interface GridCacheAtomicSequenceGridException - If operation failed.public long getAndIncrement()
throws GridException
getAndIncrement in interface GridCacheAtomicSequenceGridException - If operation failed.public long addAndGet(long l)
throws GridException
l elements to atomic sequence and gets value of atomic sequence.addAndGet in interface GridCacheAtomicSequencel - Number of added elements.GridException - If operation failed.public long getAndAdd(long l)
throws GridException
l elements.getAndAdd in interface GridCacheAtomicSequencel - Number of added elements.GridException - If operation failed.public int batchSize()
batchSize in interface GridCacheAtomicSequencepublic void batchSize(int size)
batchSize in interface GridCacheAtomicSequencesize - Sequence batch size. Must be more then 0.public boolean onRemoved()
onRemoved in interface GridCacheRemovablepublic void onInvalid(@Nullable Exception err)
onInvalid in interface GridCacheRemovableerr - Error which cause data structure to become invalid.public GridCacheInternalKey key()
key in interface GridCacheAtomicSequenceExpublic boolean removed()
removed in interface GridCacheAtomicSequencetrue if atomic sequence was removed from cache, false otherwise.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionCopyright © 2014. All rights reserved.