Class Auditor
- java.lang.Object
-
- org.apache.bookkeeper.replication.Auditor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Auditor extends java.lang.Object implements java.lang.AutoCloseableAuditor is a single entity in the entire Bookie cluster and will be watching all the bookies under 'ledgerrootpath/available' zkpath. When any of the bookie failed or disconnected from zk, he will start initiating the re-replication activities by keeping all the corresponding ledgers of the failed bookie as underreplicated znode in zk.TODO: eliminate the direct usage of zookeeper here {@link https://github.com/apache/bookkeeper/issues/1332}
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditorBookieCheckTaskauditorBookieCheckTaskprotected AuditorTaskauditorCheckAllLedgersTaskprotected AuditorTaskauditorPlacementPolicyCheckTaskprotected AuditorTaskauditorReplicasCheckTaskprotected java.util.concurrent.Future<?>auditTask
-
Constructor Summary
Constructors Constructor Description Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, BookKeeperAdmin admin, boolean ownAdmin, StatsLogger statsLogger)Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, StatsLogger statsLogger)Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, StatsLogger statsLogger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) static BookKeepercreateBookKeeperClient(ServerConfiguration conf)(package private) static BookKeepercreateBookKeeperClient(ServerConfiguration conf, StatsLogger statsLogger)(package private) static BookKeepercreateBookKeeperClientThrowUnavailableException(ServerConfiguration conf)(package private) java.util.concurrent.Future<?>getAuditTask()protected java.util.List<java.lang.String>getAvailableBookies()(package private) intgetLostBookieRecoveryDelayBeforeChange()booleanisRunning()Return true if auditor is running otherwise return false.voidshutdown()Shutdown the auditor.voidstart()(package private) java.util.concurrent.Future<?>submitAuditTask()protected voidsubmitBookieCheckTask()(package private) java.util.concurrent.Future<?>submitLostBookieRecoveryDelayChangedEvent()
-
-
-
Field Detail
-
auditTask
protected volatile java.util.concurrent.Future<?> auditTask
-
auditorBookieCheckTask
protected AuditorBookieCheckTask auditorBookieCheckTask
-
auditorCheckAllLedgersTask
protected AuditorTask auditorCheckAllLedgersTask
-
auditorPlacementPolicyCheckTask
protected AuditorTask auditorPlacementPolicyCheckTask
-
auditorReplicasCheckTask
protected AuditorTask auditorReplicasCheckTask
-
-
Constructor Detail
-
Auditor
public Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
Auditor
public Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
Auditor
public Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, BookKeeperAdmin admin, boolean ownAdmin, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
-
Method Detail
-
createBookKeeperClient
static BookKeeper createBookKeeperClient(ServerConfiguration conf) throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
createBookKeeperClient
static BookKeeper createBookKeeperClient(ServerConfiguration conf, StatsLogger statsLogger) throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
createBookKeeperClientThrowUnavailableException
static BookKeeper createBookKeeperClientThrowUnavailableException(ServerConfiguration conf) throws ReplicationException.UnavailableException
-
submitAuditTask
java.util.concurrent.Future<?> submitAuditTask()
-
submitLostBookieRecoveryDelayChangedEvent
java.util.concurrent.Future<?> submitLostBookieRecoveryDelayChangedEvent()
-
start
public void start()
-
submitBookieCheckTask
protected void submitBookieCheckTask()
-
getAvailableBookies
protected java.util.List<java.lang.String> getAvailableBookies() throws BKException- Throws:
BKException
-
shutdown
public void shutdown()
Shutdown the auditor.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
isRunning
public boolean isRunning()
Return true if auditor is running otherwise return false.- Returns:
- auditor status
-
getLostBookieRecoveryDelayBeforeChange
int getLostBookieRecoveryDelayBeforeChange()
-
getAuditTask
java.util.concurrent.Future<?> getAuditTask()
-
-