Class AuditorTask
java.lang.Object
org.apache.bookkeeper.replication.AuditorTask
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AuditorBookieCheckTask,AuditorCheckAllLedgersTask,AuditorPlacementPolicyCheckTask,AuditorReplicasCheckTask
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceShutdownTaskHandler used to shutdown auditor executor. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BookKeeperAdminprotected AuditorStatsprotected final ServerConfigurationprotected LedgerManagerprotected LedgerUnderreplicationManager -
Constructor Summary
ConstructorsConstructorDescriptionAuditorTask(ServerConfiguration conf, AuditorStats auditorStats, BookKeeperAdmin admin, LedgerManager ledgerManager, LedgerUnderreplicationManager ledgerUnderreplicationManager, AuditorTask.ShutdownTaskHandler shutdownTaskHandler, BiConsumer<AtomicBoolean, Throwable> hasAuditCheckTask) -
Method Summary
Modifier and TypeMethodDescription(package private) BookKeeperGet BookKeeper client according to configuration.(package private) BookKeeperAdmingetBookKeeperAdmin(BookKeeper bookKeeper) Get BookKeeper admin according to bookKeeper client.protected booleanprotected booleanprotected CompletableFuture<?>publishSuspectedLedgersAsync(Collection<String> missingBookies, Set<Long> ledgers) voidrun()protected abstract voidrunTask()abstract voidshutdown()protected void
-
Field Details
-
conf
-
auditorStats
-
admin
-
ledgerManager
-
ledgerUnderreplicationManager
-
-
Constructor Details
-
AuditorTask
AuditorTask(ServerConfiguration conf, AuditorStats auditorStats, BookKeeperAdmin admin, LedgerManager ledgerManager, LedgerUnderreplicationManager ledgerUnderreplicationManager, AuditorTask.ShutdownTaskHandler shutdownTaskHandler, BiConsumer<AtomicBoolean, Throwable> hasAuditCheckTask)
-
-
Method Details
-
run
public void run() -
runTask
protected abstract void runTask() -
isLedgerReplicationEnabled
-
publishSuspectedLedgersAsync
protected CompletableFuture<?> publishSuspectedLedgersAsync(Collection<String> missingBookies, Set<Long> ledgers) -
getAvailableBookies
- Throws:
BKException
-
getBookKeeper
Get BookKeeper client according to configuration.- Parameters:
conf-- Returns:
- Throws:
IOExceptionInterruptedException
-
getBookKeeperAdmin
Get BookKeeper admin according to bookKeeper client.- Parameters:
bookKeeper-- Returns:
-
submitShutdownTask
protected void submitShutdownTask() -
shutdown
public abstract void shutdown() -
hasBookieCheckTask
protected boolean hasBookieCheckTask()
-