Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Comment thread
ctubbsii marked this conversation as resolved.
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";
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 2.0.0
* @since 2.1.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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 2.0.0
* @since 2.1.0

*/
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()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

env.getConfiguration().getNumParallelScanThreads());
} catch (TableNotFoundException e) {
throw new RuntimeException(e);
}
Expand Down
Loading