Package org.apache.ignite
Interface IgniteAtomicSequence
-
- All Superinterfaces:
AutoCloseable,Closeable
public interface IgniteAtomicSequence extends Closeable
This interface provides a rich API for working with distributed atomic sequence.Functionality
Distributed atomic sequence includes the following main functionality:-
Method
get()gets current value from atomic sequence. -
Various
get..(..)methods get current value from atomic sequence and increase atomic sequences value. -
Various
add..(..)increment(..)methods increase atomic sequences value and return increased value. -
Method
batchSize(int size)sets batch size of current atomic sequence. -
Method
batchSize()gets current batch size of atomic sequence. -
Method
name()gets name of atomic sequence.
Creating Distributed Atomic Sequence
Instance of distributed atomic sequence can be created by calling the following method:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longaddAndGet(long l)Addslelements to atomic sequence and gets value of atomic sequence.intbatchSize()Gets local batch size for this atomic sequence.voidbatchSize(int size)Sets local batch size for atomic sequence.voidclose()Removes this atomic sequence.longget()Gets current value of atomic sequence.longgetAndAdd(long l)Gets current value of atomic sequence and addslelements.longgetAndIncrement()Gets and increments current value of atomic sequence.longincrementAndGet()Increments and returns the value of atomic sequence.Stringname()Name of atomic sequence.booleanremoved()Gets status of atomic sequence.
-
-
-
Method Detail
-
name
String name()
Name of atomic sequence.- Returns:
- Name of atomic sequence.
-
get
long get() throws IgniteException
Gets current value of atomic sequence.- Returns:
- Value of atomic sequence.
- Throws:
IgniteException- If operation failed.
-
incrementAndGet
long incrementAndGet() throws IgniteExceptionIncrements and returns the value of atomic sequence.- Returns:
- Value of atomic sequence after increment.
- Throws:
IgniteException- If operation failed.
-
getAndIncrement
long getAndIncrement() throws IgniteExceptionGets and increments current value of atomic sequence.- Returns:
- Value of atomic sequence before increment.
- Throws:
IgniteException- If operation failed.
-
addAndGet
long addAndGet(long l) throws IgniteExceptionAddslelements to atomic sequence and gets value of atomic sequence.- Parameters:
l- Number of added elements.- Returns:
- Value of atomic sequence.
- Throws:
IgniteException- If operation failed.
-
getAndAdd
long getAndAdd(long l) throws IgniteExceptionGets current value of atomic sequence and addslelements.- Parameters:
l- Number of added elements.- Returns:
- Value of atomic sequence.
- Throws:
IgniteException- If operation failed.
-
batchSize
int batchSize()
Gets local batch size for this atomic sequence.- Returns:
- Sequence batch size.
-
batchSize
void batchSize(int size)
Sets local batch size for atomic sequence.- Parameters:
size- Sequence batch size. Must be more then 0.
-
removed
boolean removed()
Gets status of atomic sequence.- Returns:
trueif atomic sequence was removed from cache,falseotherwise.
-
close
void close()
Removes this atomic sequence.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IgniteException- If operation failed.
-
-