Skip to content

Commit

Permalink
Fix deprecated props, use fluent-style threadpool builder (#273)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominic Garguilo <Dominic Garguilo>
  • Loading branch information
DomGarguilo authored Apr 11, 2024
1 parent ce95056 commit 898cded
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ public void visit(final State state, final RandWalkEnv env, Properties props) th
fixture.setUp(state, env);
}

ExecutorService service =
ThreadPools.getServerThreadPools().createFixedThreadPool(1, "RandomWalk Runner", false);
ExecutorService service = ThreadPools.getServerThreadPools().getPoolBuilder("RandomWalk Runner")
.numCoreThreads(1).build();

try {
Node initNode = getNode(initNodeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public void visit(State state, RandWalkEnv env, Properties props) throws Excepti
state.set("fs", FileSystem.get(env.getHadoopConfiguration()));
state.set("bulkImportSuccess", "true");
BulkPlusOne.counter.set(0L);
ThreadPoolExecutor e = ThreadPools.getServerThreadPools().createFixedThreadPool(MAX_POOL_SIZE,
"bulkImportPool", false);
ThreadPoolExecutor e = ThreadPools.getServerThreadPools().getPoolBuilder("bulkImportPool")
.numCoreThreads(MAX_POOL_SIZE).build();
state.set("pool", e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ static Setting s(Property property, long min, long max) {
final Property TSERV_COMPACTION_SERVICE_DEFAULT_EXECUTORS_deprecated =
Property.TSERV_COMPACTION_SERVICE_DEFAULT_EXECUTORS;

@SuppressWarnings("deprecation")
final Property TSERV_WORKQ_THREADS_deprecated = Property.TSERV_WORKQ_THREADS;

// @formatter:off
final Setting[] settings = {
s(Property.TSERV_BLOOM_LOAD_MAXCONCURRENT, 1, 10),
Expand All @@ -89,7 +92,7 @@ static Setting s(Property property, long min, long max) {
s(Property.TSERV_WAL_SORT_BUFFER_SIZE, 1024 * 1024, 1024 * 1024 * 1024L),
s(Property.TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN, 5, 100),
s(Property.TSERV_WAL_BLOCKSIZE, 1024 * 1024,1024 * 1024 * 1024 * 10L),
s(Property.TSERV_WORKQ_THREADS, 1, 10),
s(TSERV_WORKQ_THREADS_deprecated, 1, 10),
s(Property.MANAGER_BULK_TIMEOUT, 10, 600),
s(Property.MANAGER_FATE_THREADPOOL_SIZE, 1, 100),
s(Property.MANAGER_RECOVERY_DELAY, 0, 100),
Expand Down

0 comments on commit 898cded

Please sign in to comment.