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 2016/09/21 20:51:57 UTC

[1/7] tinkerpop git commit: Added a test for persisting multi-properties in TinkerGraph [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1115 54c08a7ff -> 68188e272 (forced update)


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/TINKERPOP-1115
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


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

Posted by dk...@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/TINKERPOP-1115
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]]


[5/7] tinkerpop git commit: Corrected test names in MapTest CTR

Posted by dk...@apache.org.
Corrected test names in MapTest CTR


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

Branch: refs/heads/TINKERPOP-1115
Commit: f22ec97422464479bacfa31aff0320d1417547a3
Parents: ec10b62
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 20 14:45:00 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 20 14:45:00 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                               | 1 +
 .../tinkerpop/gremlin/process/traversal/step/map/MapTest.java    | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f22ec974/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 8c5f7c7..4b39cc7 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Corrected naming of `g_withPath_V_asXaX_out_out_mapXa_name_it_nameX` and `g_withPath_V_asXaX_out_mapXa_nameX` in `MapTest`.
 * 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.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f22ec974/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java
index 0ea91ec..40c92e9 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java
@@ -87,7 +87,7 @@ public abstract class MapTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     @IgnoreEngine(TraversalEngine.Type.COMPUTER)
-    public void g_V_asXaX_out_mapXa_nameX() {
+    public void g_withPath_V_asXaX_out_mapXa_nameX() {
         int marko = 0;
         int peter = 0;
         int josh = 0;
@@ -111,7 +111,7 @@ public abstract class MapTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     @IgnoreEngine(TraversalEngine.Type.COMPUTER)
-    public void g_V_asXaX_out_out_mapXa_name_it_nameX() {
+    public void g_withPath_V_asXaX_out_out_mapXa_name_it_nameX() {
         final Traversal<Vertex, String> traversal = get_g_withPath_V_asXaX_out_out_mapXa_name_it_nameX();
         int counter = 0;
         while (traversal.hasNext()) {


[6/7] tinkerpop git commit: Finalize variable CTR

Posted by dk...@apache.org.
Finalize variable CTR


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

Branch: refs/heads/TINKERPOP-1115
Commit: 02bbdfbc3712d7b3d988245a5df860838ddb67df
Parents: f22ec97
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 20 14:50:07 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 20 14:50:07 2016 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/02bbdfbc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
index c5d19b5..b761719 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
@@ -36,7 +36,7 @@ import java.io.NotSerializableException;
  */
 public class GremlinProcessRunner extends BlockJUnit4ClassRunner {
     private static final Logger logger = LoggerFactory.getLogger(GremlinProcessRunner.class);
-    public GremlinProcessRunner(Class<?> klass) throws InitializationError {
+    public GremlinProcessRunner(final Class<?> klass) throws InitializationError {
         super(klass);
     }
 


[3/7] tinkerpop git commit: Updated dev docs regarding branching and pull requests CTR

Posted by dk...@apache.org.
Updated dev docs regarding branching and pull requests CTR


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

Branch: refs/heads/TINKERPOP-1115
Commit: 4ed009525ba3c0bed01fd2331b54ee1dbb76284c
Parents: 75baf01
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Sep 16 10:14:59 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Sep 16 10:14:59 2016 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/contributing.asciidoc   |  6 +-
 docs/src/dev/developer/for-committers.asciidoc | 83 ++++++++++++++++++---
 2 files changed, 76 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ed00952/docs/src/dev/developer/contributing.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/contributing.asciidoc b/docs/src/dev/developer/contributing.asciidoc
index 36124f1..63c40b7 100644
--- a/docs/src/dev/developer/contributing.asciidoc
+++ b/docs/src/dev/developer/contributing.asciidoc
@@ -179,9 +179,9 @@ link:https://github.com/apache/tinkerpop[GitHub repository] if not already done.
 . Make changes in the fork
 .. It is typically best to create a branch for the changes. Consider naming that branch after the JIRA issue number
 to easily track what that branch is for.
-.. Consider which branch to create the branch from in the first place. In other words, is the change to be targetted
-at a specific TinkerPop version (e.g. a patch to an older version)? When in doubt, please ask on
-dev@tinkerpop.apache.org.
+.. Consider which release branch (e.g. `master`, `tp31` etc) to create the development branch from in the first place.
+In other words, is the change to be targetted at a specific TinkerPop version (e.g. a patch to an older version)? When
+in doubt, please ask on dev@tinkerpop.apache.org.
 . Build the project and run tests.
 .. A simple build can be accomplished with maven: `mvn clean install`.
 .. Often, a "simple build" isn't sufficient and integration tests are required:

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ed00952/docs/src/dev/developer/for-committers.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/for-committers.asciidoc b/docs/src/dev/developer/for-committers.asciidoc
index fa88070..9c5059c 100644
--- a/docs/src/dev/developer/for-committers.asciidoc
+++ b/docs/src/dev/developer/for-committers.asciidoc
@@ -60,13 +60,18 @@ change.
 Changes that break the public APIs should be marked with a "breaking" label and should be
 distinguished from other changes in the release notes.
 
+[[branches]]
 Branches
 --------
 
-The "master" branch is used for the main line of development and release branches are constructed as needed
-for ongoing maintenance work. If new to the project or are returning to it after some time away, it may be good
-to send an email to the developer mailing list (or ask on HipChat) to find out what the current operating branches
-are.
+TinkerPop has several release branches:
+
+* `tp30` - 3.0.x (no longer maintained)
+* `tp31` - 3.1.x (bug fixes and documentation updates only)
+* `master` - 3.2.x
+
+Changes to `tp31` should merge to `master`. Please read more about this process in the <<pull-requests, Pull Requests>>
+section.
 
 Other branches may be created for collaborating on features or for RFC's that other developers may want to inspect.
 It is suggested that the JIRA issue ID be used as the prefix, since that triggers certain automation, and it provides a
@@ -200,8 +205,8 @@ Review then Commit
 ------------------
 
 Code modifications must go through a link:http://www.apache.org/foundation/glossary.html#ReviewThenCommit[review-then-committ] (RTC)
-process before being merged into a release branch. All committers should follow the pattern below, where "you" refers to the
-committer wanting to put code into a release branch.
+process before being merged into a release branch. All committers should follow the pattern below, where "you" refers
+to the committer wanting to put code into a release branch.
 
 * Make a JIRA ticket for the software problem you want to solve (i.e. a fix).
 * Fork the release branch that the fix will be put into.
@@ -210,7 +215,7 @@ committer wanting to put code into a release branch.
 * When your fix is complete and ready to merge, issue a link:https://git-scm.com/docs/git-request-pull[pull request].
 ** Be certain that the test suite is passing.
 ** If you updated documentation, be sure that the `process-docs.sh` is building the documentation correctly.
-* Before you can merge your branch into the release branch, you must have at least 3 +1 link:http://www.apache.org/foundation/glossary.html#ConsensusApproval[consensus votes].
+* Before you can merge your branch into the release branch, you must have at least 3 +1 link:http://www.apache.org/foundation/glossary.html#ConsensusApproval[consensus votes] from other committers.
 ** Please see the Apache Software Foundations regulations regarding link:http://www.apache.org/foundation/voting.html#votes-on-code-modification[Voting on Code Modifications].
 * Votes are issued by TinkerPop committers as comments to the pull request.
 * Once 3 +1 votes are received, you are responsible for merging to the release branch and handling any merge conflicts.
@@ -236,10 +241,11 @@ When the committer chooses CTR, it is considered good form to include something
 that CTR was invoked and the reason for doing so.  For example, "Invoking CTR as this change encompasses minor
 adjustments to text formatting."
 
-Pull Request Format
-~~~~~~~~~~~~~~~~~~~
+[[pull-requests]]
+Pull Requests
+~~~~~~~~~~~~~
 
-When you submit a pull request, be sure it uses the following style.
+When submitting a pull request to one of the <<branches, release branches>>, be sure it uses the following style:
 
 * The title of the pull request is the JIRA ticket number + "colon" + the title of the JIRA ticket.
 * The first line of the pull request message should contain a link to the JIRA ticket.
@@ -254,6 +260,63 @@ When you submit a pull request, be sure it uses the following style.
 ** These types of "on merge tweaks" are typically done to extremely dynamic files to combat and merge conflicts.
 * If you are a TinkerPop committer, you can VOTE on your own pull request, so please do so.
 
+A pull request will typically be made to a target <<branches, branch>>. Assuming that branch is upstream of other
+release branches (e.g. a pull request made to for the branch containing 3.1.x must merge to the branch that releases
+3.2.x), it is important to be sure that those changes are merged to the downstream release branches. Typicaly,
+this process is best handled by multiple pull requests: one to each release branch.
+
+As an example, consider a situation where there is a feature branch named "TINKERPOP-1234" that contains a fix for
+the `tp31` branch:
+
+[source,bash]
+----
+`git checkout -b TINKERPOP-1234 tp31`
+// do a bunch of stuff to implement TINKERPOP-1234 and commit/push
+git checkout -b <TINKERPOP-1234-master> master
+git merge TINKERPOP-1234
+----
+
+At this point, there are two branches, with the same set of commits going to `tp31` and `master`. Voting will occur
+on both pull requests. After a successful vote, it is time to merge. If there are no conflicts, then simply `git merge`
+both pull requests to their respective branches. If there are conflicts, then there is some added work to do - time to
+rebase:
+
+[source,bash]
+----
+git checkout TINKERPOP-1234
+git rebase origin/tp31
+----
+
+Depending on the conflict, it might be a good idea to re-test before going any further, otherwise:
+
+[source,bash]
+----
+git push origin TINKERPOP-1234 --force
+----
+
+Now, `git rebase` has re-written the commit history, which makes a mess of the other pull request to master. This
+problem is rectified by essentially re-issuing the PR:
+
+[source,bash]
+----
+git checkout TINKERPOP-1234-master
+git reset --hard origin/master
+git merge TINKERPOP-1234
+----
+
+Again, depending on the changes, it may make sense to re-test at this point, otherwise:
+
+[source,bash]
+----
+git push origin TINKERPOP-1234-master --force
+----
+
+It should not be safe to merge both pull requests to their release branches.
+
+IMPORTANT: Always take a moment to review the commits in a particular pull request. Be sure that they are *all* related
+to the work that was done and that no extraneous commits are present that cannot be explained. Ensuring a pull request
+only contains the expected commits is the responsibility of the committer as well as the reviewer.
+
 [[dependencies]]
 Dependencies
 ------------


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

Posted by dk...@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/TINKERPOP-1115
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);


[7/7] tinkerpop git commit: Added documentation for the traversal representations of general steps (map, flatMap, filter, sideEffect, branch).

Posted by dk...@apache.org.
Added documentation for the traversal representations of general steps (map, flatMap, filter, sideEffect, branch).


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

Branch: refs/heads/TINKERPOP-1115
Commit: 68188e272beb59e898c38021204f27e7f8a4a626
Parents: 02bbdfb
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Sep 16 16:26:19 2016 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Sep 21 22:51:33 2016 +0200

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 49 ++++++++++++++++----------
 1 file changed, 30 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68188e27/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 9309e23..3530be3 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -55,27 +55,27 @@ for an anonymous traversal, it is possible to simply write `inE()`. Be aware of
 when using anonymous traversals. For example, `in` and `as` are reserved keywords in Groovy, therefore you must use
 the verbose syntax `__.in()` and `__.as()` to avoid collisions.
 
-[[lambda-steps]]
-Lambda Steps
-~~~~~~~~~~~~
-
-WARNING: Lambda steps are presented for educational purposes as they represent the foundational constructs of the
-Gremlin language. In practice, lambda steps should be avoided and traversal verification strategies exist to disallow t
-heir use unless explicitly "turned off." For more information on the problems with lambdas, please read
-<<a-note-on-lambdas,A Note on Lambdas>>.
+[[general-steps]]
+General Steps
+~~~~~~~~~~~~~
 
-There are four generic steps by which all other specific steps described later extend.
+There are five general steps, each having a traversal and a lambda representation, by which all other specific steps described later extend.
 
 [width="100%",cols="10,12",options="header"]
 |=========================================================
 | Step| Description
-| `map(Function<Traverser<S>, E>)` | map the traverser to some object of type `E` for the next step to process.
-| `flatMap(Function<Traverser<S>, Iterator<E>>)` | map the traverser to an iterator of `E` objects that are streamed to the next step.
-| `filter(Predicate<Traverser<S>>)` | map the traverser to either true or false, where false will not pass the traverser to the next step.
-| `sideEffect(Consumer<Traverser<S>>)` | perform some operation on the traverser and pass it to the next step.
-| `branch(Function<Traverser<S>,M>)` | split the traverser to all the traversals indexed by the `M` token.
+| `map(Traversal<S, E>)` <br> `map(Function<Traverser<S>, E>)` | map the traverser to some object of type `E` for the next step to process.
+| `flatMap(Traversal<S, E>)` <br> `flatMap(Function<Traverser<S>, Iterator<E>>)` | map the traverser to an iterator of `E` objects that are streamed to the next step.
+| `filter(Traversal<?, ?>)` <br> `filter(Predicate<Traverser<S>>)` | map the traverser to either true or false, where false will not pass the traverser to the next step.
+| `sideEffect(Traversal<S, S>)` <br> `sideEffect(Consumer<Traverser<S>>)` | perform some operation on the traverser and pass it to the next step.
+| `branch(Traversal<S, M>)` <br> `branch(Function<Traverser<S>,M>)` | split the traverser to all the traversals indexed by the `M` token.
 |=========================================================
 
+WARNING: Lambda steps are presented for educational purposes as they represent the foundational constructs of the
+Gremlin language. In practice, lambda steps should be avoided in favor of their traversals representation and traversal
+verification strategies exist to disallow their use unless explicitly "turned off." For more information on the problems
+with lambdas, please read <<a-note-on-lambdas,A Note on Lambdas>>.
+
 The `Traverser<S>` object provides access to:
 
  . The current traversed `S` object -- `Traverser.get()`.
@@ -92,43 +92,54 @@ image:map-lambda.png[width=150,float=right]
 ----
 g.V(1).out().values('name') <1>
 g.V(1).out().map {it.get().value('name')} <2>
+g.V(1).out().map(values('name')) <3>
 ----
 
 <1> An outgoing traversal from vertex 1 to the name values of the adjacent vertices.
 <2> The same operation, but using a lambda to access the name property values.
+<3> Again the same operation, but using the traversal representation of `map()`.
 
 image:filter-lambda.png[width=160,float=right]
 [gremlin-groovy,modern]
 ----
 g.V().filter {it.get().label() == 'person'} <1>
-g.V().hasLabel('person') <2>
+g.V().filter(label().is('person')) <2>
+g.V().hasLabel('person') <3>
 ----
 
 <1> A filter that only allows the vertex to pass if it has an age-property.
-<2> The more specific `has()`-step is implemented as a `filter()` with respective predicate.
+<2> The same operation, but using the traversal represention of `filter()`.
+<3> The more specific `has()`-step is implemented as a `filter()` with respective predicate.
 
 
 image:side-effect-lambda.png[width=175,float=right]
 [gremlin-groovy,modern]
 ----
 g.V().hasLabel('person').sideEffect(System.out.&println) <1>
+g.V().sideEffect(outE().count().store("o")).
+      sideEffect(inE().count().store("i")).cap("o","i") <2>
 ----
 
 <1> Whatever enters `sideEffect()` is passed to the next step, but some intervening process can occur.
+<2> Compute the out- and in-degree for each vertex. Both `sideEffect()` are fed with the same vertex.
 
 image:branch-lambda.png[width=180,float=right]
 [gremlin-groovy,modern]
 ----
-g.V().branch(values('name')).
+g.V().branch {it.get().value('name')}.
       option('marko', values('age')).
       option(none, values('name')) <1>
+g.V().branch(values('name')).
+      option('marko', values('age')).
+      option(none, values('name')) <2>
 g.V().choose(has('name','marko'),
              values('age'),
-             values('name')) <2>
+             values('name')) <3>
 ----
 
 <1> If the vertex is "marko", get his age, else get the name of the vertex.
-<2> The more specific boolean-based `choose()`-step is implemented as a `branch()`.
+<2> The same operation, but using the traversal represention of `branch()`.
+<3> The more specific boolean-based `choose()`-step is implemented as a `branch()`.
 
 [[addedge-step]]
 AddEdge Step