You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/12/17 23:26:10 UTC

[1/2] incubator-tinkerpop git commit: Added JavaDoc for `OneTimeBulkLoader` and explained its behavior in the reference docs.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1026 271533664 -> 2e443039a


Added JavaDoc for `OneTimeBulkLoader` and explained its behavior in the reference docs.


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

Branch: refs/heads/TINKERPOP-1026
Commit: 7b042c317df6ed8e0e7acf4f295304f019968f1e
Parents: 2715336
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Dec 17 21:32:48 2015 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Dec 17 21:32:48 2015 +0100

----------------------------------------------------------------------
 docs/src/reference/the-graphcomputer.asciidoc   |  9 +++++----
 .../computer/bulkloading/OneTimeBulkLoader.java | 21 ++++++++++----------
 2 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7b042c31/docs/src/reference/the-graphcomputer.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-graphcomputer.asciidoc b/docs/src/reference/the-graphcomputer.asciidoc
index a1a6c74..2ebf2e9 100644
--- a/docs/src/reference/the-graphcomputer.asciidoc
+++ b/docs/src/reference/the-graphcomputer.asciidoc
@@ -364,10 +364,11 @@ It's recommended to tune this property for the target graph and not use the defa
 |`writeGraph(String)` | Sets the path to a `GraphFactory` compatible configuration file for the target graph. | _none_
 |========================================
 
-NOTE: `BulkLoaderVertexProgram` comes with a default `BulkLoader` implementation, namely `IncrementalBulkLoader`. It
-will work for the most use-cases, but has one limitation though: It doesn't support multi-valued properties.
-`IncrementalBulkLoader` will handle every property as a single-valued property. A custom `BulkLoader` implementation
-has to be used if the default behavior is not sufficient.
+NOTE: `BulkLoaderVertexProgram` uses the `IncrementalBulkLoader` by default. The other option is the `OneTimeBulkLoader`,
+which doesn't store any temporary IDs in the `writeGraph` and thus should only be used for initial bulk loads. Both
+implementations should cover the mahority of use-cases, but have a limitation though: They don't support multi-valued
+properties. `OneTimeBulkLoader` and `IncrementalBulkLoader` will handle every property as a single-valued property. A
+custom `BulkLoader` implementation has to be used if the default behavior is not sufficient.
 
 NOTE: A custom `BulkLoader` implementation for incremental loading should use `GraphTraversal` methods to create/update
 elements (e.g. `g.addV()` instead of `graph.addVertex()`). This way the `BulkLoaderVertexProgram` is able to efficiently

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7b042c31/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/OneTimeBulkLoader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/OneTimeBulkLoader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/OneTimeBulkLoader.java
index eb0bf1a..cf0528c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/OneTimeBulkLoader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/OneTimeBulkLoader.java
@@ -19,20 +19,21 @@
 package org.apache.tinkerpop.gremlin.process.computer.bulkloading;
 
 import org.apache.commons.configuration.Configuration;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 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.__;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 
-import java.util.Iterator;
-
 /**
+ * {@link org.apache.tinkerpop.gremlin.process.computer.bulkloading.OneTimeBulkLoader} is a
+ * {@link org.apache.tinkerpop.gremlin.process.computer.bulkloading.BulkLoader} implementation that should be used
+ * for initial bulk loads. In contrast to {@link org.apache.tinkerpop.gremlin.process.computer.bulkloading.IncrementalBulkLoader}
+ * it doesn't store temporary identifiers in the write graph nor does it attempt to find existing elements, instead it
+ * only clones each element from the source graph.
+ *
  * @author Daniel Kuppitz (http://gremlin.guru)
  */
 public class OneTimeBulkLoader implements BulkLoader {
@@ -40,7 +41,7 @@ public class OneTimeBulkLoader implements BulkLoader {
     private boolean userSuppliedIds = false;
 
     /**
-     * {@inheritDoc}
+     * Creates a clone of the given vertex in the given graph.
      */
     @Override
     public Vertex getOrCreateVertex(final Vertex vertex, final Graph graph, final GraphTraversalSource g) {
@@ -49,7 +50,7 @@ public class OneTimeBulkLoader implements BulkLoader {
     }
 
     /**
-     * {@inheritDoc}
+     * Creates a clone of the given edge between the given in- and out-vertices.
      */
     @Override
     public Edge getOrCreateEdge(final Edge edge, final Vertex outVertex, final Vertex inVertex, final Graph graph, final GraphTraversalSource g) {
@@ -57,7 +58,7 @@ public class OneTimeBulkLoader implements BulkLoader {
     }
 
     /**
-     * {@inheritDoc}
+     * Creates a clone of the given property for the given vertex.
      */
     @Override
     public VertexProperty getOrCreateVertexProperty(final VertexProperty<?> property, final Vertex vertex, final Graph graph, final GraphTraversalSource g) {
@@ -81,7 +82,7 @@ public class OneTimeBulkLoader implements BulkLoader {
     }
 
     /**
-     * {@inheritDoc}
+     * Always returns false.
      */
     @Override
     public boolean keepOriginalIds() {
@@ -89,7 +90,7 @@ public class OneTimeBulkLoader implements BulkLoader {
     }
 
     /**
-     * {@inheritDoc}
+     * Always returns null.
      */
     @Override
     public String getVertexIdProperty() {


[2/2] incubator-tinkerpop git commit: updated one BLVP sample to use OneTimeBulkLoder

Posted by dk...@apache.org.
updated one BLVP sample to use OneTimeBulkLoder


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

Branch: refs/heads/TINKERPOP-1026
Commit: 2e443039ab29f3ce343f6bcdb41ffe40b77fe7c5
Parents: 7b042c3
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Dec 17 23:19:10 2015 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Dec 17 23:19:10 2015 +0100

----------------------------------------------------------------------
 docs/src/reference/the-graphcomputer.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2e443039/docs/src/reference/the-graphcomputer.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-graphcomputer.asciidoc b/docs/src/reference/the-graphcomputer.asciidoc
index 2ebf2e9..924215d 100644
--- a/docs/src/reference/the-graphcomputer.asciidoc
+++ b/docs/src/reference/the-graphcomputer.asciidoc
@@ -338,7 +338,7 @@ writeGraphConf.setProperty("gremlin.tinkergraph.graphFormat", "gryo")
 writeGraphConf.setProperty("gremlin.tinkergraph.graphLocation", "/tmp/tinkergraph.kryo")
 modern = TinkerFactory.createModern()
 blvp = BulkLoaderVertexProgram.build().
-           keepOriginalIds(false).
+           bulkLoader(OneTimeBulkLoader).
            writeGraph(writeGraphConf).create(modern)
 modern.compute().workers(1).program(blvp).submit().get()
 graph = GraphFactory.open(writeGraphConf)