public class AtomixAtomicCounterMapState
extends io.atomix.resource.ResourceStateMachine
implements io.atomix.copycat.server.Snapshottable
The counter map state is implemented as a snapshottable state machine. Snapshots are necessary since incremental compaction is impractical for counters where the value of a counter is the sum of all its increments. Note that this snapshotting large state machines may risk blocking of the Raft cluster with the current implementation of snapshotting in Copycat.
| Constructor and Description |
|---|
AtomixAtomicCounterMapState(Properties config) |
public AtomixAtomicCounterMapState(Properties config)
protected void configure(io.atomix.copycat.server.StateMachineExecutor executor)
configure in class io.atomix.copycat.server.StateMachinepublic void snapshot(io.atomix.copycat.server.storage.snapshot.SnapshotWriter writer)
snapshot in interface io.atomix.copycat.server.Snapshottablepublic void install(io.atomix.copycat.server.storage.snapshot.SnapshotReader reader)
install in interface io.atomix.copycat.server.Snapshottableprotected long put(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.Put> commit)
AtomixAtomicCounterMapCommands.Put command which implements AtomixAtomicCounterMap.put(String, long).commit - put commitprotected long putIfAbsent(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.PutIfAbsent> commit)
AtomixAtomicCounterMapCommands.PutIfAbsent command which implements AtomixAtomicCounterMap.putIfAbsent(String, long).commit - putIfAbsent commitprotected long get(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.Get> commit)
AtomixAtomicCounterMapCommands.Get query which implements AtomixAtomicCounterMap.get(String)}.commit - get commitprotected boolean replace(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.Replace> commit)
AtomixAtomicCounterMapCommands.Replace command which implements AtomixAtomicCounterMap.replace(String, long, long).commit - replace commitprotected long remove(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.Remove> commit)
AtomixAtomicCounterMapCommands.Remove command which implements AtomixAtomicCounterMap.remove(String).commit - remove commitprotected boolean removeValue(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.RemoveValue> commit)
AtomixAtomicCounterMapCommands.RemoveValue command which implements AtomixAtomicCounterMap.remove(String, long).commit - removeValue commitprotected long getAndIncrement(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.GetAndIncrement> commit)
AtomixAtomicCounterMapCommands.GetAndIncrement command which implements
AtomixAtomicCounterMap.getAndIncrement(String).commit - getAndIncrement commitprotected long getAndDecrement(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.GetAndDecrement> commit)
AtomixAtomicCounterMapCommands.GetAndDecrement command which implements
AtomixAtomicCounterMap.getAndDecrement(String).commit - getAndDecrement commitprotected long incrementAndGet(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.IncrementAndGet> commit)
AtomixAtomicCounterMapCommands.IncrementAndGet command which implements
AtomixAtomicCounterMap.incrementAndGet(String).commit - incrementAndGet commitprotected long decrementAndGet(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.DecrementAndGet> commit)
AtomixAtomicCounterMapCommands.DecrementAndGet command which implements
AtomixAtomicCounterMap.decrementAndGet(String).commit - decrementAndGet commitprotected long addAndGet(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.AddAndGet> commit)
AtomixAtomicCounterMapCommands.AddAndGet command which implements AtomixAtomicCounterMap.addAndGet(String, long).commit - addAndGet commitprotected long getAndAdd(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.GetAndAdd> commit)
AtomixAtomicCounterMapCommands.GetAndAdd command which implements AtomixAtomicCounterMap.getAndAdd(String, long).commit - getAndAdd commitprotected int size(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.Size> commit)
AtomixAtomicCounterMapCommands.Size query which implements AtomixAtomicCounterMap.size().commit - size commitprotected boolean isEmpty(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.IsEmpty> commit)
AtomixAtomicCounterMapCommands.IsEmpty query which implements AtomixAtomicCounterMap.isEmpty().commit - isEmpty commitprotected void clear(io.atomix.copycat.server.Commit<AtomixAtomicCounterMapCommands.Clear> commit)
AtomixAtomicCounterMapCommands.Clear command which implements AtomixAtomicCounterMap.clear().commit - clear commit