Skip to content

Commit

Permalink
Fix meaningless thread creation every time checkpoint mysql load
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinKirs committed Oct 30, 2023

Verified

This commit was signed with the committer’s verified signature.
1 parent bd6c3f7 commit 588b1b0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -139,14 +139,15 @@ public boolean isExpired() {

private final Map<String, MySqlLoadContext> loadContextMap = new ConcurrentHashMap<>();
private EvictingQueue<MySqlLoadFailRecord> failedRecords;
private ScheduledExecutorService periodScheduler = Executors.newScheduledThreadPool(1,
new CustomThreadFactory("mysql-load-fail-record-cleaner"));
private ScheduledExecutorService periodScheduler ;

public MysqlLoadManager(TokenManager tokenManager) {
this.tokenManager = tokenManager;
}

public void start() {
this.periodScheduler = Executors.newScheduledThreadPool(1,
new CustomThreadFactory("mysql-load-fail-record-cleaner"));
int poolSize = Config.mysql_load_thread_pool;
// MySqlLoad pool can accept 4 + 4 * 5 = 24 requests by default.
this.mysqlLoadPool = ThreadPoolManager.newDaemonFixedThreadPool(poolSize, poolSize * 5,

0 comments on commit 588b1b0

Please sign in to comment.