Class AutoRecoveryMain
- java.lang.Object
-
- org.apache.bookkeeper.replication.AutoRecoveryMain
-
public class AutoRecoveryMain extends java.lang.Object
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
Fields Modifier and Type Field Description (package private) AuditorElector
auditorElector
(package private) BookKeeper
bkc
(package private) org.apache.bookkeeper.replication.AutoRecoveryMain.AutoRecoveryDeathWatcher
deathWatcher
(package private) int
exitCode
(package private) ReplicationWorker
replicationWorker
-
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 LifecycleComponentStack
buildAutoRecoveryServer(BookieConfiguration conf)
(package private) static int
doMain(java.lang.String[] args)
Auditor
getAuditor()
ReplicationWorker
getReplicationWorker()
boolean
isAutoRecoveryRunning()
Is auto-recovery service running?void
join()
static void
main(java.lang.String[] args)
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.void
shutdown()
void
start()
-
-
-
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.IOException
java.lang.InterruptedException
org.apache.zookeeper.KeeperException
ReplicationException.UnavailableException
ReplicationException.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.IOException
java.lang.InterruptedException
org.apache.zookeeper.KeeperException
ReplicationException.UnavailableException
ReplicationException.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
-
-