summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-12 18:13:53 +0200
committerSimon Rettberg2015-09-12 18:13:53 +0200
commit0b3ab15a67646e98bc3dbee32d8c2e923b2b3d3f (patch)
tree31d472e8523fbb9baec9edb93f93bf592f5cd894
parentwah wah waaah (diff)
downloadmaster-sync-shared-0b3ab15a67646e98bc3dbee32d8c2e923b2b3d3f.tar.gz
master-sync-shared-0b3ab15a67646e98bc3dbee32d8c2e923b2b3d3f.tar.xz
master-sync-shared-0b3ab15a67646e98bc3dbee32d8c2e923b2b3d3f.zip
Make queue len of hash checker configurable
-rw-r--r--src/main/java/org/openslx/filetransfer/util/HashChecker.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/filetransfer/util/HashChecker.java b/src/main/java/org/openslx/filetransfer/util/HashChecker.java
index 3c173fb..13c06db 100644
--- a/src/main/java/org/openslx/filetransfer/util/HashChecker.java
+++ b/src/main/java/org/openslx/filetransfer/util/HashChecker.java
@@ -14,7 +14,7 @@ public class HashChecker
{
private static final Logger LOGGER = Logger.getLogger( HashChecker.class );
- private final BlockingQueue<HashTask> queue = new LinkedBlockingQueue<>( 10 );
+ private final BlockingQueue<HashTask> queue;
private final List<Thread> threads = new ArrayList<>();
@@ -24,7 +24,13 @@ public class HashChecker
public HashChecker( String algorithm ) throws NoSuchAlgorithmException
{
+ this( algorithm, 10 );
+ }
+
+ public HashChecker( String algorithm, int queueLen ) throws NoSuchAlgorithmException
+ {
this.algorithm = algorithm;
+ this.queue = new LinkedBlockingQueue<>( queueLen );
CheckThread thread = new CheckThread( false );
thread.start();
threads.add( thread );