public class ArbiterImpl extends StoppableThread
The Arbiter persists the Arbiter's replication group node identifier and the highest commit VLSN that has been acknowledged. Currently the Feeder sends commit acknowledgment requests to the Arbiter if the replication factor is two and the other Rep node is not available (RepImpl.preLogCommitHook).
The VLSN is used in response to an election promise request. The priority of the response is lower than a RepNode. This allows the RepNode to be selected if the VLSN is equal. An Arbiter may not "win" an election. If the Arbiter's VLSN is the highest in the election, the election result is ignored. A NULL nodeid in a promise response is used to identify a promise response is from an Arbiter.
Two pieces of information are persisted by the Arbiter. The replication group node identifier is persisted because this information is located in the group database and the Arbiter does not have a copy of the group database. The other is the high VLSN of a Arbiter ACKed commit.
In the future, the algorithm could be changed to request commit acknowledgments when the replication factor is greater than two. This would allow for better write availability when the replication factor is an even number.
Thread.State, Thread.UncaughtExceptionHandlerenvImplMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
ArbiterImpl(File arbiterHome,
RepImpl repImpl)
The Arbiter implementation.
|
| Modifier and Type | Method and Description |
|---|---|
ReplicatedEnvironment.State |
getArbState() |
Elections |
getElections() |
String |
getHostName()
Returns the hostname associated with this node.
|
Logger |
getLogger() |
int |
getPort()
Returns the port used by the replication node.
|
RepUtils.ExceptionAwareCountDownLatch |
getReadyLatch() |
boolean |
isShutdown() |
StatGroup |
loadStats(StatsConfig config) |
void |
refreshHelperHosts() |
void |
resetReadyLatch(Exception exception) |
void |
run() |
void |
runArbiter() |
void |
setState(ReplicatedEnvironment.State state) |
void |
shutdown() |
cleanup, getSavedShutdownException, getTotalCpuTime, getTotalUserTime, handleUncaughtException, initiateSoftShutdown, saveShutdownException, shutdownDone, shutdownThreadactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic ArbiterImpl(File arbiterHome, RepImpl repImpl) throws EnvironmentNotFoundException, EnvironmentLockedException, DatabaseException
arbiterHome - - Arbiter home directory.repImpl - - RepImplEnvironmentNotFoundExceptionEnvironmentLockedExceptionDatabaseExceptionpublic StatGroup loadStats(StatsConfig config)
public void runArbiter()
public ReplicatedEnvironment.State getArbState()
public Elections getElections()
public void setState(ReplicatedEnvironment.State state)
public void shutdown()
public void refreshHelperHosts()
public boolean isShutdown()
isShutdown in class StoppableThreadpublic Logger getLogger()
getLogger in class StoppableThreadpublic RepUtils.ExceptionAwareCountDownLatch getReadyLatch()
public void resetReadyLatch(Exception exception)
public String getHostName()
public int getPort()
Copyright © 2024. All rights reserved.