public class PaxosState extends java.lang.Object implements PaxosOperationLock
Modifier and Type | Class and Description |
---|---|
static class |
PaxosState.Key |
static class |
PaxosState.MaybePromise |
static class |
PaxosState.Snapshot |
static class |
PaxosState.UnsafeSnapshot |
Modifier and Type | Field and Description |
---|---|
static java.util.concurrent.ConcurrentHashMap<PaxosState.Key,PaxosState> |
ACTIVE |
static java.util.Map<PaxosState.Key,PaxosState.Snapshot> |
RECENT |
Modifier and Type | Method and Description |
---|---|
Ballot |
acceptIfLatest(Commit.Proposal proposal)
Record an acceptance of the proposal if there is no newer promise; otherwise inform the caller of the newer ballot
|
static PaxosBallotTracker |
ballotTracker() |
void |
close() |
void |
commit(Commit.Agreed commit) |
static void |
commitDirect(Commit commit) |
PaxosState.Snapshot |
currentSnapshot() |
static PaxosState |
get(Commit commit) |
static PaxosState |
get(DecoratedKey partitionKey,
TableMetadata table) |
static boolean |
getDisableCoordinatorLocking() |
static void |
initializeTrackers() |
static PrepareResponse |
legacyPrepare(Commit toPrepare) |
static java.lang.Boolean |
legacyPropose(Commit proposal) |
static PaxosOperationLock |
lock(DecoratedKey partitionKey,
TableMetadata metadata,
long deadline,
ConsistencyLevel consistencyForConsensus,
boolean isWrite) |
static void |
maybeRebuildUncommittedState() |
PaxosState.MaybePromise |
promiseIfNewer(Ballot ballot,
boolean isWrite)
Record the requested ballot as promised if it is newer than our current promise; otherwise do nothing.
|
static void |
setDisableCoordinatorLocking(boolean disable) |
static void |
startAutoRepairs() |
static PaxosUncommittedTracker |
uncommittedTracker() |
static PaxosState.Snapshot |
unsafeGetIfPresent(DecoratedKey partitionKey,
TableMetadata metadata) |
static void |
unsafeReset() |
void |
updateStateUnsafe(java.util.function.Function<PaxosState.Snapshot,PaxosState.Snapshot> f) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
noOp
public static final java.util.concurrent.ConcurrentHashMap<PaxosState.Key,PaxosState> ACTIVE
public static final java.util.Map<PaxosState.Key,PaxosState.Snapshot> RECENT
public static void setDisableCoordinatorLocking(boolean disable)
public static boolean getDisableCoordinatorLocking()
public static PaxosUncommittedTracker uncommittedTracker()
public static PaxosBallotTracker ballotTracker()
public static void initializeTrackers()
public static void maybeRebuildUncommittedState() throws java.io.IOException
java.io.IOException
public static void startAutoRepairs()
public static PaxosState get(Commit commit)
public static PaxosState get(DecoratedKey partitionKey, TableMetadata table)
public static PaxosOperationLock lock(DecoratedKey partitionKey, TableMetadata metadata, long deadline, ConsistencyLevel consistencyForConsensus, boolean isWrite) throws RequestTimeoutException
RequestTimeoutException
public void close()
close
in interface java.lang.AutoCloseable
close
in interface PaxosOperationLock
public PaxosState.Snapshot currentSnapshot()
public void updateStateUnsafe(java.util.function.Function<PaxosState.Snapshot,PaxosState.Snapshot> f)
public PaxosState.MaybePromise promiseIfNewer(Ballot ballot, boolean isWrite)
public Ballot acceptIfLatest(Commit.Proposal proposal)
public void commit(Commit.Agreed commit)
public static void commitDirect(Commit commit)
public static PrepareResponse legacyPrepare(Commit toPrepare)
public static java.lang.Boolean legacyPropose(Commit proposal)
public static void unsafeReset()
public static PaxosState.Snapshot unsafeGetIfPresent(DecoratedKey partitionKey, TableMetadata metadata)
Copyright © 2009- The Apache Software Foundation