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 long
addAndGet(long l)
Addsl
elements to atomic sequence and gets value of atomic sequence.int
batchSize()
Gets local batch size for this atomic sequence.void
batchSize(int size)
Sets local batch size for atomic sequence.void
close()
Removes this atomic sequence.long
get()
Gets current value of atomic sequence.long
getAndAdd(long l)
Gets current value of atomic sequence and addsl
elements.long
getAndIncrement()
Gets and increments current value of atomic sequence.long
incrementAndGet()
Increments and returns the value of atomic sequence.String
name()
Name of atomic sequence.boolean
removed()
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 IgniteException
Increments and returns the value of atomic sequence.- Returns:
- Value of atomic sequence after increment.
- Throws:
IgniteException
- If operation failed.
-
getAndIncrement
long getAndIncrement() throws IgniteException
Gets 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 IgniteException
Addsl
elements 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 IgniteException
Gets current value of atomic sequence and addsl
elements.- 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:
true
if atomic sequence was removed from cache,false
otherwise.
-
close
void close()
Removes this atomic sequence.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IgniteException
- If operation failed.
-
-