added graphNotSupported coverage to GraphComputerTest. Added JavaDocs here and there while I was waiting for the test suite to complete.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9852a60e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9852a60e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9852a60e Branch: refs/heads/TINKERPOP-1564 Commit: 9852a60e3f0ad357d9be01395c45e8812f4e9bce Parents: 1628291 Author: Marko A. Rodriguez <okramma...@gmail.com> Authored: Wed Jan 4 06:58:03 2017 -0700 Committer: Marko A. Rodriguez <okramma...@gmail.com> Committed: Thu Jan 19 13:01:41 2017 -0700 ---------------------------------------------------------------------- .../gremlin/akka/process/actor/MasterActor.java | 1 - .../gremlin/process/actor/ActorProgram.java | 29 ++++++++++++++++++-- .../gremlin/process/actor/GraphActors.java | 8 ++++++ .../process/computer/GraphComputerTest.java | 3 +- 4 files changed, 37 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9852a60e/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java ---------------------------------------------------------------------- diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java index aa31c28..0173a8f 100644 --- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java +++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java @@ -107,7 +107,6 @@ public final class MasterActor extends AbstractActor implements RequiresMessageQ @Override public void close() { context().system().terminate(); - } @Override http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9852a60e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/ActorProgram.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/ActorProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/ActorProgram.java index dd0d7e7..89002fe 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/ActorProgram.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/ActorProgram.java @@ -64,7 +64,7 @@ public interface ActorProgram<M> extends Cloneable { * @param worker the worker actor creating the worker program * @return the worker program */ - public Worker createWorkerProgram(final Actor.Worker worker); + public ActorProgram.Worker createWorkerProgram(final Actor.Worker worker); /** * Create the {@link org.apache.tinkerpop.gremlin.process.actor.Actor.Master} program. @@ -73,7 +73,7 @@ public interface ActorProgram<M> extends Cloneable { * @param master the master actor creating the master program * @return the master program */ - public Master createMasterProgram(final Actor.Master master); + public ActorProgram.Master createMasterProgram(final Actor.Master master); /** * Get the ordered list of message classes where order determines the priority @@ -99,15 +99,40 @@ public interface ActorProgram<M> extends Cloneable { @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") public ActorProgram<M> clone(); + /** + * The Worker program is executed by a worker process in the {@link GraphActors} system. + * There are many workers and a single master. + * All workers execute the same program. + * + * @param <M> The message type accepted by the worker + */ public static interface Worker<M> { + + /** + * This method is evaluated when the worker process is spawned. + */ public void setup(); + /** + * This method is evaluated when the worker receives a new message. + * + * @param message the received message + */ public void execute(final M message); + /** + * This method is evaluated when the worker process is destroyed. + */ public void terminate(); } + /** + * The Master program is executed by the master process in the {@link GraphActors} system. + * There are many workers and a single master. + * + * @param <M> The message type accepted by the master + */ public static interface Master<M> { public void setup(); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9852a60e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java index 29c032b..51f4c4a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java @@ -56,6 +56,14 @@ public interface GraphActors<R> extends Processor { */ public GraphActors<R> workers(final int workers); + /** + * Add an arbitrary configuration to the GraphActors system. + * Typically, these configurations are provider-specific and do not generalize across all GraphActor implementations. + * + * @param key the key of the configuration + * @param value the value of the configuration + * @return the updated GraphActors with newly defined configuration + */ public GraphActors<R> configure(final String key, final Object value); /** http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9852a60e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java ---------------------------------------------------------------------- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java index 9a99d0a..a3e22f7 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java @@ -93,7 +93,8 @@ import static org.junit.Assume.assumeNoException; "computerRequiresMoreWorkersThanSupported", "vertexFilterAccessesIncidentEdges", "edgeFilterAccessesAdjacentVertices", - "graphFilterNotSupported" + "graphFilterNotSupported", + "graphNotSupported" }) @ExceptionCoverage(exceptionClass = Memory.Exceptions.class, methods = { "memoryKeyCanNotBeEmpty",