Smalyshev has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/204410

Change subject: Make thread count configurable
......................................................................

Make thread count configurable

Change-Id: I274ba42373a9cd48f5b88a7049ce6a8b051d85bf
---
M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/10/204410/1

diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
index 012ebab..b46fd4f 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
@@ -63,6 +63,9 @@
 
         @Option(shortName = "d", defaultValue = "10", description = "Poll 
delay when no updates found")
         int pollDelay();
+
+        @Option(shortName = "t", defaultValue = "10", description = "Thread 
count")
+        int threadCount();
     }
 
     public static void main(String args[]) {
@@ -82,8 +85,9 @@
         if (changeSource == null) {
             return;
         }
+        int threads = options.threadCount();
         ThreadFactoryBuilder threadFactory = new 
ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s");
-        ExecutorService executor = new ThreadPoolExecutor(10, 10, 0, 
TimeUnit.SECONDS,
+        ExecutorService executor = new ThreadPoolExecutor(threads, threads, 0, 
TimeUnit.SECONDS,
                 new LinkedBlockingQueue<Runnable>(), threadFactory.build());
 
         Munger munger = CliUtils.mungerFromOptions(options);

-- 
To view, visit https://gerrit.wikimedia.org/r/204410
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I274ba42373a9cd48f5b88a7049ce6a8b051d85bf
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to