-
Notifications
You must be signed in to change notification settings - Fork 71
Make parallel scan thread count configurable #1140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -188,6 +188,9 @@ public class FluoConfiguration extends SimpleConfiguration { | |||||
| public static final String WORKER_NUM_THREADS_PROP = WORKER_PREFIX + ".num.threads"; | ||||||
| public static final int WORKER_NUM_THREADS_DEFAULT = 10; | ||||||
|
|
||||||
| public static final String PARALLEL_SCAN_THREADS_PROP = FLUO_PREFIX + ".scan.num.threads"; | ||||||
| public static final int NUM_PARALLEL_SCAN_THREADS_DEFAULT = 1; | ||||||
|
|
||||||
| // Loader properties | ||||||
| private static final String LOADER_PREFIX = FLUO_PREFIX + ".loader"; | ||||||
| public static final String LOADER_NUM_THREADS_PROP = LOADER_PREFIX + ".num.threads"; | ||||||
|
|
@@ -634,6 +637,29 @@ public int getWorkerThreads() { | |||||
| return getPositiveInt(WORKER_NUM_THREADS_PROP, WORKER_NUM_THREADS_DEFAULT); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Sets the number of threads used to execute parallel scans, must be positive. The default is | ||||||
| * {@value #NUM_PARALLEL_SCAN_THREADS_DEFAULT} thread. Sets this value in the property | ||||||
| * {@value #PARALLEL_SCAN_THREADS_PROP} | ||||||
| * | ||||||
| * @param numThreads The number of threads to use, must be positive | ||||||
| * @since 2.0.0 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| */ | ||||||
| public FluoConfiguration setNumParallelScanThreads(int numThreads) { | ||||||
| return setPositiveInt(PARALLEL_SCAN_THREADS_PROP, numThreads); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Gets the value of the property {@value #PARALLEL_SCAN_THREADS_PROP} if set otherwise returns | ||||||
| * {@value #NUM_PARALLEL_SCAN_THREADS_DEFAULT} | ||||||
| * | ||||||
| * @return The number of threads used for parallel scans. | ||||||
| * @since 2.0.0 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| */ | ||||||
| public int getNumParallelScanThreads() { | ||||||
| return getPositiveInt(PARALLEL_SCAN_THREADS_PROP, NUM_PARALLEL_SCAN_THREADS_DEFAULT); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * @deprecated since 1.1.0. Replaced by {@link #setObserverProvider(String)} and | ||||||
| * {@link #getObserverProvider()} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,9 +116,9 @@ private BatchScanner setupBatchScanner() { | |
|
|
||
| BatchScanner scanner; | ||
| try { | ||
| // TODO hardcoded number of threads! | ||
| // one thread is probably good.. going for throughput | ||
| scanner = env.getAccumuloClient().createBatchScanner(env.getTable(), this.authorizations, 1); | ||
| scanner = | ||
| env.getAccumuloClient().createBatchScanner(env.getTable(), env.getAuthorizations(), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changed from |
||
| env.getConfiguration().getNumParallelScanThreads()); | ||
| } catch (TableNotFoundException e) { | ||
| throw new RuntimeException(e); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.