Class AutoRecoveryMain
- java.lang.Object
-
- org.apache.bookkeeper.replication.AutoRecoveryMain
-
public class AutoRecoveryMain extends java.lang.ObjectClass 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
Fields Modifier and Type Field Description (package private) AuditorElectorauditorElector(package private) BookKeeperbkc(package private) org.apache.bookkeeper.replication.AutoRecoveryMain.AutoRecoveryDeathWatcherdeathWatcher(package private) intexitCode(package private) ReplicationWorkerreplicationWorker
-
Constructor Summary
Constructors Constructor Description AutoRecoveryMain(ServerConfiguration conf)AutoRecoveryMain(ServerConfiguration conf, StatsLogger statsLogger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LifecycleComponentStackbuildAutoRecoveryServer(BookieConfiguration conf)(package private) static intdoMain(java.lang.String[] args)AuditorgetAuditor()ReplicationWorkergetReplicationWorker()booleanisAutoRecoveryRunning()Is auto-recovery service running?voidjoin()static voidmain(java.lang.String[] args)voidsetExceptionHandler(java.lang.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 Detail
-
bkc
final BookKeeper bkc
-
auditorElector
final AuditorElector auditorElector
-
replicationWorker
final ReplicationWorker replicationWorker
-
deathWatcher
final org.apache.bookkeeper.replication.AutoRecoveryMain.AutoRecoveryDeathWatcher deathWatcher
-
exitCode
int exitCode
-
-
Constructor Detail
-
AutoRecoveryMain
public AutoRecoveryMain(ServerConfiguration conf) throws java.io.IOException, java.lang.InterruptedException, org.apache.zookeeper.KeeperException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException
- Throws:
java.io.IOExceptionjava.lang.InterruptedExceptionorg.apache.zookeeper.KeeperExceptionReplicationException.UnavailableExceptionReplicationException.CompatibilityException
-
AutoRecoveryMain
public AutoRecoveryMain(ServerConfiguration conf, StatsLogger statsLogger) throws java.io.IOException, java.lang.InterruptedException, org.apache.zookeeper.KeeperException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException
- Throws:
java.io.IOExceptionjava.lang.InterruptedExceptionorg.apache.zookeeper.KeeperExceptionReplicationException.UnavailableExceptionReplicationException.CompatibilityException
-
-
Method Detail
-
start
public void start()
-
join
public void join() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
shutdown
public void shutdown()
-
setExceptionHandler
public void setExceptionHandler(java.lang.Thread.UncaughtExceptionHandler exceptionHandler)
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
public Auditor getAuditor()
-
getReplicationWorker
public ReplicationWorker getReplicationWorker()
-
isAutoRecoveryRunning
public boolean isAutoRecoveryRunning()
Is auto-recovery service running?
-
main
public static void main(java.lang.String[] args)
-
doMain
static int doMain(java.lang.String[] args)
-
buildAutoRecoveryServer
public static LifecycleComponentStack buildAutoRecoveryServer(BookieConfiguration conf) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-