java.lang.Object
org.jgroups.raft.blocks.AsyncCounterImpl
- All Implemented Interfaces:
org.jgroups.blocks.atomic.AsyncCounter,org.jgroups.blocks.atomic.BaseCounter,RaftAsyncCounter,RaftCounter
RAFT Implementation of
AsyncCounter.- Since:
- 1.0.9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAndGet(long delta) async()compareAndSwap(long expect, long update) get()longgetLocal()Gets the current local value of the counter; this is purely local and the value may be stalegetName()set(long new_value) sync()toString()<T extends org.jgroups.util.Streamable>
CompletionStage<T> update(org.jgroups.blocks.atomic.CounterFunction<T> updateFunction) withOptions(Options opts) Returns an instance of a counter with the given optionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgroups.blocks.atomic.AsyncCounter
compareAndSet, decrementAndGet, incrementAndGet
-
Constructor Details
-
AsyncCounterImpl
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.jgroups.blocks.atomic.BaseCounter
-
get
- Specified by:
getin interfaceorg.jgroups.blocks.atomic.AsyncCounter
-
getLocal
public long getLocal()Description copied from interface:RaftCounterGets the current local value of the counter; this is purely local and the value may be stale- Specified by:
getLocalin interfaceRaftCounter- Returns:
- The current local value of the counter
-
set
- Specified by:
setin interfaceorg.jgroups.blocks.atomic.AsyncCounter
-
compareAndSwap
- Specified by:
compareAndSwapin interfaceorg.jgroups.blocks.atomic.AsyncCounter
-
addAndGet
- Specified by:
addAndGetin interfaceorg.jgroups.blocks.atomic.AsyncCounter
-
update
public <T extends org.jgroups.util.Streamable> CompletionStage<T> update(org.jgroups.blocks.atomic.CounterFunction<T> updateFunction) - Specified by:
updatein interfaceorg.jgroups.blocks.atomic.AsyncCounter
-
sync
- Specified by:
syncin interfaceorg.jgroups.blocks.atomic.BaseCounter- Specified by:
syncin interfaceRaftCounter
-
async
- Specified by:
asyncin interfaceorg.jgroups.blocks.atomic.AsyncCounter- Specified by:
asyncin interfaceorg.jgroups.blocks.atomic.BaseCounter- Specified by:
asyncin interfaceRaftAsyncCounter- Specified by:
asyncin interfaceRaftCounter
-
withOptions
Description copied from interface:RaftCounterReturns an instance of a counter with the given options- Specified by:
withOptionsin interfaceRaftAsyncCounter- Specified by:
withOptionsin interfaceRaftCounter- Parameters:
opts- The options- Returns:
- The counter of the given type
-
toString
-