tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [31/50] tinkerpop git commit: TINKERPOP-1996 Added some javadoc and code formatting
Date Thu, 19 Jul 2018 17:41:50 GMT
TINKERPOP-1996 Added some javadoc and code formatting


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

Branch: refs/heads/TINKERPOP-1996
Commit: d181563d24a401ac6550e06d86d78b12a8f16f51
Parents: 767d65b
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Jul 11 10:36:11 2018 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Jul 19 13:39:29 2018 -0400

----------------------------------------------------------------------
 .../traversal/dsl/graph/GraphTraversalSource.java     | 14 ++++++++++++++
 .../gremlin/process/traversal/step/ReadWriting.java   |  8 ++++++++
 .../gremlin/process/traversal/step/map/IoStep.java    |  2 ++
 .../computer/traversal/step/map/HadoopIoStep.java     |  4 ++++
 .../computer/traversal/strategy/HadoopIoStrategy.java |  7 +++++++
 .../tinkergraph/structure/TinkerGraphPlayTest.java    |  2 --
 6 files changed, 35 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d181563d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index aa4995d..7357418 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -391,6 +391,20 @@ public class GraphTraversalSource implements TraversalSource {
         return traversal.addStep(new GraphStep<>(traversal, Edge.class, true, edgesIds));
     }
 
+    /**
+     * Performs a read or write based operation on the {@link Graph} backing this {@code
GraphTraversalSource}. This
+     * step can be accompanied by the {@link GraphTraversal#with(String, Object)} modulator
for further configuration
+     * and must be accompanied by a {@link GraphTraversal#read()} or {@link GraphTraversal#write()}
modulator step
+     * which will terminate the traversal.
+     *
+     * @param file the name of file for which the read or write will apply - note that the
context of how this
+     *             parameter is used is wholly dependent on the implementation
+     * @return the traversal with the {@link IoStep} added
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#io-step"
target="_blank">Reference Documentation - IO Step</a>
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#read-step"
target="_blank">Reference Documentation - Read Step</a>
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#write-step"
target="_blank">Reference Documentation - Write Step</a>
+     * @since 3.4.0
+     */
     public <S> GraphTraversal<S, S> io(final String file) {
         final GraphTraversalSource clone = this.clone();
         clone.bytecode.addStep(GraphTraversal.Symbols.io, file);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d181563d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ReadWriting.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ReadWriting.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ReadWriting.java
index 18de925..d0e8bbf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ReadWriting.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ReadWriting.java
@@ -18,11 +18,19 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step;
 
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
 /**
+ * An interface that defines a {@link Step} as one that handles IO based operations for a
{@link Graph}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public interface ReadWriting extends Configuring {
 
+    /**
+     * Determines the mode of the the IO operation as being for reading or writing (or by
default "unset")
+     */
     public enum Mode {
         UNSET,
         READING,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d181563d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IoStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IoStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IoStep.java
index 8d22427..b633360 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IoStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IoStep.java
@@ -38,6 +38,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 
 /**
+ * Handles read and write operations into the {@link Graph}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class IoStep<S> extends AbstractStep<S,S> implements ReadWriting {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d181563d/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/step/map/HadoopIoStep.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/step/map/HadoopIoStep.java
b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/step/map/HadoopIoStep.java
index 83a95e0..62937da 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/step/map/HadoopIoStep.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/step/map/HadoopIoStep.java
@@ -24,12 +24,16 @@ import org.apache.tinkerpop.gremlin.process.computer.Memory;
 import org.apache.tinkerpop.gremlin.process.computer.clone.CloneVertexProgram;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexProgramStep;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.ReadWriting;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 /**
+ * An OLAP oriented step for doing IO operations with {@link GraphTraversalSource#io(String)}
which uses the
+ * {@link CloneVertexProgram} for its implementation.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class HadoopIoStep extends VertexProgramStep implements ReadWriting {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d181563d/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
index 1805df8..38d5a7f 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
@@ -20,6 +20,8 @@
 package org.apache.tinkerpop.gremlin.hadoop.process.computer.traversal.strategy;
 
 import org.apache.tinkerpop.gremlin.hadoop.process.computer.traversal.step.map.HadoopIoStep;
+import org.apache.tinkerpop.gremlin.process.computer.clone.CloneVertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexProgramStep;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -30,6 +32,11 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 
 /**
+ * The default implementation of the {@link IoStep} is a single threaded operation and doesn't
properly take into
+ * account the method by which OLAP read/writes take place with Hadoop. This strategy removes
that step and replaces
+ * it with the {@link HadoopIoStep} which is a {@link VertexProgramStep} that uses the {@link
CloneVertexProgram} to
+ * execute the IO operation in an OLAP fashion.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class HadoopIoStrategy extends AbstractTraversalStrategy<TraversalStrategy.ProviderOptimizationStrategy>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d181563d/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
index 69062ef..598e434 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
@@ -20,9 +20,7 @@ package org.apache.tinkerpop.gremlin.tinkergraph.structure;
 
 import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Pop;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;


Mime
View raw message