You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2015/04/20 01:35:10 UTC

svn commit: r1674707 - /hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java

Author: edwardyoon
Date: Sun Apr 19 23:35:09 2015
New Revision: 1674707

URL: http://svn.apache.org/r1674707
Log:
Use newCachedThreadPool

Modified:
    hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java?rev=1674707&r1=1674706&r2=1674707&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java Sun Apr 19 23:35:09 2015
@@ -241,9 +241,7 @@ public final class GraphJobRunner<V exte
     this.changedVertexCnt = 0;
     vertices.startSuperstep();
 
-    ExecutorService executor = Executors.newFixedThreadPool((peer
-        .getNumCurrentMessages() / conf.getInt(
-        "hama.graph.threadpool.percentage", 10)) + 1);
+    ExecutorService executor = Executors.newCachedThreadPool();
 
     while (currentMessage != null) {
       Runnable worker = new ComputeRunnable(vertices.get((V) currentMessage
@@ -282,9 +280,7 @@ public final class GraphJobRunner<V exte
     this.changedVertexCnt = 0;
     vertices.startSuperstep();
 
-    ExecutorService executor = Executors
-        .newFixedThreadPool((vertices.size() / conf.getInt(
-            "hama.graph.threadpool.percentage", 10)) + 1);
+    ExecutorService executor = Executors.newCachedThreadPool();
 
     for (Vertex<V, E, M> v : vertices.getValues()) {
       Runnable worker = new ComputeRunnable(v, null);
@@ -392,7 +388,7 @@ public final class GraphJobRunner<V exte
         .newInstance(conf.getClass(Constants.RUNTIME_PARTITION_RECORDCONVERTER,
             VertexInputReader.class));
 
-    ExecutorService executor = Executors.newFixedThreadPool(1000);
+    ExecutorService executor = Executors.newCachedThreadPool();
 
     try {
       KeyValuePair<Writable, Writable> next = null;