Class AutoRecoveryMain
java.lang.Object
org.apache.bookkeeper.replication.AutoRecoveryMain
Class to start/stop the AutoRecovery daemons Auditor and ReplicationWorker.
TODO: eliminate the direct usage of zookeeper here {@link https://github.com/apache/bookkeeper/issues/1332}
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final AuditorElector(package private) final BookKeeper(package private) final org.apache.bookkeeper.replication.AutoRecoveryMain.AutoRecoveryDeathWatcher(package private) int(package private) final ReplicationWorker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LifecycleComponentStack(package private) static intbooleanIs auto-recovery service running?voidjoin()static voidvoidsetExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler) Currently the uncaught exception handler is used for DeathWatcher to notify lifecycle management that a bookie is dead for some reasons.voidshutdown()voidstart()
-
Field Details
-
bkc
-
auditorElector
-
replicationWorker
-
deathWatcher
final org.apache.bookkeeper.replication.AutoRecoveryMain.AutoRecoveryDeathWatcher deathWatcher -
exitCode
int exitCode
-
-
Constructor Details
-
AutoRecoveryMain
public AutoRecoveryMain(ServerConfiguration conf) throws IOException, InterruptedException, org.apache.zookeeper.KeeperException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException - Throws:
IOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperExceptionReplicationException.UnavailableExceptionReplicationException.CompatibilityException
-
AutoRecoveryMain
public AutoRecoveryMain(ServerConfiguration conf, StatsLogger statsLogger) throws IOException, InterruptedException, org.apache.zookeeper.KeeperException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException - Throws:
IOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperExceptionReplicationException.UnavailableExceptionReplicationException.CompatibilityException
-
-
Method Details
-
start
public void start() -
join
- Throws:
InterruptedException
-
shutdown
public void shutdown() -
setExceptionHandler
Currently the uncaught exception handler is used for DeathWatcher to notify lifecycle management that a bookie is dead for some reasons.in future, we can register this exceptionHandler to critical threads so when those threads are dead, it will automatically trigger lifecycle management to shutdown the process.
-
getAuditor
-
getReplicationWorker
-
isAutoRecoveryRunning
public boolean isAutoRecoveryRunning()Is auto-recovery service running? -
main
-
doMain
-
buildAutoRecoveryServer
public static LifecycleComponentStack buildAutoRecoveryServer(BookieConfiguration conf) throws Exception - Throws:
Exception
-