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 SummaryFields 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 SummaryConstructors Constructor Description AutoRecoveryMain(ServerConfiguration conf)AutoRecoveryMain(ServerConfiguration conf, StatsLogger statsLogger)
 - 
Method SummaryAll 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()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- 
bkcfinal BookKeeper bkc 
 - 
auditorElectorfinal AuditorElector auditorElector 
 - 
replicationWorkerfinal ReplicationWorker replicationWorker 
 - 
deathWatcherfinal org.apache.bookkeeper.replication.AutoRecoveryMain.AutoRecoveryDeathWatcher deathWatcher 
 - 
exitCodeint exitCode 
 
- 
 - 
Constructor Detail- 
AutoRecoveryMainpublic AutoRecoveryMain(ServerConfiguration conf) throws java.io.IOException, java.lang.InterruptedException, org.apache.zookeeper.KeeperException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException - Throws:
- java.io.IOException
- java.lang.InterruptedException
- org.apache.zookeeper.KeeperException
- ReplicationException.UnavailableException
- ReplicationException.CompatibilityException
 
 - 
AutoRecoveryMainpublic AutoRecoveryMain(ServerConfiguration conf, StatsLogger statsLogger) throws java.io.IOException, java.lang.InterruptedException, org.apache.zookeeper.KeeperException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException - Throws:
- java.io.IOException
- java.lang.InterruptedException
- org.apache.zookeeper.KeeperException
- ReplicationException.UnavailableException
- ReplicationException.CompatibilityException
 
 
- 
 - 
Method Detail- 
startpublic void start() 
 - 
joinpublic void join() throws java.lang.InterruptedException- Throws:
- java.lang.InterruptedException
 
 - 
shutdownpublic void shutdown() 
 - 
setExceptionHandlerpublic 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. 
 - 
getAuditorpublic Auditor getAuditor() 
 - 
isAutoRecoveryRunningpublic boolean isAutoRecoveryRunning() Is auto-recovery service running?
 - 
mainpublic static void main(java.lang.String[] args) 
 - 
doMainstatic int doMain(java.lang.String[] args) 
 - 
buildAutoRecoveryServerpublic static LifecycleComponentStack buildAutoRecoveryServer(BookieConfiguration conf) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 
- 
 
-