You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@s2graph.apache.org by st...@apache.org on 2017/07/01 15:28:17 UTC

[26/46] incubator-s2graph git commit: Bug fix on Thread pool creation on S2Graph.open.

Bug fix on Thread pool creation on S2Graph.open.


Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/46cafb75
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/46cafb75
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/46cafb75

Branch: refs/heads/master
Commit: 46cafb756cf96535a04a706ce5b17fbf3936aef5
Parents: c7ab13e
Author: DO YUNG YOON <st...@apache.org>
Authored: Fri Apr 28 20:02:22 2017 +0900
Committer: DO YUNG YOON <st...@apache.org>
Committed: Fri Apr 28 21:35:36 2017 +0900

----------------------------------------------------------------------
 s2core/src/main/scala/org/apache/s2graph/core/S2Graph.scala    | 6 +++---
 s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/46cafb75/s2core/src/main/scala/org/apache/s2graph/core/S2Graph.scala
----------------------------------------------------------------------
diff --git a/s2core/src/main/scala/org/apache/s2graph/core/S2Graph.scala b/s2core/src/main/scala/org/apache/s2graph/core/S2Graph.scala
index efa7377..e30be74 100644
--- a/s2core/src/main/scala/org/apache/s2graph/core/S2Graph.scala
+++ b/s2core/src/main/scala/org/apache/s2graph/core/S2Graph.scala
@@ -93,6 +93,9 @@ object S2Graph {
   )
 
   var DefaultConfig: Config = ConfigFactory.parseMap(DefaultConfigs)
+  val numOfThread = Runtime.getRuntime.availableProcessors()
+  val threadPool = Executors.newFixedThreadPool(numOfThread)
+  val ec = ExecutionContext.fromExecutor(threadPool)
 
   def toTypeSafeConfig(configuration: Configuration): Config = {
     val m = new mutable.HashMap[String, AnyRef]()
@@ -117,9 +120,6 @@ object S2Graph {
   }
 
   def open(configuration: Configuration): S2Graph = {
-    val numOfThread = Runtime.getRuntime.availableProcessors()
-    val threadPool = Executors.newFixedThreadPool(numOfThread)
-    val ec = ExecutionContext.fromExecutor(threadPool)
     new S2Graph(configuration)(ec)
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/46cafb75/s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala
----------------------------------------------------------------------
diff --git a/s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala b/s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala
index aca9826..07d2bbf 100644
--- a/s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala
+++ b/s2core/src/main/scala/org/apache/s2graph/core/S2Property.scala
@@ -31,6 +31,7 @@ import scala.util.hashing.MurmurHash3
 object S2Property {
 
   def validType(t: Any): Boolean = t match {
+    case _: EdgeId => true
     case _: VertexId => true
     case _: java.lang.Integer => true
     case _: java.lang.Long => true