Skip to content

Commit

Permalink
rename watchTaskScheduler to highPriorityTaskExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbingshen committed Aug 16, 2024
1 parent 70009c1 commit 5bb747a
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public class BookKeeper implements org.apache.bookkeeper.client.api.BookKeeper {
private final BookKeeperClientStats clientStats;
private final double bookieQuarantineRatio;

// Inner thread for WatchTask. Disable external use.
private final OrderedScheduler watchTaskScheduler;
// Inner high priority thread for WatchTask. Disable external use.
private final OrderedScheduler highPriorityTaskExecutor;

// whether the event loop group is one we created, or is owned by whoever
// instantiated us
Expand Down Expand Up @@ -427,7 +427,7 @@ public BookKeeper(ClientConfiguration conf, ZooKeeper zk, EventLoopGroup eventLo

// initialize resources
this.scheduler = OrderedScheduler.newSchedulerBuilder().numThreads(1).name("BookKeeperClientScheduler").build();
this.watchTaskScheduler =
this.highPriorityTaskExecutor =
OrderedScheduler.newSchedulerBuilder().numThreads(1).name("BookKeeperWatchTaskScheduler").build();
this.mainWorkerPool = OrderedExecutor.newBuilder()
.name("BookKeeperClientWorker")
Expand All @@ -454,7 +454,7 @@ public BookKeeper(ClientConfiguration conf, ZooKeeper zk, EventLoopGroup eventLo
}
this.metadataDriver.initialize(
conf,
watchTaskScheduler,
highPriorityTaskExecutor,
rootStatsLogger,
Optional.ofNullable(zkc));
} catch (ConfigurationException ce) {
Expand Down Expand Up @@ -556,7 +556,7 @@ public BookKeeper(ClientConfiguration conf, ZooKeeper zk, EventLoopGroup eventLo
statsLogger = NullStatsLogger.INSTANCE;
clientStats = BookKeeperClientStats.newInstance(statsLogger);
scheduler = null;
watchTaskScheduler = null;
highPriorityTaskExecutor = null;
requestTimer = null;
metadataDriver = null;
placementPolicy = null;
Expand Down Expand Up @@ -1470,9 +1470,9 @@ public void close() throws BKException, InterruptedException {
}

// Close the watchTask scheduler
watchTaskScheduler.shutdown();
if (!watchTaskScheduler.awaitTermination(10, TimeUnit.SECONDS)) {
LOG.warn("The watchTaskScheduler did not shutdown cleanly");
highPriorityTaskExecutor.shutdown();
if (!highPriorityTaskExecutor.awaitTermination(10, TimeUnit.SECONDS)) {
LOG.warn("The highPriorityTaskExecutor for WatchTask did not shutdown cleanly");
}

mainWorkerPool.shutdown();
Expand Down

0 comments on commit 5bb747a

Please sign in to comment.