tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [30/50] [abbrv] tinkerpop git commit: trivial tweaks. going to take a break.
Date Mon, 23 Jan 2017 21:24:26 GMT
trivial tweaks. going to take a break.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d74ee61c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d74ee61c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d74ee61c

Branch: refs/heads/TINKERPOP-1564
Commit: d74ee61c8b77cba90ca330bcad11fe0941808b37
Parents: 0cfc62c
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Thu Jan 12 09:23:36 2017 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Jan 23 14:22:53 2017 -0700

----------------------------------------------------------------------
 .../gremlin/akka/process/actors/AkkaConfigFactory.java      | 9 ++++++---
 .../gremlin/akka/process/actors/AkkaGraphActors.java        | 3 ++-
 .../tinkerpop/gremlin/akka/process/actors/MasterActor.java  | 3 +--
 .../tinkerpop/gremlin/akka/process/actors/WorkerActor.java  | 4 ++--
 .../gremlin/akka/process/actors/io/gryo/GryoSerializer.java | 3 +--
 akka-gremlin/src/main/resources/application.conf            | 1 -
 .../gremlin/akka/process/actors/AkkaActorsProvider.java     | 4 ++--
 7 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
index adbcf03..7a7c958 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
@@ -21,14 +21,12 @@ package org.apache.tinkerpop.gremlin.akka.process.actors;
 
 import akka.actor.Address;
 import akka.actor.AddressFromURIString;
-import akka.actor.Deploy;
-import akka.actor.Props;
-import akka.remote.RemoteScope;
 import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
 import com.typesafe.config.ConfigValueFactory;
 import org.apache.tinkerpop.gremlin.akka.process.actors.io.gryo.GryoSerializer;
 import org.apache.tinkerpop.gremlin.process.actors.ActorProgram;
+import org.apache.tinkerpop.gremlin.structure.Partition;
 
 import java.net.InetAddress;
 import java.util.Collections;
@@ -71,4 +69,9 @@ final class AkkaConfigFactory {
         final List<String> seedNodes = ConfigFactory.defaultApplication().getStringList("akka.cluster.seed-nodes");
         return AddressFromURIString.parse(seedNodes.get(0));
     }
+
+    static Address getWorkerActorDeployment(final Partition partition) {
+        final String location = partition.location().isSiteLocalAddress() ? "127.0.0.1" :
partition.location().getHostAddress().toString();
+        return AddressFromURIString.parse("akka.tcp://traversal@" + location + ":2552");
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGraphActors.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGraphActors.java
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGraphActors.java
index 9601320..0e80924 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGraphActors.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGraphActors.java
@@ -65,6 +65,7 @@ public final class AkkaGraphActors<R> implements GraphActors<R>
{
     @Override
     public GraphActors<R> program(final ActorProgram actorProgram) {
         this.actorProgram = actorProgram;
+        actorProgram.storeState(this.configuration);
         return this;
     }
 
@@ -91,8 +92,8 @@ public final class AkkaGraphActors<R> implements GraphActors<R>
{
         final ActorsResult<R> result = new DefaultActorsResult<>();
         try {
             final Configuration programConfiguration = new SerializableConfiguration(this.configuration);
-            this.actorProgram.storeState(programConfiguration);
             ConfigurationUtils.copy(graph.configuration(), programConfiguration);
+            ///////
             final akka.actor.Address masterAddress = AkkaConfigFactory.getMasterActorDeployment();
             new Address.Master(system.actorOf(
                     Props.create(MasterActor.class, programConfiguration, result).withDeploy(new
Deploy(new RemoteScope(masterAddress))),

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/MasterActor.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/MasterActor.java
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/MasterActor.java
index 2b4d6b5..3231645 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/MasterActor.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/MasterActor.java
@@ -70,11 +70,10 @@ public final class MasterActor extends AbstractActor implements RequiresMessageQ
         this.workers = new ArrayList<>();
         final List<Partition> partitions = partitioner.getPartitions();
         for (final Partition partition : partitions) {
-            akka.actor.Address addr = AkkaConfigFactory.getMasterActorDeployment();
             final String workerPathString = "worker-" + partition.id();
             this.workers.add(new Address.Worker(workerPathString, partition.location()));
             context().actorOf(Props.create(WorkerActor.class, configuration, this.workers.size()-1,
this.master)
-                    .withDeploy(new Deploy(new RemoteScope(addr))),
+                    .withDeploy(new Deploy(new RemoteScope(AkkaConfigFactory.getWorkerActorDeployment(partition)))),
                     workerPathString);
         }
         this.masterProgram = actorProgram.createMasterProgram(this);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/WorkerActor.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/WorkerActor.java
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/WorkerActor.java
index 73623f5..f90f081 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/WorkerActor.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/WorkerActor.java
@@ -56,10 +56,10 @@ public final class WorkerActor extends AbstractActor implements RequiresMessageQ
         final ActorProgram actorProgram = ActorProgram.createActorProgram(graph, configuration);
         this.partitioner = new HashPartitioner(graph.partitioner(), 5);
         this.localPartition = this.partitioner.getPartitions().get(workerIndex);
-        this.self = new Address.Worker(this.createWorkerAddress(localPartition), localPartition.location());
+        this.self = new Address.Worker(this.createWorkerAddress(this.localPartition), this.localPartition.location());
         this.master = master;
         this.workers = new ArrayList<>();
-        for (final Partition partition : partitioner.getPartitions()) {
+        for (final Partition partition : this.partitioner.getPartitions()) {
             this.workers.add(new Address.Worker(this.createWorkerAddress(partition), partition.location()));
         }
         this.workerProgram = actorProgram.createWorkerProgram(this);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
index a8ded2e..8f55e32 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
@@ -58,8 +58,7 @@ public final class GryoSerializer implements Serializer {
                                         BarrierDoneMessage.class,
                                         SideEffectSetMessage.class,
                                         SideEffectAddMessage.class,
-                                        DefaultActorsResult.class,
-                                        Address.Master.class)).create();
+                                        DefaultActorsResult.class)).create();
     }
 
     public GryoMapper getGryoMapper() {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/resources/application.conf b/akka-gremlin/src/main/resources/application.conf
index 188a821..d722ee3 100644
--- a/akka-gremlin/src/main/resources/application.conf
+++ b/akka-gremlin/src/main/resources/application.conf
@@ -18,7 +18,6 @@ akka {
     seed-nodes = [
       "akka.tcp://traversal@127.0.0.1:2552"
       "akka.tcp://traversal@127.0.0.1:2552"]
-
     auto-down-unreachable-after = 10s
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74ee61c/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
index bf52089..b92d39e 100644
--- a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
+++ b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
@@ -133,9 +133,9 @@ public class AkkaActorsProvider extends AbstractGraphProvider {
             if (null != loadGraphWith) {
                 put(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, loadGraphDataViaHadoopConfig(loadGraphWith));
                 put(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo");
+                if (loadGraphWith == LoadGraphWith.GraphData.CREW)
+                    put(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY,
VertexProperty.Cardinality.list.name());
             }
-            if (loadGraphWith == LoadGraphWith.GraphData.CREW)
-                put(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY,
VertexProperty.Cardinality.list.name());
         }};
     }
 


Mime
View raw message