You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/09/20 10:58:33 UTC

[1/4] tinkerpop git commit: Added a test for persisting multi-properties in TinkerGraph

Repository: tinkerpop
Updated Branches:
  refs/heads/master 554bbb82e -> ba58ca1b0


Added a test for persisting multi-properties in TinkerGraph

Changed the test back to using a relative path in the data directory - didn't like it polluting the source control directories.


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

Branch: refs/heads/master
Commit: 356b7c81a9517c89204efb1f0e0e30037bd04ae0
Parents: 371bb39
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Sep 15 14:08:31 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Sep 15 14:41:00 2016 -0400

----------------------------------------------------------------------
 .../tinkergraph/structure/TinkerGraphTest.java  | 47 +++++++++++++-------
 1 file changed, 32 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/356b7c81/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index e9b7f7b..f5797ca 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.Io;
 import org.apache.tinkerpop.gremlin.structure.io.GraphReader;
 import org.apache.tinkerpop.gremlin.structure.io.GraphWriter;
@@ -440,25 +441,41 @@ public class TinkerGraphTest {
     }
 
     @Test
+    public void shouldPersistToGryoAndHandleMultiProperties() {
+        final String graphLocation = TestHelper.makeTestDataDirectory(TinkerGraphTest.class) + "shouldPersistToGryoMulti.kryo";
+        final File f = new File(graphLocation);
+        if (f.exists() && f.isFile()) f.delete();
+
+        final Configuration conf = new BaseConfiguration();
+        conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo");
+        conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation);
+        final TinkerGraph graph = TinkerGraph.open(conf);
+        TinkerFactory.generateTheCrew(graph);
+        graph.close();
+
+        conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.list.toString());
+        final TinkerGraph reloadedGraph = TinkerGraph.open(conf);
+        IoTest.assertCrewGraph(reloadedGraph, false);
+        reloadedGraph.close();
+    }
+
+    @Test
     public void shouldPersistWithRelativePath() {
-        final String graphLocation = "shouldPersistToGryoRelative.kryo";
+        final String graphLocation = TestHelper.convertToRelative(TinkerGraphTest.class,
+                new File(TestHelper.makeTestDataDirectory(TinkerGraphTest.class)))  + "shouldPersistToGryoRelative.kryo";
         final File f = new File(graphLocation);
         if (f.exists() && f.isFile()) f.delete();
 
-        try {
-            final Configuration conf = new BaseConfiguration();
-            conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo");
-            conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation);
-            final TinkerGraph graph = TinkerGraph.open(conf);
-            TinkerFactory.generateModern(graph);
-            graph.close();
-
-            final TinkerGraph reloadedGraph = TinkerGraph.open(conf);
-            IoTest.assertModernGraph(reloadedGraph, true, false);
-            reloadedGraph.close();
-        } catch (Exception ex) {
-            if (f.exists() && f.isFile()) f.delete();
-        }
+        final Configuration conf = new BaseConfiguration();
+        conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo");
+        conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation);
+        final TinkerGraph graph = TinkerGraph.open(conf);
+        TinkerFactory.generateModern(graph);
+        graph.close();
+
+        final TinkerGraph reloadedGraph = TinkerGraph.open(conf);
+        IoTest.assertModernGraph(reloadedGraph, true, false);
+        reloadedGraph.close();
     }
 
     @Test


[3/4] tinkerpop git commit: Merge branch 'TINKERPOP-1451' into tp31

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1451' into tp31


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

Branch: refs/heads/master
Commit: ec10b62d9a59be80858276a062aaea74e50d0cf0
Parents: 4ed0095 356b7c8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 20 06:57:46 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 20 06:57:46 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../tinkergraph/structure/TinkerGraph.java      |  4 +-
 .../tinkergraph/structure/TinkerGraphTest.java  | 39 ++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ec10b62d/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index a9dae9d,6984b58..8c5f7c7
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,8 -26,8 +26,9 @@@ image::https://raw.githubusercontent.co
  TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
 +* Improved session cleanup when a close is triggered by the client.
  * Removed the `appveyor.yml` file as the AppVeyor build is no longer enabled by Apache Infrastructure.
+ * Fixed TinkerGraph which was not saving on `close()` if the path only consisted of the file name.
  * Fixed a bug in `RangeByIsCountStrategy` which didn't use the `NotStep` properly.
  
  [[release-3-1-4]]


[4/4] tinkerpop git commit: Merge remote-tracking branch 'origin/tp31'

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/tp31'


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

Branch: refs/heads/master
Commit: ba58ca1b0791bd1dde6616e63e0d4fde830a6ba7
Parents: 554bbb8 ec10b62
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 20 06:58:12 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 20 06:58:12 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../tinkergraph/structure/TinkerGraph.java      |  4 +-
 .../tinkergraph/structure/TinkerGraphTest.java  | 39 ++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ba58ca1b/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ba58ca1b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ba58ca1b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------


[2/4] tinkerpop git commit: TinkerGraph's would not save on close()

Posted by sp...@apache.org.
TinkerGraph's would not save on close()

if the path was just a file name. Tested "just a file name" manually and added a test for relative paths - didn't want to generate test data outside of our test directories. TINKERPOP-1451


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

Branch: refs/heads/master
Commit: 371bb39c5c23bb766f391974ea024219a5941fe8
Parents: e7e7481
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Sep 15 13:51:33 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Sep 15 14:41:00 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../tinkergraph/structure/TinkerGraph.java      |  4 +++-
 .../tinkergraph/structure/TinkerGraphTest.java  | 22 ++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/371bb39c/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 4d990ee..6984b58 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 * Removed the `appveyor.yml` file as the AppVeyor build is no longer enabled by Apache Infrastructure.
+* Fixed TinkerGraph which was not saving on `close()` if the path only consisted of the file name.
 * Fixed a bug in `RangeByIsCountStrategy` which didn't use the `NotStep` properly.
 
 [[release-3-1-4]]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/371bb39c/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
index af7245a..5df47b6 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
@@ -299,7 +299,9 @@ public final class TinkerGraph implements Graph {
             f.delete();
         } else {
             final File parent = f.getParentFile();
-            if (!parent.exists()) {
+
+            // the parent would be null in the case of an relative path if the graphLocation was simply: "f.gryo"
+            if (parent != null && !parent.exists()) {
                 parent.mkdirs();
             }
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/371bb39c/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index fca1275..e9b7f7b 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -440,6 +440,28 @@ public class TinkerGraphTest {
     }
 
     @Test
+    public void shouldPersistWithRelativePath() {
+        final String graphLocation = "shouldPersistToGryoRelative.kryo";
+        final File f = new File(graphLocation);
+        if (f.exists() && f.isFile()) f.delete();
+
+        try {
+            final Configuration conf = new BaseConfiguration();
+            conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo");
+            conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation);
+            final TinkerGraph graph = TinkerGraph.open(conf);
+            TinkerFactory.generateModern(graph);
+            graph.close();
+
+            final TinkerGraph reloadedGraph = TinkerGraph.open(conf);
+            IoTest.assertModernGraph(reloadedGraph, true, false);
+            reloadedGraph.close();
+        } catch (Exception ex) {
+            if (f.exists() && f.isFile()) f.delete();
+        }
+    }
+
+    @Test
     public void shouldPersistToAnyGraphFormat() {
         final String graphLocation = TestHelper.makeTestDataDirectory(TinkerGraphTest.class) + "shouldPersistToAnyGraphFormat.dat";
         final File f = new File(graphLocation);