Class PaxosState
java.lang.Object
org.apache.cassandra.service.paxos.PaxosState
- All Implemented Interfaces:
AutoCloseable,PaxosOperationLock
We save to memory the result of each operation before persisting to disk, however each operation that performs
the update does not return a result to the coordinator until the result is fully persisted.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConcurrentHashMap<PaxosState.Key,PaxosState> static final Map<PaxosState.Key,PaxosState.Snapshot> -
Method Summary
Modifier and TypeMethodDescriptionacceptIfLatest(Commit.Proposal proposal) Record an acceptance of the proposal if there is no newer promise; otherwise inform the caller of the newer ballotstatic PaxosBallotTrackervoidclose()voidcommit(Commit.Agreed commit) static voidcommitDirect(Commit commit) static PaxosStateget(DecoratedKey partitionKey, TableMetadata table) static PaxosStatestatic booleanstatic voidstatic PrepareResponselegacyPrepare(Commit toPrepare) static BooleanlegacyPropose(Commit proposal) static PaxosOperationLocklock(DecoratedKey partitionKey, TableMetadata metadata, long deadline, ConsistencyLevel consistencyForConsensus, boolean isWrite) static voidpromiseIfNewer(Ballot ballot, boolean isWrite) Record the requested ballot as promised if it is newer than our current promise; otherwise do nothing.static voidsetDisableCoordinatorLocking(boolean disable) static voidstatic PaxosUncommittedTrackerstatic PaxosState.SnapshotunsafeGetIfPresent(DecoratedKey partitionKey, TableMetadata metadata) static voidvoid
-
Field Details
-
ACTIVE
-
RECENT
-
-
Method Details
-
setDisableCoordinatorLocking
public static void setDisableCoordinatorLocking(boolean disable) -
getDisableCoordinatorLocking
public static boolean getDisableCoordinatorLocking() -
uncommittedTracker
-
ballotTracker
-
initializeTrackers
public static void initializeTrackers() -
maybeRebuildUncommittedState
- Throws:
IOException
-
startAutoRepairs
public static void startAutoRepairs() -
get
-
get
-
lock
public static PaxosOperationLock lock(DecoratedKey partitionKey, TableMetadata metadata, long deadline, ConsistencyLevel consistencyForConsensus, boolean isWrite) throws RequestTimeoutException - Throws:
RequestTimeoutException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePaxosOperationLock
-
currentSnapshot
-
updateStateUnsafe
-
promiseIfNewer
Record the requested ballot as promised if it is newer than our current promise; otherwise do nothing.- Returns:
- a PromiseResult containing the before and after state for this operation
-
acceptIfLatest
Record an acceptance of the proposal if there is no newer promise; otherwise inform the caller of the newer ballot -
commit
-
commitDirect
-
legacyPrepare
-
legacyPropose
-
unsafeReset
public static void unsafeReset() -
unsafeGetIfPresent
public static PaxosState.Snapshot unsafeGetIfPresent(DecoratedKey partitionKey, TableMetadata metadata)
-