From 898cdedd5fc1c22cfb755893bda35e91112a994c Mon Sep 17 00:00:00 2001 From: Dom G Date: Thu, 11 Apr 2024 14:58:55 -0400 Subject: [PATCH 1/2] Fix deprecated props, use fluent-style threadpool builder (#273) Co-authored-by: Dominic Garguilo --- .../java/org/apache/accumulo/testing/randomwalk/Module.java | 4 ++-- .../org/apache/accumulo/testing/randomwalk/bulk/Setup.java | 4 ++-- .../accumulo/testing/randomwalk/concurrent/Config.java | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java b/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java index 5861ee25..aec30a30 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java @@ -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); diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/bulk/Setup.java b/src/main/java/org/apache/accumulo/testing/randomwalk/bulk/Setup.java index 019ce4ae..3c6d46a3 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/bulk/Setup.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/bulk/Setup.java @@ -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); } diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java index ccd3d818..4abba0dc 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java @@ -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), @@ -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), From 53e75d3bf8511e6065515c8124a9debe3a41aea4 Mon Sep 17 00:00:00 2001 From: Dom G Date: Mon, 15 Apr 2024 14:24:01 -0400 Subject: [PATCH 2/2] Update deprecated TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN prop (#278) --- .../accumulo/testing/randomwalk/concurrent/Config.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java index 4abba0dc..62533535 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java @@ -68,6 +68,10 @@ static Setting s(Property property, long min, long max) { @SuppressWarnings("deprecation") final Property TSERV_WORKQ_THREADS_deprecated = Property.TSERV_WORKQ_THREADS; + @SuppressWarnings("deprecation") + final Property TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN_deprecated = + Property.TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN; + // @formatter:off final Setting[] settings = { s(Property.TSERV_BLOOM_LOAD_MAXCONCURRENT, 1, 10), @@ -90,7 +94,7 @@ static Setting s(Property property, long min, long max) { s(Property.TSERV_MINTHREADS, 1, 100), s(Property.TSERV_SESSION_MAXIDLE, 100, 5 * 60 * 1000), s(Property.TSERV_WAL_SORT_BUFFER_SIZE, 1024 * 1024, 1024 * 1024 * 1024L), - s(Property.TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN, 5, 100), + s(TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN_deprecated, 5, 100), s(Property.TSERV_WAL_BLOCKSIZE, 1024 * 1024,1024 * 1024 * 1024 * 10L), s(TSERV_WORKQ_THREADS_deprecated, 1, 10), s(Property.MANAGER_BULK_TIMEOUT, 10, 600),