ctubbsii commented on code in PR #1140:
URL: https://github.com/apache/accumulo-fluo/pull/1140#discussion_r3561746419
##########
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java:
##########
@@ -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";
Review Comment:
Should this use `WORKER_PREFIX` instead? I'm not where all this would get
used.
##########
modules/core/src/main/java/org/apache/fluo/core/impl/ParallelSnapshotScanner.java:
##########
@@ -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(),
Review Comment:
This changed from `this.authorizations` to `env.getAuthorizations()`.
There's a few different constructors where authorizations are passed outside of
the `env`. This might affect a test case or something... I'd have to dig. But,
probably best to keep it using `this.authorizations` for now.
##########
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java:
##########
@@ -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
Review Comment:
```suggestion
* @since 2.1.0
```
##########
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java:
##########
@@ -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
+ */
+ 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
Review Comment:
```suggestion
* @since 2.1.0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]