Class AuditorTask
- java.lang.Object
-
- org.apache.bookkeeper.replication.AuditorTask
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
AuditorBookieCheckTask
,AuditorCheckAllLedgersTask
,AuditorPlacementPolicyCheckTask
,AuditorReplicasCheckTask
abstract class AuditorTask extends java.lang.Object implements java.lang.Runnable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
AuditorTask.ShutdownTaskHandler
ShutdownTaskHandler used to shutdown auditor executor.
-
Field Summary
Fields Modifier and Type Field Description protected BookKeeperAdmin
admin
protected AuditorStats
auditorStats
protected ServerConfiguration
conf
protected LedgerManager
ledgerManager
protected LedgerUnderreplicationManager
ledgerUnderreplicationManager
-
Constructor Summary
Constructors Constructor Description AuditorTask(ServerConfiguration conf, AuditorStats auditorStats, BookKeeperAdmin admin, LedgerManager ledgerManager, LedgerUnderreplicationManager ledgerUnderreplicationManager, AuditorTask.ShutdownTaskHandler shutdownTaskHandler, java.util.function.BiConsumer<java.util.concurrent.atomic.AtomicBoolean,java.lang.Throwable> hasAuditCheckTask)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.List<java.lang.String>
getAvailableBookies()
(package private) BookKeeper
getBookKeeper(ServerConfiguration conf)
Get BookKeeper client according to configuration.(package private) BookKeeperAdmin
getBookKeeperAdmin(BookKeeper bookKeeper)
Get BookKeeper admin according to bookKeeper client.protected boolean
hasBookieCheckTask()
protected boolean
isLedgerReplicationEnabled()
protected java.util.concurrent.CompletableFuture<?>
publishSuspectedLedgersAsync(java.util.Collection<java.lang.String> missingBookies, java.util.Set<java.lang.Long> ledgers)
void
run()
protected abstract void
runTask()
abstract void
shutdown()
protected void
submitShutdownTask()
-
-
-
Field Detail
-
conf
protected final ServerConfiguration conf
-
auditorStats
protected AuditorStats auditorStats
-
admin
protected BookKeeperAdmin admin
-
ledgerManager
protected LedgerManager ledgerManager
-
ledgerUnderreplicationManager
protected LedgerUnderreplicationManager ledgerUnderreplicationManager
-
-
Constructor Detail
-
AuditorTask
AuditorTask(ServerConfiguration conf, AuditorStats auditorStats, BookKeeperAdmin admin, LedgerManager ledgerManager, LedgerUnderreplicationManager ledgerUnderreplicationManager, AuditorTask.ShutdownTaskHandler shutdownTaskHandler, java.util.function.BiConsumer<java.util.concurrent.atomic.AtomicBoolean,java.lang.Throwable> hasAuditCheckTask)
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
runTask
protected abstract void runTask()
-
isLedgerReplicationEnabled
protected boolean isLedgerReplicationEnabled() throws ReplicationException.UnavailableException
-
publishSuspectedLedgersAsync
protected java.util.concurrent.CompletableFuture<?> publishSuspectedLedgersAsync(java.util.Collection<java.lang.String> missingBookies, java.util.Set<java.lang.Long> ledgers)
-
getAvailableBookies
protected java.util.List<java.lang.String> getAvailableBookies() throws BKException
- Throws:
BKException
-
getBookKeeper
BookKeeper getBookKeeper(ServerConfiguration conf) throws java.io.IOException, java.lang.InterruptedException
Get BookKeeper client according to configuration.- Parameters:
conf
-- Returns:
- Throws:
java.io.IOException
java.lang.InterruptedException
-
getBookKeeperAdmin
BookKeeperAdmin getBookKeeperAdmin(BookKeeper bookKeeper)
Get BookKeeper admin according to bookKeeper client.- Parameters:
bookKeeper
-- Returns:
-
submitShutdownTask
protected void submitShutdownTask()
-
shutdown
public abstract void shutdown()
-
hasBookieCheckTask
protected boolean hasBookieCheckTask()
-
-