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/08/08 11:59:16 UTC

[1/7] tinkerpop git commit: Added new recipe for Traversal Induced Values. [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1151 8bf021d28 -> d0606ec25 (forced update)


Added new recipe for Traversal Induced Values.


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

Branch: refs/heads/TINKERPOP-1151
Commit: ee50a6fafabeef14b99dee308e71d9cc98619977
Parents: 8f7218d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 3 18:54:28 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Aug 4 06:10:40 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 docs/src/recipes/index.asciidoc                 |  2 +
 .../recipes/traversal-induced-values.asciidoc   | 83 ++++++++++++++++++++
 3 files changed, 86 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ee50a6fa/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 22d2b32..43f5cc4 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.2 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added new recipe for "Traversal Induced Values".
 * Fixed a potential leak of a `ReferenceCounted` resource in Gremlin Server.
 * Added class registrations for `Map.Entry` implementations to `GryoMapper`.
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ee50a6fa/docs/src/recipes/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/index.asciidoc b/docs/src/recipes/index.asciidoc
index 18b5c9e..67a7932 100644
--- a/docs/src/recipes/index.asciidoc
+++ b/docs/src/recipes/index.asciidoc
@@ -46,6 +46,8 @@ include::cycle-detection.asciidoc[]
 
 include::centrality.asciidoc[]
 
+include::traversal-induced-values.asciidoc[]
+
 Implementation Recipes
 ======================
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ee50a6fa/docs/src/recipes/traversal-induced-values.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/traversal-induced-values.asciidoc b/docs/src/recipes/traversal-induced-values.asciidoc
new file mode 100644
index 0000000..6adefc7
--- /dev/null
+++ b/docs/src/recipes/traversal-induced-values.asciidoc
@@ -0,0 +1,83 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+[[traversal-induced-values]]
+Traversal Induced Values
+------------------------
+
+The parameters of a `Traversal` can be known ahead of time as constants or might otherwise be passed in as dynamic
+arguments.
+
+[gremlin-groovy,modern]
+----
+g.V().has('name','marko').out('knows').has('age', gt(29)).values('name')
+----
+
+In plain language, the above Gremlin asks, "What are the names of the people who Marko knows who are over the age of
+29?". In this case, "29" is known as a constant to the traversal. Of course, if the question is changed slightly to
+instead ask, "What are the names of the people who Marko knows who are older than he is?", the hardcoding of "29" will
+no longer suffice. There are multiple ways Gremlin would allow this second question to be answered. The first is
+obvious to any programmer - use a variable:
+
+[gremlin-groovy,modern]
+----
+marko = g.V().has('name','marko').next()
+g.V(marko).out('knows').has('age', gt(marko.value('age'))).values('name')
+----
+
+The downside to this approach is that it takes two separate traversals to answer the question. Ideally, there should
+be a single traversal, that can query "marko" once, determine his `age` and then use that for the value supplied to
+filter the people he knows. In this way the _value_ for the `age` filter is _induced_ from the `Traversal` itself.
+
+[gremlin-groovy,modern]
+----
+g.V().has('name','marko').as('marko').         <1>
+  out('knows').as('friend').                   <2>
+  filter(select('marko','friend').by('age').   <3>
+         where('friend', gt('marko'))).        <4>
+  values('name')
+----
+
+<1> Find the "marko" `Vertex` and label it as "marko".
+<2> Traverse out on the "knows" edges to the adjacent `Vertex` and label it as "person".
+<3> Filter the incoming "person" vertices. It is within this filter, that the traversal induced values are utilized.
+The inner `select` grabs the "marko" vertex and the current "friend". The `by` modulator extracts the "age" from both
+of those vertices which yields a `Map` with two keys, "marko" and "friend", where the value of each is the "age".
+<4> The `Map` produced in the previous step can then be filtered with `where` to only return a result if the "friend"
+age is greater than the "marko" age. If this is successful, then the `filter` step from the previous line will succeed
+and allow the "friend" vertex to pass through.
+
+This traversal could also be written declaratively with `match` step as follows:
+
+[gremlin-groovy,modern]
+----
+g.V().has('name','marko').match(
+    __.as('marko').values('age').as('a'),
+    __.as('marko').out('knows').as('friend'),
+    __.as('friend').values('age').as('b')
+  ).where('b', gt('a')).select('friend').
+  values('name')
+----
+
+Traversal induced values are not just for filtering. They can also be used when writing the values of the properties
+of one `Vertex` to another:
+
+[gremlin-groovy,modern]
+----
+g.V().has('name', 'marko').as('marko').
+  out('created').property('creator', select('marko').by('name'))
+g.V().has('name', 'marko').out('created').valueMap()
+----
\ No newline at end of file


[5/7] tinkerpop git commit: Merge branch 'pr-376' into tp31

Posted by sp...@apache.org.
Merge branch 'pr-376' into tp31


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

Branch: refs/heads/TINKERPOP-1151
Commit: 4571061dbb386d4aaaebd55efca2078703b95153
Parents: 58d8bad 6732921
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 8 07:50:16 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 8 07:50:16 2016 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/development-environment.asciidoc |  2 +-
 docs/src/dev/developer/for-committers.asciidoc          |  4 ++--
 docs/src/dev/developer/release.asciidoc                 |  8 ++++----
 docs/src/tutorials/getting-started/index.asciidoc       | 12 ++++++------
 gremlin-console/bin/gremlin.sh                          |  4 ++--
 gremlin-driver/pom.xml                                  |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------



[4/7] 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/31f79ea8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/31f79ea8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/31f79ea8

Branch: refs/heads/TINKERPOP-1151
Commit: 31f79ea86cb5cc19de4c67c935eb8995e4709e00
Parents: ee50a6f 58d8bad
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 8 06:50:59 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 8 06:50:59 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../src/reference/gremlin-applications.asciidoc |  6 +-
 .../upgrade/release-3.1.x-incubating.asciidoc   | 22 +++++-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  2 -
 .../handler/GremlinResponseFrameEncoder.java    | 13 +++-
 .../server/GremlinDriverIntegrateTest.java      | 81 +++++++++++---------
 6 files changed, 75 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/31f79ea8/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------


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

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

Conflicts:
	docs/src/dev/developer/development-environment.asciidoc


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

Branch: refs/heads/TINKERPOP-1151
Commit: 19d2eee152a9cec02f09c32e5d4dee5f30f16f3f
Parents: 31f79ea 4571061
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 8 07:57:36 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 8 07:57:36 2016 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/development-environment.asciidoc |  2 +-
 docs/src/dev/developer/for-committers.asciidoc          |  4 ++--
 docs/src/dev/developer/release.asciidoc                 |  8 ++++----
 docs/src/tutorials/getting-started/index.asciidoc       | 12 ++++++------
 gremlin-console/bin/gremlin.sh                          |  4 ++--
 gremlin-driver/pom.xml                                  |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19d2eee1/docs/src/dev/developer/development-environment.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/dev/developer/development-environment.asciidoc
index 23df9ee,2369133..da6dc16
--- a/docs/src/dev/developer/development-environment.asciidoc
+++ b/docs/src/dev/developer/development-environment.asciidoc
@@@ -41,7 -41,7 +41,7 @@@ mvn -Dmaven.javadoc.skip=true --project
  ** Build AsciiDocs (but don't evaluate code blocks): `bin/process-docs.sh --dryRun`
  ** Build AsciiDocs (but don't evaluate code blocks in specific files): `bin/process-docs.sh --dryRun docs/src/reference/the-graph.asciidoc,docs/src/tutorial/getting-started,...`
  ** Build AsciiDocs (but evaluate code blocks only in specific files): `bin/process-docs.sh --fullRun docs/src/reference/the-graph.asciidoc,docs/src/tutorial/getting-started,...`
- ** Process a single AsciiDoc file: +pass:[docs/preprocessor/preprocess-file.sh `pwd`/gremlin-console/target/apache-gremlin-console-*-standalone "" "*" `pwd`/docs/src/xyz.asciidoc]+
 -** Process a single AsciiDoc file: +pass:[docs/preprocessor/preprocess-file.sh `pwd`/gremlin-console/target/apache-tinkerpop-gremlin-console-*-standalone `pwd`/docs/src/xyz.asciidoc]+
++** Process a single AsciiDoc file: +pass:[docs/preprocessor/preprocess-file.sh `pwd`/gremlin-console/target/apache-tinkerpop-gremlin-console-*-standalone "" "*" `pwd`/docs/src/xyz.asciidoc]+
  * Build JavaDocs: `mvn process-resources -Djavadoc`
  * Check for Apache License headers: `mvn apache-rat:check`
  * Check for newer dependencies: `mvn versions:display-dependency-updates` or `mvn versions:display-plugin-updates`

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19d2eee1/docs/src/dev/developer/for-committers.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19d2eee1/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19d2eee1/gremlin-driver/pom.xml
----------------------------------------------------------------------


[7/7] tinkerpop git commit: Made a number of changes to logging dependencies.

Posted by sp...@apache.org.
Made a number of changes to logging dependencies.

Log4j is now generally a test dependency except for gremlin-server and gremlin-console where they need to be shipped as part of the binary distribution. In that case, they are optional scope for those who for some reason depend on those libs.


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

Branch: refs/heads/TINKERPOP-1151
Commit: d0606ec25c632f15fc0dec57408d14eaf709c7e6
Parents: 19d2eee
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Aug 4 12:26:43 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 8 07:59:01 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   | 40 +++++++++
 .../main/resources/archetype-resources/pom.xml  |  5 ++
 gremlin-console/pom.xml                         | 11 +++
 gremlin-core/pom.xml                            |  8 +-
 gremlin-driver/pom.xml                          |  6 ++
 gremlin-groovy/pom.xml                          |  7 ++
 gremlin-server/pom.xml                          | 11 +++
 .../gremlin/util/Log4jRecordingAppender.java    | 66 +++++++++++++++
 .../util/Log4jRecordingAppenderTest.java        | 86 ++++++++++++++++++++
 gremlin-test/pom.xml                            |  6 ++
 .../gremlin/util/Log4jRecordingAppender.java    | 66 ---------------
 .../util/Log4jRecordingAppenderTest.java        | 80 ------------------
 pom.xml                                         |  5 ++
 14 files changed, 251 insertions(+), 147 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index c5850ba..8f5d7dc 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.2 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Changed scope of log4j dependencies so that they would only be used in tests and the binary distributions of Gremlin Console and Server.
 * Added new recipe for "Traversal Induced Values".
 * Fixed a potential leak of a `ReferenceCounted` resource in Gremlin Server.
 * Added class registrations for `Map.Entry` implementations to `GryoMapper`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index f85012c..60092dc 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -22,6 +22,46 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 *Nine Inch Gremlins*
 
+TinkerPop 3.2.2
+---------------
+
+*Release Date: NOT OFFICIALLY RELEASED YET*
+
+Please see the link:https://github.com/apache/tinkerpop/blob/3.2.2/CHANGELOG.asciidoc#release-3-2-2[changelog] for a complete list of all the modifications that are part of this release.
+
+Upgrading for Users
+~~~~~~~~~~~~~~~~~~~
+
+Log4j Dependencies
+^^^^^^^^^^^^^^^^^^
+
+There were a number of changes to the Log4j dependencies in the various modules. Log4j was formerly included as part
+of the `slf4j-log4j12` in `gremlin-core`, however that "forced" use of Log4j as a logger implementation when that
+really wasn't necessary or desired. If a project depended on `gremlin-core` or other TinkerPop project to get its
+Log4j implementation then those applications will need to now include the dependency themselves directly.
+
+Note that Gremlin Server and Gremlin Console explicitly package Log4j in their respective binary distributions.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1151[TINKERPOP-1151]
+
+Upgrading for Providers
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Graph System Providers
+^^^^^^^^^^^^^^^^^^^^^^
+
+Log4j Dependencies
+++++++++++++++++++
+
+There were a number of changes to the Log4j dependencies in the various modules. Log4j was formerly included as part
+of the `slf4j-log4j12` in `gremlin-core`, however that "forced" use of log4j as a logger implementation when that
+really wasn't necessary or desired. The `slf4j-log4j12` dependency is now in "test" scope for most of the modules. The
+exception to that rule is `gremlin-test` which prescribes it as "optional". That change means that developers
+dependending on `gremlin-test` (or `gremlin-groovy-test`) will need to explicitly specify it as a dependency in their
+`pom.xml` (or a different slf4j implementation if that better suits them).
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1151[TINKERPOP-1151]
+
 TinkerPop 3.2.1
 ---------------
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
index 271f9dd..0727319 100644
--- a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
@@ -35,6 +35,11 @@ limitations under the License.
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.12</version>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index cbbab3e..b1c5b56 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -61,6 +61,17 @@ limitations under the License.
             <artifactId>gprof</artifactId>
             <version>0.3.1-groovy-2.4</version>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>optional</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <scope>optional</scope>
+        </dependency>
         <!-- TESTING -->
         <dependency>
             <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index 5f246f2..4accd63 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -64,7 +64,7 @@ limitations under the License.
         <!-- LOGGING -->
         <dependency>
             <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
+            <artifactId>slf4j-api</artifactId>
             <version>${slf4j.version}</version>
         </dependency>
         <dependency>
@@ -80,6 +80,12 @@ limitations under the License.
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-all</artifactId>
             <version>1.9.5</version>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index 2d5aa93..beeddf7 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -69,6 +69,12 @@ limitations under the License.
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>tinkergraph-gremlin</artifactId>
             <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index 3e37e17..8a12f10 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -70,6 +70,13 @@ limitations under the License.
             <artifactId>jBCrypt</artifactId>
             <version>jbcrypt-0.4</version>
         </dependency>
+        <!-- TEST -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>gremlin-test</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 2e7fc35..9a9c077 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -45,6 +45,17 @@ limitations under the License.
             <groupId>commons-collections</groupId>
             <artifactId>commons-collections</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>optional</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <scope>optional</scope>
+        </dependency>
         <!-- METRICS -->
         <dependency>
             <groupId>com.codahale.metrics</groupId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
new file mode 100644
index 0000000..e44f72f
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.util;
+
+import org.apache.log4j.AppenderSkeleton;
+import org.apache.log4j.PatternLayout;
+import org.apache.log4j.spi.LoggingEvent;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Provides a way to gather logging events for purpose of testing log output.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class Log4jRecordingAppender extends AppenderSkeleton {
+    private final List<String> messages = new ArrayList<>();
+
+    public Log4jRecordingAppender() {
+        super();
+        setLayout(new PatternLayout("%p - %m%n"));
+    }
+
+    @Override
+    protected void append(final LoggingEvent event) {
+        messages.add(layout.format(event));
+    }
+
+    @Override
+    public void close() {
+    }
+
+    @Override
+    public boolean requiresLayout() {
+        return true;
+    }
+
+    public List<String> getMessages() {
+        return messages;
+    }
+
+    public void clear() {
+        messages.clear();
+    }
+
+    public boolean logContainsAny(final String fragment) {
+        return messages.stream().anyMatch(m -> m.contains(fragment));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
new file mode 100644
index 0000000..dd1ea63
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.util;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class Log4jRecordingAppenderTest {
+    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(Log4jRecordingAppenderTest.class);
+    private Log4jRecordingAppender recordingAppender = null;
+    private static final String lineSeparator = System.getProperty("line.separator");
+
+    private Level originalConfiguredLevel = null;
+
+    @Before
+    public void setupForEachTest() {
+        recordingAppender = new Log4jRecordingAppender();
+        final Logger rootLogger = Logger.getRootLogger();
+        if (null == originalConfiguredLevel) originalConfiguredLevel = rootLogger.getLevel();
+        rootLogger.addAppender(recordingAppender);
+        rootLogger.setLevel(Level.ALL);
+
+        logger.error("ERROR");
+        logger.warn("WARN");
+        logger.info("INFO");
+    }
+
+    @After
+    public void teardownForEachTest() {
+        final Logger rootLogger = Logger.getRootLogger();
+        rootLogger.removeAppender(recordingAppender);
+        rootLogger.setLevel(originalConfiguredLevel);
+    }
+
+    @Test
+    public void shouldRecordMessages() {
+        assertEquals(3, recordingAppender.getMessages().size());
+        assertEquals("ERROR - ERROR" + lineSeparator, recordingAppender.getMessages().get(0));
+        assertEquals("WARN - WARN"  + lineSeparator, recordingAppender.getMessages().get(1));
+        assertEquals("INFO - INFO" + lineSeparator, recordingAppender.getMessages().get(2));
+    }
+
+    @Test
+    public void shouldMatchAnyMessages() {
+        assertTrue(recordingAppender.logContainsAny("ERROR"));
+    }
+
+    @Test
+    public void shouldMatchNoMessages() {
+        assertFalse(recordingAppender.logContainsAny("this is not here"));
+    }
+
+    @Test
+    public void shouldClearMessages() {
+        assertEquals(3, recordingAppender.getMessages().size());
+        recordingAppender.clear();
+        assertEquals(0, recordingAppender.getMessages().size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index 09f3a3f..28df2e8 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -74,6 +74,12 @@ limitations under the License.
             <artifactId>hamcrest-all</artifactId>
             <version>1.3</version>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>optional</scope>
+        </dependency>
     </dependencies>
     <build>
         <directory>${basedir}/target</directory>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
deleted file mode 100644
index e44f72f..0000000
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.util;
-
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.spi.LoggingEvent;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Provides a way to gather logging events for purpose of testing log output.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class Log4jRecordingAppender extends AppenderSkeleton {
-    private final List<String> messages = new ArrayList<>();
-
-    public Log4jRecordingAppender() {
-        super();
-        setLayout(new PatternLayout("%p - %m%n"));
-    }
-
-    @Override
-    protected void append(final LoggingEvent event) {
-        messages.add(layout.format(event));
-    }
-
-    @Override
-    public void close() {
-    }
-
-    @Override
-    public boolean requiresLayout() {
-        return true;
-    }
-
-    public List<String> getMessages() {
-        return messages;
-    }
-
-    public void clear() {
-        messages.clear();
-    }
-
-    public boolean logContainsAny(final String fragment) {
-        return messages.stream().anyMatch(m -> m.contains(fragment));
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
deleted file mode 100644
index 92eb38b..0000000
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.util;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.slf4j.LoggerFactory;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class Log4jRecordingAppenderTest {
-    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(Log4jRecordingAppenderTest.class);
-    private Log4jRecordingAppender recordingAppender = null;
-    private static final String lineSeparator = System.getProperty("line.separator");
-
-    @Before
-    public void setupForEachTest() {
-        recordingAppender = new Log4jRecordingAppender();
-        final Logger rootLogger = Logger.getRootLogger();
-        rootLogger.addAppender(recordingAppender);
-
-        logger.error("ERROR");
-        logger.warn("WARN");
-        logger.info("INFO");
-    }
-
-    @After
-    public void teardownForEachTest() {
-        final Logger rootLogger = Logger.getRootLogger();
-        rootLogger.removeAppender(recordingAppender);
-    }
-
-    @Test
-    public void shouldRecordMessages() {
-        assertEquals(3, recordingAppender.getMessages().size());
-        assertEquals("ERROR - ERROR" + lineSeparator, recordingAppender.getMessages().get(0));
-        assertEquals("WARN - WARN"  + lineSeparator, recordingAppender.getMessages().get(1));
-        assertEquals("INFO - INFO" + lineSeparator, recordingAppender.getMessages().get(2));
-    }
-
-    @Test
-    public void shouldMatchAnyMessages() {
-        assertTrue(recordingAppender.logContainsAny("ERROR"));
-    }
-
-    @Test
-    public void shouldMatchNoMessages() {
-        assertFalse(recordingAppender.logContainsAny("this is not here"));
-    }
-
-    @Test
-    public void shouldClearMessages() {
-        assertEquals(3, recordingAppender.getMessages().size());
-        recordingAppender.clear();
-        assertEquals(0, recordingAppender.getMessages().size());
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d0606ec2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 749c8f0..90ed55f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -591,6 +591,11 @@ limitations under the License.
                     </exclusion>
                 </exclusions>
             </dependency>
+            <dependency>
+                <groupId>log4j</groupId>
+                <artifactId>log4j</artifactId>
+                <version>1.2.17</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 


[2/7] tinkerpop git commit: Finished renaming distribution from 'apache-' to 'apache-tinkerpop-'

Posted by sp...@apache.org.
Finished renaming distribution from 'apache-' to 'apache-tinkerpop-'

Fixed gremlin.sh and assembly descriptor, updated documentation


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

Branch: refs/heads/TINKERPOP-1151
Commit: 6732921299af12894d130faece2269a59dbeb180
Parents: 87960e7
Author: Joshua Shinavier <jo...@cisco.com>
Authored: Fri Aug 5 16:17:57 2016 -0700
Committer: Joshua Shinavier <jo...@cisco.com>
Committed: Fri Aug 5 16:17:57 2016 -0700

----------------------------------------------------------------------
 docs/src/dev/developer/development-environment.asciidoc |  2 +-
 docs/src/dev/developer/for-committers.asciidoc          |  4 ++--
 docs/src/dev/developer/release.asciidoc                 |  8 ++++----
 docs/src/tutorials/getting-started/index.asciidoc       | 12 ++++++------
 gremlin-console/bin/gremlin.sh                          |  4 ++--
 gremlin-driver/pom.xml                                  |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67329212/docs/src/dev/developer/development-environment.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/development-environment.asciidoc b/docs/src/dev/developer/development-environment.asciidoc
index 3bb6613..2369133 100644
--- a/docs/src/dev/developer/development-environment.asciidoc
+++ b/docs/src/dev/developer/development-environment.asciidoc
@@ -41,7 +41,7 @@ mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
 ** Build AsciiDocs (but don't evaluate code blocks): `bin/process-docs.sh --dryRun`
 ** Build AsciiDocs (but don't evaluate code blocks in specific files): `bin/process-docs.sh --dryRun docs/src/reference/the-graph.asciidoc,docs/src/tutorial/getting-started,...`
 ** Build AsciiDocs (but evaluate code blocks only in specific files): `bin/process-docs.sh --fullRun docs/src/reference/the-graph.asciidoc,docs/src/tutorial/getting-started,...`
-** Process a single AsciiDoc file: +pass:[docs/preprocessor/preprocess-file.sh `pwd`/gremlin-console/target/apache-gremlin-console-*-standalone `pwd`/docs/src/xyz.asciidoc]+
+** Process a single AsciiDoc file: +pass:[docs/preprocessor/preprocess-file.sh `pwd`/gremlin-console/target/apache-tinkerpop-gremlin-console-*-standalone `pwd`/docs/src/xyz.asciidoc]+
 * Build JavaDocs: `mvn process-resources -Djavadoc`
 * Check for Apache License headers: `mvn apache-rat:check`
 * Check for newer dependencies: `mvn versions:display-dependency-updates` or `mvn versions:display-plugin-updates`

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67329212/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 5f0713d..64e43ce 100644
--- a/docs/src/dev/developer/for-committers.asciidoc
+++ b/docs/src/dev/developer/for-committers.asciidoc
@@ -310,8 +310,8 @@ The binary LICENSE/NOTICE is perhaps most impacted by changes to the various `po
 `pom.xml` file of any module, build both Gremlin Console and Gremlin Server and examine the contents of both binary
 distributions, either:
 
-* target/apache-gremlin-console-x.y.z-distribution.zip
-* target/apache-gremlin-server-x.y.z-distribution.zip
+* target/apache-tinkerpop-gremlin-console-x.y.z-distribution.zip
+* target/apache-tinkerpop-gremlin-server-x.y.z-distribution.zip
 
 Apache licensed software does not need to be included in LICENSE, but if the new dependency is an Apache-approved
 license (e.g. BSD, MIT) then it should be added in the pattern already defined. A copy of the LICENSE should be

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67329212/docs/src/dev/developer/release.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/release.asciidoc b/docs/src/dev/developer/release.asciidoc
index 0c21bb6..70390cf 100644
--- a/docs/src/dev/developer/release.asciidoc
+++ b/docs/src/dev/developer/release.asciidoc
@@ -174,8 +174,8 @@ The source distribution is provided by:
 	apache-tinkerpop-xx.yy.zz-src.zip
 
 Two binary distributions are provided for user convenience:
-	apache-gremlin-console-xx.yy.zz-bin.zip
-	apache-gremlin-server-xx.yy.zz-bin.zip
+	apache-tinkerpop-gremlin-console-xx.yy.zz-bin.zip
+	apache-tinkerpop-gremlin-server-xx.yy.zz-bin.zip
 
 The GPG key used to sign the release artifacts is available at:
     https://dist.apache.org/repos/dist/dev/tinkerpop/KEYS
@@ -236,8 +236,8 @@ there is breaking change, an important game-changing feature or two, etc.]
 
 The release artifacts can be found at this location:
 
-https://www.apache.org/dyn/closer.lua/tinkerpop/xx.yy.zz/apache-gremlin-console-xx.yy.zz-bin.zip
-https://www.apache.org/dyn/closer.lua/tinkerpop/xx.yy.zz/apache-gremlin-server-xx.yy.zz-bin.zip
+https://www.apache.org/dyn/closer.lua/tinkerpop/xx.yy.zz/apache-tinkerpop-gremlin-console-xx.yy.zz-bin.zip
+https://www.apache.org/dyn/closer.lua/tinkerpop/xx.yy.zz/apache-tinkerpop-gremlin-server-xx.yy.zz-bin.zip
 
 The online docs can be found here:
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67329212/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/tutorials/getting-started/index.asciidoc b/docs/src/tutorials/getting-started/index.asciidoc
index 0893188..b6fcbfa 100644
--- a/docs/src/tutorials/getting-started/index.asciidoc
+++ b/docs/src/tutorials/getting-started/index.asciidoc
@@ -51,13 +51,13 @@ NOTE: Are you unsure of what a vertex or edge is? That topic is covered in the <
 but please allow the tutorial to get you oriented with the Gremlin Console first, so that you have an understanding of
 the tool that will help you with your learning experience.
 
-link:https://www.apache.org/dyn/closer.lua/tinkerpop/x.y.z/apache-gremlin-console-x.y.z-bin.zip[Download the console],
+link:https://www.apache.org/dyn/closer.lua/tinkerpop/x.y.z/apache-tinkerpop-gremlin-console-x.y.z-bin.zip[Download the console],
 unpackage it and start it:
 
 [source,text]
 ----
-$ unzip apache-gremlin-console-x.y.z-bin.zip
-$ cd apache-gremlin-console-x.y.z-bin.zip
+$ unzip apache-tinkerpop-gremlin-console-x.y.z-bin.zip
+$ cd apache-tinkerpop-gremlin-console-x.y.z-bin.zip
 $ bin/gremlin.sh
 
          \,,,/
@@ -532,9 +532,9 @@ containing a Gremlin script to be processed with results returned.
 
 [source,text]
 ----
-$ curl -L -O https://www.apache.org/dist/tinkerpop/x.y.z/apache-gremlin-server-x.y.z-bin.zip
-$ unzip apache-gremlin-server-x.y.z-bin.zip
-$ cd apache-gremlin-server-x.y.z-bin.zip
+$ curl -L -O https://www.apache.org/dist/tinkerpop/x.y.z/apache-tinkerpop-gremlin-server-x.y.z-bin.zip
+$ unzip apache-tinkerpop-gremlin-server-x.y.z-bin.zip
+$ cd apache-tinkerpop-gremlin-server-x.y.z-bin.zip
 $ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
 [INFO] GremlinServer -
          \,,,/

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67329212/gremlin-console/bin/gremlin.sh
----------------------------------------------------------------------
diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh
index 5fb65ac..d0d3240 100755
--- a/gremlin-console/bin/gremlin.sh
+++ b/gremlin-console/bin/gremlin.sh
@@ -20,5 +20,5 @@
 #
 
 OPTS=$@
-set JAVA_OPTIONS="-Dtinkerpop.ext=/../target/apache-gremlin-*-standalone/ext -Dlog4j.configuration=conf/log4j-console.properties -Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL"
-`dirname $0`/../target/apache-gremlin-*-standalone/bin/gremlin.sh $OPTS
+set JAVA_OPTIONS="-Dtinkerpop.ext=/../target/apache-tinkerpop-gremlin-*-standalone/ext -Dlog4j.configuration=conf/log4j-console.properties -Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL"
+`dirname $0`/../target/apache-tinkerpop-gremlin-*-standalone/bin/gremlin.sh $OPTS

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67329212/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index 184a73a..22864e0 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -116,7 +116,7 @@ limitations under the License.
                     <descriptors>
                         <descriptor>src/assembly/standalone.xml</descriptor>
                     </descriptors>
-                    <finalName>apache-${project.artifactId}-${project.version}</finalName>
+                    <finalName>apache-tinkerpop-${project.artifactId}-${project.version}</finalName>
                     <outputDirectory>target</outputDirectory>
                     <workDirectory>target/assembly/work</workDirectory>
                     <tarLongFileMode>warn</tarLongFileMode>


[3/7] tinkerpop git commit: TINKERPOP-1350 was never quite fixed in 3.1.3.

Posted by sp...@apache.org.
TINKERPOP-1350 was never quite fixed in 3.1.3.

Changed response encoding to not use the session executor when the session has an error condition it is trying to serialize. This should be fine as there is no need to serialized an error condition as part of a transaction and thus no need to have the session thread to do it. That in turn frees up the worker executor to serialize and cancel long run jobs in the session. Removed recommendations for submitting parallel requests on a session from docs.


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

Branch: refs/heads/TINKERPOP-1151
Commit: 58d8bade7425c7a7865382990eaaed2b7d90659c
Parents: 87960e7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 2 15:59:19 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 8 06:49:17 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../src/reference/gremlin-applications.asciidoc |  6 +-
 .../upgrade/release-3.1.x-incubating.asciidoc   | 22 +++++-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  2 -
 .../handler/GremlinResponseFrameEncoder.java    | 13 +++-
 .../server/GremlinDriverIntegrateTest.java      | 81 +++++++++++---------
 6 files changed, 75 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58d8bade/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 306185c..975f6cf 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ TinkerPop 3.1.4 (NOT OFFICIALLY RELEASED YET)
 
 * Fixed a potential leak of a `ReferenceCounted` resource in Gremlin Server.
 * Renamed distributions to make the prefix "apache-tinkerpop-" as opposed to just "apache-".
+* Fixed a problem (previously thought resolved on 3.1.3) causing Gremlin Server to lock up when parallel requests were submitted on the same session if those parallel requests included a script that blocked indefinitely.
 
 [[release-3-1-3]]
 TinkerPop 3.1.3 (Release Date: July 18, 2016)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58d8bade/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 9f5121f..cedd98f 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1261,7 +1261,7 @@ Tuning
 image:gremlin-handdrawn.png[width=120,float=right] Tuning Gremlin Server for a particular environment may require some simple trial-and-error, but the following represent some basic guidelines that might be useful:
 
 * Gremlin Server defaults to a very modest maximum heap size.  Consider increasing this value for non-trivial uses.  Maximum heap size (`-Xmx`) is defined with the `JAVA_OPTIONS` setting in `gremlin-server.sh`.
-* When configuring the size of `threadPoolWorker` start with the default of `1` and increment by one as needed to a maximum of `2*number of cores`. Note that if using sessions that will accept parallel requests on the same session, then this value should be no less than `2`.
+* When configuring the size of `threadPoolWorker` start with the default of `1` and increment by one as needed to a maximum of `2*number of cores`.
 * The "right" size of the `gremlinPool` setting is somewhat dependent on the type of scripts that will be processed
 by Gremlin Server.  As requests arrive to Gremlin Server they are decoded and queued to be processed by threads in
 this pool.  When this pool is exhausted of threads, Gremlin Server will continue to accept incoming requests, but
@@ -1407,10 +1407,6 @@ request.
 A session is a "heavier" approach to the simple "request/response" approach of sessionless requests, but is sometimes
 necessary for a given use case.
 
-IMPORTANT: If submitting requests in parallel to a single session in Gremlin Server, then the `threadPoolWorker`
-setting can be no less than `2` or else the session may be prone to becoming locked if scripts sent on that session
-tend to block for extended periods of time.
-
 [[considering-transactions]]
 Considering Transactions
 ^^^^^^^^^^^^^^^^^^^^^^^^

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58d8bade/docs/src/upgrade/release-3.1.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.1.x-incubating.asciidoc b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
index 11cdb32..b4a1657 100644
--- a/docs/src/upgrade/release-3.1.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
@@ -22,6 +22,26 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 *A 187 On The Undercover Gremlinz*
 
+TinkerPop 3.1.4
+---------------
+
+*Release Date: NOT OFFICIALLY RELEASED YET*
+
+Please see the link:https://github.com/apache/tinkerpop/blob/3.1.4/CHANGELOG.asciidoc#tinkerpop-314-release-date-XXXXXXX-XX-2016[changelog] for a complete list of all the modifications that are part of this release.
+
+Upgrading for Users
+~~~~~~~~~~~~~~~~~~~
+
+Gremlin Server Workers
+^^^^^^^^^^^^^^^^^^^^^^
+
+In release 3.1.3, a link:http://tinkerpop.apache.org/docs/3.1.3/upgrade/#_tinkerpop_3_1_3[recommendation] was made to
+ensure that the `threadPoolWorker` setting for Gremlin Server was no less than `2` in cases where Gremlin Server was
+being used with sessions that accept parallel requests. In 3.1.4, that is no longer the case and a size of `1` remains
+acceptable even in that specific case.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1350[TINKERPOP-1350]
+
 TinkerPop 3.1.3
 ---------------
 
@@ -74,8 +94,6 @@ those that block for an extended period of time) may cause Gremlin Server to loc
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1350[TINKERPOP-1350]
 
-
-
 Upgrading for Providers
 ~~~~~~~~~~~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58d8bade/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
index d70ff3d..da12e1e 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
@@ -232,8 +232,6 @@ public class GremlinExecutor implements AutoCloseable {
         return eval(script, language, boundVars, lifeCycle);
     }
 
-    private static final AtomicInteger ugh = new AtomicInteger(0);
-
     /**
      * Evaluate a script and allow for the submission of alteration to the entire evaluation execution lifecycle.
      *

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58d8bade/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/GremlinResponseFrameEncoder.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/GremlinResponseFrameEncoder.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/GremlinResponseFrameEncoder.java
index 50c177b..d0f9d76 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/GremlinResponseFrameEncoder.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/GremlinResponseFrameEncoder.java
@@ -61,8 +61,12 @@ public class GremlinResponseFrameEncoder extends MessageToMessageEncoder<Respons
             if (useBinary) {
                 final Frame serialized;
 
-                // if the request came in on a session then the serialization must occur in that same thread.
-                if (null == session)
+                // if the request came in on a session then the serialization must occur in that same thread, except
+                // in the case of an error where we can free the session executor from having to do that job. the
+                // problem here is that if the session executor is used in the case of an error and the executor is
+                // blocked by parallel requests then there is no thread available to serialize the result and send
+                // back the response as the workers get all tied up behind the session executor.
+                if (null == session || !o.getStatus().getCode().isSuccess())
                     serialized = new Frame(serializer.serializeResponseAsBinary(o, ctx.alloc()));
                 else
                     serialized = new Frame(session.getExecutor().submit(() -> serializer.serializeResponseAsBinary(o, ctx.alloc())).get());
@@ -75,8 +79,9 @@ public class GremlinResponseFrameEncoder extends MessageToMessageEncoder<Respons
 
                 final Frame serialized;
 
-                // if the request came in on a session then the serialization must occur in that same thread.
-                if (null == session)
+                // if the request came in on a session then the serialization must occur that same thread except
+                // in the case of errors for reasons described above.
+                if (null == session || !o.getStatus().getCode().isSuccess())
                     serialized = new Frame(textSerializer.serializeResponseAsString(o));
                 else
                     serialized = new Frame(session.getExecutor().submit(() -> textSerializer.serializeResponseAsString(o)).get());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58d8bade/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 7f74e03..7314243 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -125,8 +125,8 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
                 settings.graphs.put("graph", "conf/neo4j-empty.properties");
                 break;
             case "shouldProcessSessionRequestsInOrderAfterTimeout":
-                settings.scriptEvaluationTimeout = 1000;
-                settings.threadPoolWorker = 2;
+                settings.scriptEvaluationTimeout = 250;
+                settings.threadPoolWorker = 1;
                 break;
         }
 
@@ -1210,48 +1210,55 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
         final Cluster cluster = Cluster.open();
         final Client client = cluster.connect(name.getMethodName());
 
-        final ResultSet first = client.submit(
-                "Object mon1 = 'mon1';\n" +
-                        "synchronized (mon1) {\n" +
-                        "    mon1.wait();\n" +
-                        "} ");
-
-        final ResultSet second = client.submit(
-                "Object mon2 = 'mon2';\n" +
-                        "synchronized (mon2) {\n" +
-                        "    mon2.wait();\n" +
-                        "}");
-
-        final CompletableFuture<List<Result>> futureFirst = first.all();
-        final CompletableFuture<List<Result>> futureSecond = second.all();
-
-        final AtomicBoolean hit = new AtomicBoolean(false);
-        while (!futureFirst.isDone()) {
-            // futureSecond can't finish before futureFirst - racy business here?
-            assertThat(futureSecond.isDone(), is(false));
-            hit.set(true);
+        for(int index = 0; index < 50; index++)
+        {
+            final CompletableFuture<ResultSet> first = client.submitAsync(
+                    "Object mon1 = 'mon1';\n" +
+                            "synchronized (mon1) {\n" +
+                            "    mon1.wait();\n" +
+                            "} ");
+
+            final CompletableFuture<ResultSet> second = client.submitAsync(
+                    "Object mon2 = 'mon2';\n" +
+                            "synchronized (mon2) {\n" +
+                            "    mon2.wait();\n" +
+                            "}");
+
+            final CompletableFuture<ResultSet> third = client.submitAsync(
+                    "Object mon3 = 'mon3';\n" +
+                            "synchronized (mon3) {\n" +
+                            "    mon3.wait();\n" +
+                            "}");
+
+            final CompletableFuture<ResultSet> fourth = client.submitAsync(
+                    "Object mon4 = 'mon4';\n" +
+                            "synchronized (mon4) {\n" +
+                            "    mon4.wait();\n" +
+                            "}");
+
+            final CompletableFuture<List<Result>> futureFirst = first.get().all();
+            final CompletableFuture<List<Result>> futureSecond = second.get().all();
+            final CompletableFuture<List<Result>> futureThird = third.get().all();
+            final CompletableFuture<List<Result>> futureFourth = fourth.get().all();
+
+            assertFutureTimeout(futureFirst);
+            assertFutureTimeout(futureSecond);
+            assertFutureTimeout(futureThird);
+            assertFutureTimeout(futureFourth);
         }
+    }
 
-        // should have entered the loop at least once and thus proven that futureSecond didn't return ahead of
-        // futureFirst
-        assertThat(hit.get(), is(true));
-
-        try {
+    private void assertFutureTimeout(final CompletableFuture<List<Result>> futureFirst) {
+        try
+        {
             futureFirst.get();
             fail("Should have timed out");
-        } catch (Exception ex) {
-            final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertThat(root, instanceOf(ResponseException.class));
-            assertThat(root.getMessage(), startsWith("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of 1000 ms for request"));
         }
-
-        try {
-            futureSecond.get();
-            fail("Should have timed out");
-        } catch (Exception ex) {
+        catch (Exception ex)
+        {
             final Throwable root = ExceptionUtils.getRootCause(ex);
             assertThat(root, instanceOf(ResponseException.class));
-            assertThat(root.getMessage(), startsWith("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of 1000 ms for request"));
+            assertThat(root.getMessage(), startsWith("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of 250 ms for request"));
         }
     }
 }