[jira] [Commented] (TINKERPOP-1652) Disable PathRetractionStrategy strategy if VertexProgramStep has LABELLED_PATH requirement

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15929103#comment-15929103
 ] 

ASF GitHub Bot commented on TINKERPOP-1652:
---

Github user dkuppitz commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106551449
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
 ---
@@ -72,7 +73,11 @@ public static PathRetractionStrategy instance() {
 public void apply(final Traversal.Admin traversal) {
 // do not apply this strategy if there are lambdas as you can't 
introspect to know what path information the lambdas are using
 // do not apply this strategy if a PATH requirement step is being 
used (in the future, we can do PATH requirement lookhead to be more intelligent 
about its usage)
-if (TraversalHelper.anyStepRecursively(step -> step instanceof 
LambdaHolder || step.getRequirements().contains(TraverserRequirement.PATH), 
TraversalHelper.getRootTraversal(traversal)))
+// do not apply this strategy if a VertexProgramStep is present 
with LABELLED_PATH requirements
--- End diff --

`LABELED_PATH`


> Disable PathRetractionStrategy strategy if VertexProgramStep has 
> LABELLED_PATH requirement
> --
>
> Key: TINKERPOP-1652
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1652
> Project: TinkerPop
>  Issue Type: Bug
>Reporter: Ted Wilmes
>Assignee: Ted Wilmes
>
> [~dkuppitz] notified me that there is an issue where 
> {{PathRetractionStrategy}} is incorrectly dropping path elements when a 
> {{VertexProgramStep}} is present that has a {{LABELLED_PATH}} requirement.  
> We already handle the case where path is required but this issue will also 
> disable the strategy if a vertex program is present that requires 
> {{LABELLED_PATH}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #572: TINKERPOP-1652 Disable PathRetractionStrategy s...

2017-03-16 Thread dkuppitz
Github user dkuppitz commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106552697
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +206,9 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+
{__.V().as("a").out().program(labeledPathVertexProgram).select("a"), "[]", 
null},
+
{__.V().as("a").out().program(pathVertexProgram).select("a"), "[]", null},
+
{__.V().as("a").out().program(emptyRequirementsVertexProgram).select("a"), 
"[[]]", null}
--- End diff --

I don't understand how the assertions work or rather what exactly is being 
tested here, but having `select('a')` as the last step, would keep the label 
anyways, so that the VP would have access to it, no matter what its 
requirements are, right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1652) Disable PathRetractionStrategy strategy if VertexProgramStep has LABELLED_PATH requirement

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928779#comment-15928779
 ] 

ASF GitHub Bot commented on TINKERPOP-1652:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106519004
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +200,58 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+{__.V().as("a").out().select("a").program(new 
MockVertexProgram(
+new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH, "[]", null}
 });
 }
-}
+
+// do nothing mock vertex program for traverser requirement testing
+private static class MockVertexProgram implements VertexProgram 
{
--- End diff --

thanks - unless the concrete mock ends up being generally useful to lots of 
tests or the mockito mock is insanely complicated to the point where no one 
will understand it, i tend to prefer mockito mocks.


> Disable PathRetractionStrategy strategy if VertexProgramStep has 
> LABELLED_PATH requirement
> --
>
> Key: TINKERPOP-1652
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1652
> Project: TinkerPop
>  Issue Type: Bug
>Reporter: Ted Wilmes
>Assignee: Ted Wilmes
>
> [~dkuppitz] notified me that there is an issue where 
> {{PathRetractionStrategy}} is incorrectly dropping path elements when a 
> {{VertexProgramStep}} is present that has a {{LABELLED_PATH}} requirement.  
> We already handle the case where path is required but this issue will also 
> disable the strategy if a vertex program is present that requires 
> {{LABELLED_PATH}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #572: TINKERPOP-1652 Disable PathRetractionStrategy s...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106519004
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +200,58 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+{__.V().as("a").out().select("a").program(new 
MockVertexProgram(
+new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH, "[]", null}
 });
 }
-}
+
+// do nothing mock vertex program for traverser requirement testing
+private static class MockVertexProgram implements VertexProgram 
{
--- End diff --

thanks - unless the concrete mock ends up being generally useful to lots of 
tests or the mockito mock is insanely complicated to the point where no one 
will understand it, i tend to prefer mockito mocks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1652) Disable PathRetractionStrategy strategy if VertexProgramStep has LABELLED_PATH requirement

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928773#comment-15928773
 ] 

ASF GitHub Bot commented on TINKERPOP-1652:
---

Github user twilmes commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106518558
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +200,58 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+{__.V().as("a").out().select("a").program(new 
MockVertexProgram(
+new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH, "[]", null}
 });
 }
-}
+
+// do nothing mock vertex program for traverser requirement testing
+private static class MockVertexProgram implements VertexProgram 
{
--- End diff --

Yes, I'll do that.  I saw some use of mockito but wasn't sure if it was the 
preferred method.  I'll make that update. 


> Disable PathRetractionStrategy strategy if VertexProgramStep has 
> LABELLED_PATH requirement
> --
>
> Key: TINKERPOP-1652
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1652
> Project: TinkerPop
>  Issue Type: Bug
>Reporter: Ted Wilmes
>Assignee: Ted Wilmes
>
> [~dkuppitz] notified me that there is an issue where 
> {{PathRetractionStrategy}} is incorrectly dropping path elements when a 
> {{VertexProgramStep}} is present that has a {{LABELLED_PATH}} requirement.  
> We already handle the case where path is required but this issue will also 
> disable the strategy if a vertex program is present that requires 
> {{LABELLED_PATH}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #572: TINKERPOP-1652 Disable PathRetractionStrategy s...

2017-03-16 Thread twilmes
Github user twilmes commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106518558
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +200,58 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+{__.V().as("a").out().select("a").program(new 
MockVertexProgram(
+new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH, "[]", null}
 });
 }
-}
+
+// do nothing mock vertex program for traverser requirement testing
+private static class MockVertexProgram implements VertexProgram 
{
--- End diff --

Yes, I'll do that.  I saw some use of mockito but wasn't sure if it was the 
preferred method.  I'll make that update. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


RE: Requirements for listing as a vendor

2017-03-16 Thread Paul A. Jackson
I agree that the last bullet is not met. We bundle the Tinkerpop stack, so the 
idea of version compatibility doesn't make sense. Instead, we offer a platform 
that builds an ecosystem around the graph (ETL, fuzzy matching, rich analysis 
client, etc). One feature is graph query. The users can supply their own 
Gremlin queries, or they can use our graphical query builder, which generates 
Gremlin.

Anywho, what do you think? I concur we do not fit in the provider bucket. But 
we have been around for 5 years. The offering is pretty mature at this point.

-Paul



-Original Message-
From: Robert Dale [mailto:robd...@gmail.com]
Sent: Thursday, March 16, 2017 1:50 PM
To: dev@tinkerpop.apache.org
Subject: Re: Requirements for listing as a vendor

You should start here:  http://tinkerpop.apache.org/policy.html

It's not obvious to me that the last 3 bullets are met.

Robert Dale

On Thu, Mar 16, 2017 at 12:56 PM, Paul A. Jackson 
wrote:

> Hi,
>
> What are the requirements for being lists as a Gremlin provider? We
> (Pitney Bowes) have an integrated product offering called Spectrum
> Data Hub (you'll also see it listed as part of the Spectrum MDM
> solution). The product is its own application server and we embed
> Gremlin on top of embedded Neo4j using our own "blueprints" adapter.
> So, access to the graph is from our own apps, rather that via a Gremlin 
> console or server.
>
> I don't know if this makes us a special case or not. Can you let us
> know if we qualify and/or if there's anything we would need to do so?
>
> Here's a link to the product literature:
> http://www.pitneybowes.com/us/
> customer-information-management/data-integration-
> management/spectrum-data-hub-module.html
>
> Thanks,
> -Paul
>
> 
>
>





[jira] [Commented] (TINKERPOP-1652) Disable PathRetractionStrategy strategy if VertexProgramStep has LABELLED_PATH requirement

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928740#comment-15928740
 ] 

ASF GitHub Bot commented on TINKERPOP-1652:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106516160
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +200,58 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+{__.V().as("a").out().select("a").program(new 
MockVertexProgram(
+new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH, "[]", null}
 });
 }
-}
+
+// do nothing mock vertex program for traverser requirement testing
+private static class MockVertexProgram implements VertexProgram 
{
--- End diff --

can't this be replaced with a mockito mock? 

```java
VertexProgram mock = mock(MockVertexProgram.class);
when(mock.getTraverserRequirements()).
  thenReturn(new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH
```


> Disable PathRetractionStrategy strategy if VertexProgramStep has 
> LABELLED_PATH requirement
> --
>
> Key: TINKERPOP-1652
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1652
> Project: TinkerPop
>  Issue Type: Bug
>Reporter: Ted Wilmes
>Assignee: Ted Wilmes
>
> [~dkuppitz] notified me that there is an issue where 
> {{PathRetractionStrategy}} is incorrectly dropping path elements when a 
> {{VertexProgramStep}} is present that has a {{LABELLED_PATH}} requirement.  
> We already handle the case where path is required but this issue will also 
> disable the strategy if a vertex program is present that requires 
> {{LABELLED_PATH}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #572: TINKERPOP-1652 Disable PathRetractionStrategy s...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/572#discussion_r106516160
  
--- Diff: 
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 ---
@@ -191,6 +200,58 @@ public void doTest() {
 {__.V().as("a").optional(bothE().dedup().as("b")).
 choose(select("b"), select("a","b"), 
project("a").by(select("a"))),
 "[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, 
b]]]", null},
+{__.V().as("a").out().select("a").program(new 
MockVertexProgram(
+new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH, "[]", null}
 });
 }
-}
+
+// do nothing mock vertex program for traverser requirement testing
+private static class MockVertexProgram implements VertexProgram 
{
--- End diff --

can't this be replaced with a mockito mock? 

```java
VertexProgram mock = mock(MockVertexProgram.class);
when(mock.getTraverserRequirements()).
  thenReturn(new 
HashSet<>(Arrays.asList(TraverserRequirement.LABELED_PATH
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #575: Dynamic graphs

2017-03-16 Thread dpitera
Github user dpitera closed the pull request at:

https://github.com/apache/tinkerpop/pull/575


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #575: Dynamic graphs

2017-03-16 Thread dpitera
GitHub user dpitera opened a pull request:

https://github.com/apache/tinkerpop/pull/575

Dynamic graphs



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dpitera/tinkerpop dynamic-graphs

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/575.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #575


commit fc97a39c7306b7ab0a5ecd501780b1948e06cacc
Author: Benjamin Anderson 
Date:   2016-08-20T05:33:16Z

Replace GraphManager with interface

This enabled settings-based customization of the GraphManager
implementation class, allowing implementors to customize the behavior of
the GraphManager.

commit de104b5625c1dc18687b11b505e3bc8b84e9f876
Author: dpitera 
Date:   2016-11-21T18:01:47Z

GraphManager support opening of specific graphs

This changeset allows an implementor to open a specific graph. One may
use this concept to implement a dynamic graph cache.

Furthermore, to ensure that rebindings work as intended, i.e. the list
of graphs returned to the HttpGremlinEndpointHandler, or "open graphs",
must include the to-be-rebound-graph. This changeset includes a change
to return these rebound graphs specifically.

Similar story as above for the WebSockets class, StandardOpProcessor.

Similar story for sessions, SessionOpProcessor.

Furthermore, the serializers at server boot only need to be aware of the
graphs defined in the settings object, so the relevant change here is in
AbstractChannelizer.

Furthermore:

To encourage a GraphManager implementation whose modification of the
Map object aligns more closely with accepted "Getter and
Setter" design patterns, we update the adding of graphs to the
GraphManager Map by calling the new `addGraph(String, Graph)` rather
than publicly editting it with a call to `getGraphs().put(String,
Graph)`.

Also added `addTraversalSource(String, TraversalSource) for same
reasons.

Also, updated BasicGraphManager according to the new specifications.

commit c447dc3b8ffaf3a550f7344e1537cbcdd0056231
Author: dpitera 
Date:   2017-03-15T19:31:45Z

Allow for custom graph instantiations/closings

This allows an implementor to supply a custom openGraph function to
return a newly instantiated graph object, and similarly do the same to
close a graph object, while doing so through the graphManager for
reference tracking.

commit 08ca7bf6a9d188b92e8bb0e5d6900e039d68fae0
Author: dpitera 
Date:   2017-03-15T19:34:09Z

Update docs acc. to GraphManager changes

commit b2685174db88bd48cbf1899cd0f3cd4ec796266c
Author: dpitera 
Date:   2017-03-16T15:32:47Z

Update code according to PR comments/suggestions




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Breaking change SimplerPathStep and CyclicPathStep

2017-03-16 Thread Marko Rodriguez
Hey,

Check it out.

gremlin> g.V().as('a').out().as('b’).   // COULD ALWAYS DO
   simplePath().
   path().by('name')
==>[marko,lop]
==>[marko,vadas]
==>[marko,josh]
==>[josh,ripple]
==>[josh,lop]
==>[peter,lop]

gremlin> g.V().as('a').out().as('b’).   // CAN NOW DO
   simplePath().by(label).
   path().by('name')
==>[marko,lop]
==>[josh,ripple]
==>[josh,lop]
==>[peter,lop]

So we added by()-modulation to simplePath() and cyclicPath(). Now, like 
path().by()-modulation, you can first project the path and then determine 
whether its a cyclic or simple projection.

Moreover, add that goodness with from().to()-modulation support for path(), 
simplePath(), and cyclicPath().

gremlin> g.V().as('a').out().as('b').out().as('c’).   // COULD ALWAYS DO
   path().by('name')
==>[marko,josh,ripple]
==>[marko,josh,lop]
gremlin> g.V().as('a').out().as('b').out().as('c’).
   path().by('name').from('a').to('b’)// CAN NOW DO
==>[marko,josh]
==>[marko,josh]

And drum roll please… <…Billy Jean is a really good song />

gremlin> g.V().as('a').out().as('b').out().as('c’).
simplePath().by(label).
path().by('name')
gremlin>
gremlin> g.V().as('a').out().as('b').out().as('c’).
   simplePath().from('b').to('c').by(label).
   path().by('name')
==>[marko,josh,ripple]
==>[marko,josh,lop]

Na na!

*** Kuppitz can show you how do the traversal current in TinkerPop 3.2.4 and 
below. Its righteous.

Now REO Speedwagon is on Pandora,
Marko.


Well I meant every word I said.
When I said that "I love you" I meant that I’d love you forever.
Cause I’m going to keep on loving you!
Cause its the only thing I want to do!
I don’t want to sleep, I just want to keep on lovin’ you!



http://markorodriguez.com



> On Mar 16, 2017, at 12:21 PM, Marko Rodriguez  wrote:
> 
> Hello,
> 
> Please see:
> 
>   https://github.com/apache/tinkerpop/pull/574 
> 
> 
> SimplePathStep and CyclicPathStep have been generalized to PathFilterStep and 
> now we have to(), from(), and by() modulation support for both simplePath() 
> and cyclicPath(). Minor breaking change that will more than 99% likely not 
> effect any providers and if it does, a simple name change would do the fix.
> 
> Heads up,
> Marko.
> 
> http://markorodriguez.com 
> 
> 
> 



[jira] [Commented] (TINKERPOP-1604) Let evaluate() handle : commands e.g. :remote connect

2017-03-16 Thread Robert Dale (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928685#comment-15928685
 ] 

Robert Dale commented on TINKERPOP-1604:


Maybe I don't understand.  In 3.2.4, you can recursively :load.

*Given scripts:*
{noformat}
[apache-tinkerpop-gremlin-console-3.2.4]$ more *.groovy
::
1.groovy
::
println "1 loading 2"
:load 2.groovy
println "loaded 2"
::
2.groovy
::
println "2 loading 3"
:load 3.groovy
println "3 loaded"
::
3.groovy
::
println "3"
{noformat}

*gremlin console*
{noformat}
[apache-tinkerpop-gremlin-console-3.2.4]$ ./bin/gremlin.sh 

 \,,,/
 (o o)
-oOOo-(3)-oOOo-
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> :load 1.groovy
1 loading 2
==>null
2 loading 3
==>null
3
==>null
3 loaded
==>null
loaded 2
==>null
gremlin> 
gremlin> 

{noformat}

If that's not what you mean, then why not just use the API instead of console 
commands?

{noformat}
graph = EmptyGraph.instance()
g = graph.traversal().withRemote('conf/remote-graph.properties')
{noformat}


> Let evaluate() handle : commands e.g. :remote connect
> -
>
> Key: TINKERPOP-1604
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1604
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: console
>Affects Versions: 3.2.3
>Reporter: Xian Yi Teng
>
> {code}
> ~/apache-tinkerpop-gremlin-console-3.2.3$ cat ../remote_connect.groovy 
> :remote connect tinkerpop.server 
> apache-tinkerpop-gremlin-console-3.2.3/conf/remote.yaml
> println 1+1
> ~/apache-tinkerpop-gremlin-console-3.2.3$ bin/gremlin.sh
>  \,,,/
>  (o o)
> -oOOo-(3)-oOOo-
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> evaluate(new File('../remote_connect.groovy'))
> /home/automaton/remote_connect.groovy: 1: unexpected token: : @ line 1, 
> column 1.
>:remote connect tinkerpop.server 
> apache-tinkerpop-gremlin-console-3.2.3/conf/remote.yaml
>^
> 1 error
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106496036
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

Doing it that way works as well. That was probably smart now that those 
steps apply to more than just `addEdge()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928590#comment-15928590
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106496036
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

Doing it that way works as well. That was probably smart now that those 
steps apply to more than just `addEdge()`.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Breaking change SimplerPathStep and CyclicPathStep

2017-03-16 Thread Marko Rodriguez
Hello,

Please see:

https://github.com/apache/tinkerpop/pull/574 


SimplePathStep and CyclicPathStep have been generalized to PathFilterStep and 
now we have to(), from(), and by() modulation support for both simplePath() and 
cyclicPath(). Minor breaking change that will more than 99% likely not effect 
any providers and if it does, a simple name change would do the fix.

Heads up,
Marko.

http://markorodriguez.com





[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928582#comment-15928582
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106495135
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

Done.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106495135
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928577#comment-15928577
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106494779
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

Added to and from step "stubs" to the-traversal.asciidoc and then reference 
it from `GraphTraversal` JavaDoc.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106494779
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

Added to and from step "stubs" to the-traversal.asciidoc and then reference 
it from `GraphTraversal` JavaDoc.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Requirements for listing as a vendor

2017-03-16 Thread Robert Dale
You should start here:  http://tinkerpop.apache.org/policy.html

It's not obvious to me that the last 3 bullets are met.

Robert Dale

On Thu, Mar 16, 2017 at 12:56 PM, Paul A. Jackson 
wrote:

> Hi,
>
> What are the requirements for being lists as a Gremlin provider? We
> (Pitney Bowes) have an integrated product offering called Spectrum Data Hub
> (you'll also see it listed as part of the Spectrum MDM solution). The
> product is its own application server and we embed Gremlin on top of
> embedded Neo4j using our own "blueprints" adapter. So, access to the graph
> is from our own apps, rather that via a Gremlin console or server.
>
> I don't know if this makes us a special case or not. Can you let us know
> if we qualify and/or if there's anything we would need to do so?
>
> Here's a link to the product literature: http://www.pitneybowes.com/us/
> customer-information-management/data-integration-
> management/spectrum-data-hub-module.html
>
> Thanks,
> -Paul
>
> 
>
>


[jira] [Commented] (TINKERPOP-1604) Let evaluate() handle : commands e.g. :remote connect

2017-03-16 Thread Xian Yi Teng (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928500#comment-15928500
 ] 

Xian Yi Teng commented on TINKERPOP-1604:
-

One problem with `:load` is that it can't itself be used in a script. 

> Let evaluate() handle : commands e.g. :remote connect
> -
>
> Key: TINKERPOP-1604
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1604
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: console
>Affects Versions: 3.2.3
>Reporter: Xian Yi Teng
>
> {code}
> ~/apache-tinkerpop-gremlin-console-3.2.3$ cat ../remote_connect.groovy 
> :remote connect tinkerpop.server 
> apache-tinkerpop-gremlin-console-3.2.3/conf/remote.yaml
> println 1+1
> ~/apache-tinkerpop-gremlin-console-3.2.3$ bin/gremlin.sh
>  \,,,/
>  (o o)
> -oOOo-(3)-oOOo-
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> evaluate(new File('../remote_connect.groovy'))
> /home/automaton/remote_connect.groovy: 1: unexpected token: : @ line 1, 
> column 1.
>:remote connect tinkerpop.server 
> apache-tinkerpop-gremlin-console-3.2.3/conf/remote.yaml
>^
> 1 error
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Comment Edited] (TINKERPOP-1604) Let evaluate() handle : commands e.g. :remote connect

2017-03-16 Thread Xian Yi Teng (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928500#comment-15928500
 ] 

Xian Yi Teng edited comment on TINKERPOP-1604 at 3/16/17 5:42 PM:
--

One problem with {{:load}} is that it can't itself be used in a script. 


was (Author: xytxytxyt):
One problem with `:load` is that it can't itself be used in a script. 

> Let evaluate() handle : commands e.g. :remote connect
> -
>
> Key: TINKERPOP-1604
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1604
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: console
>Affects Versions: 3.2.3
>Reporter: Xian Yi Teng
>
> {code}
> ~/apache-tinkerpop-gremlin-console-3.2.3$ cat ../remote_connect.groovy 
> :remote connect tinkerpop.server 
> apache-tinkerpop-gremlin-console-3.2.3/conf/remote.yaml
> println 1+1
> ~/apache-tinkerpop-gremlin-console-3.2.3$ bin/gremlin.sh
>  \,,,/
>  (o o)
> -oOOo-(3)-oOOo-
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> evaluate(new File('../remote_connect.groovy'))
> /home/automaton/remote_connect.groovy: 1: unexpected token: : @ line 1, 
> column 1.
>:remote connect tinkerpop.server 
> apache-tinkerpop-gremlin-console-3.2.3/conf/remote.yaml
>^
> 1 error
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928482#comment-15928482
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106483016
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

ok - agreed. then please send a DISCUSS post for lazy consensus to dev to 
call attention to the issue so that folks are aware that there is a small 
chance of breakage in 3.2.5 if you use those steps in their code for any 
reason.  We just did something similar with that `GraphManager` PR recently - 
it has a low low chance of breaking folks code as well.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928478#comment-15928478
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106481769
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

but you still use `from()` and `to()` with `addE()` right? we just now use 
it with path related stuff as well, so it relates to all of those things 
correct? I guess I'm saying that the javadoc should reference to the all the 
steps that `from()` and `to()` modulate.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106481769
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

but you still use `from()` and `to()` with `addE()` right? we just now use 
it with path related stuff as well, so it relates to all of those things 
correct? I guess I'm saying that the javadoc should reference to the all the 
steps that `from()` and `to()` modulate.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928474#comment-15928474
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106480814
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -992,8 +992,8 @@
  * Adds a {@link Vertex} with a default vertex label.
  *
  * @return the traversal with the {@link AddVertexStep} added
- * @since 3.1.0-incubating
  * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step;
 target="_blank">Reference Documentation - AddVertex Step
+ * @since 3.1.0-incubating
--- End diff --

a few weeks ago i added all the annotations and references, but it looks 
like your IDE didn't like my formatting so it just shuffled stuff around. 


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106480814
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -992,8 +992,8 @@
  * Adds a {@link Vertex} with a default vertex label.
  *
  * @return the traversal with the {@link AddVertexStep} added
- * @since 3.1.0-incubating
  * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step;
 target="_blank">Reference Documentation - AddVertex Step
+ * @since 3.1.0-incubating
--- End diff --

a few weeks ago i added all the annotations and references, but it looks 
like your IDE didn't like my formatting so it just shuffled stuff around. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928472#comment-15928472
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106480663
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106480663
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928441#comment-15928441
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106475154
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106475154
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928430#comment-15928430
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472723
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

This is why there are `UPGRADE` doc comments. It will only apply to vendors 
(and 99% chance not) and if it does, they simply need to change 
`CyclicPathStep` to `PathFilterStep` in their code.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Requirements for listing as a vendor

2017-03-16 Thread Paul A. Jackson
Hi,

What are the requirements for being lists as a Gremlin provider? We (Pitney 
Bowes) have an integrated product offering called Spectrum Data Hub (you'll 
also see it listed as part of the Spectrum MDM solution). The product is its 
own application server and we embed Gremlin on top of embedded Neo4j using our 
own "blueprints" adapter. So, access to the graph is from our own apps, rather 
that via a Gremlin console or server.

I don't know if this makes us a special case or not. Can you let us know if we 
qualify and/or if there's anything we would need to do so?

Here's a link to the product literature: 
http://www.pitneybowes.com/us/customer-information-management/data-integration-management/spectrum-data-hub-module.html

Thanks,
-Paul





[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472723
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

This is why there are `UPGRADE` doc comments. It will only apply to vendors 
(and 99% chance not) and if it does, they simply need to change 
`CyclicPathStep` to `PathFilterStep` in their code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928429#comment-15928429
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472426
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

There is nothing to `@see` as it doesn't reference `AddEdgeStep` anymore.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472426
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

There is nothing to `@see` as it doesn't reference `AddEdgeStep` anymore.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928426#comment-15928426
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472194
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
 ---
@@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final 
Object other) {
 isPresent();
 }
 
+/**
+ * Isolate a sub-path from the path object. The isolation is based 
solely on the path labels.
+ * The to-label is inclusive. Thus, from "b" to "c" would isolate the 
example path as follows {@code a,[b,c],d}.
+ *
+ * @param fromLabel The label to start recording the sub-path from.
+ * @param toLabel   The label to end recording the sub-path to.
+ * @return the isolated sub-path.
+ */
+public default Path subPath(final String fromLabel, final String 
toLabel) {
+if (null == fromLabel && null == toLabel)
+return this;
+else {
+Path subPath = MutablePath.make();
+int size = this.size();
--- End diff --

Done.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928424#comment-15928424
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472146
  
--- Diff: docs/src/upgrade/release-3.2.x-incubating.asciidoc ---
@@ -63,6 +63,13 @@ See: 
link:https://issues.apache.org/jira/browse/TINKERPOP-1599[TINKERPOP-1599]
 Upgrading for Providers
--- End diff --

Done.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928427#comment-15928427
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472288
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -992,8 +992,8 @@
  * Adds a {@link Vertex} with a default vertex label.
  *
  * @return the traversal with the {@link AddVertexStep} added
- * @since 3.1.0-incubating
  * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step;
 target="_blank">Reference Documentation - AddVertex Step
+ * @since 3.1.0-incubating
--- End diff --

I don't know who put all that there. ?


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472288
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -992,8 +992,8 @@
  * Adds a {@link Vertex} with a default vertex label.
  *
  * @return the traversal with the {@link AddVertexStep} added
- * @since 3.1.0-incubating
  * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step;
 target="_blank">Reference Documentation - AddVertex Step
+ * @since 3.1.0-incubating
--- End diff --

I don't know who put all that there. ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472146
  
--- Diff: docs/src/upgrade/release-3.2.x-incubating.asciidoc ---
@@ -63,6 +63,13 @@ See: 
link:https://issues.apache.org/jira/browse/TINKERPOP-1599[TINKERPOP-1599]
 Upgrading for Providers
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106472194
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
 ---
@@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final 
Object other) {
 isPresent();
 }
 
+/**
+ * Isolate a sub-path from the path object. The isolation is based 
solely on the path labels.
+ * The to-label is inclusive. Thus, from "b" to "c" would isolate the 
example path as follows {@code a,[b,c],d}.
+ *
+ * @param fromLabel The label to start recording the sub-path from.
+ * @param toLabel   The label to end recording the sub-path to.
+ * @return the isolated sub-path.
+ */
+public default Path subPath(final String fromLabel, final String 
toLabel) {
+if (null == fromLabel && null == toLabel)
+return this;
+else {
+Path subPath = MutablePath.make();
+int size = this.size();
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928417#comment-15928417
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106471272
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106471272
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928386#comment-15928386
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106467302
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread pluradj
Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106467302
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928385#comment-15928385
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106466930
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

As this is going to `tp32`, wouldn't it be better to mark this as 
deprecated in favor of `PathFilterStep`? It's final, so no one could have 
extended from it, but perhaps they used it in some other way? I guess I'd be in 
favor of doing the same for `SimplePathStep`.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106466930
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
 ---
@@ -1,46 +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.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep extends FilterStep {
--- End diff --

As this is going to `tp32`, wouldn't it be better to mark this as 
deprecated in favor of `PathFilterStep`? It's final, so no one could have 
extended from it, but perhaps they used it in some other way? I guess I'd be in 
favor of doing the same for `SimplePathStep`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106465531
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -1034,11 +1034,10 @@
  * @param toStepLabel the step label of the incoming vertex
  * @return the traversal with the modified {@link AddEdgeStep}
  * @since 3.1.0-incubating
- * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step;
 target="_blank">Reference Documentation - AddEdge Step
  */
 public default GraphTraversal to(final String toStepLabel) {
 this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-((AddEdgeStep) 
this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+((FromToModulating) 
this.asAdmin().getEndStep()).addTo(toStepLabel);
--- End diff --

Now that `from()` is more generic the javadoc needs to be updated to better 
reflect usage. Also, looks like you removed the `@see` annotation. I think that 
should be added back with additional ones linking to the appropriate steps that 
make use of this. I didn't look at the changes for `to()` in here but I assume 
this comment would apply to those as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928366#comment-15928366
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106464852
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -992,8 +992,8 @@
  * Adds a {@link Vertex} with a default vertex label.
  *
  * @return the traversal with the {@link AddVertexStep} added
- * @since 3.1.0-incubating
  * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step;
 target="_blank">Reference Documentation - AddVertex Step
+ * @since 3.1.0-incubating
--- End diff --

did your IDE do all this javadoc annotation switching? or was that 
intentional? not something to switch back or anything i guess, but it just made 
it hard to root out what's changed here of substance and what hasn't.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106464852
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
 ---
@@ -992,8 +992,8 @@
  * Adds a {@link Vertex} with a default vertex label.
  *
  * @return the traversal with the {@link AddVertexStep} added
- * @since 3.1.0-incubating
  * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step;
 target="_blank">Reference Documentation - AddVertex Step
+ * @since 3.1.0-incubating
--- End diff --

did your IDE do all this javadoc annotation switching? or was that 
intentional? not something to switch back or anything i guess, but it just made 
it hard to root out what's changed here of substance and what hasn't.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106464105
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928359#comment-15928359
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106464069
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
 ---
@@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final 
Object other) {
 isPresent();
 }
 
+/**
+ * Isolate a sub-path from the path object. The isolation is based 
solely on the path labels.
+ * The to-label is inclusive. Thus, from "b" to "c" would isolate the 
example path as follows {@code a,[b,c],d}.
+ *
+ * @param fromLabel The label to start recording the sub-path from.
+ * @param toLabel   The label to end recording the sub-path to.
+ * @return the isolated sub-path.
+ */
+public default Path subPath(final String fromLabel, final String 
toLabel) {
+if (null == fromLabel && null == toLabel)
+return this;
+else {
+Path subPath = MutablePath.make();
+int size = this.size();
--- End diff --

Missed a `final` on `size` - that variable doesn't appear to be re-assigned 
elsewhere.


> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928360#comment-15928360
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106464105
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106464069
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
 ---
@@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final 
Object other) {
 isPresent();
 }
 
+/**
+ * Isolate a sub-path from the path object. The isolation is based 
solely on the path labels.
+ * The to-label is inclusive. Thus, from "b" to "c" would isolate the 
example path as follows {@code a,[b,c],d}.
+ *
+ * @param fromLabel The label to start recording the sub-path from.
+ * @param toLabel   The label to end recording the sub-path to.
+ * @return the isolated sub-path.
+ */
+public default Path subPath(final String fromLabel, final String 
toLabel) {
+if (null == fromLabel && null == toLabel)
+return this;
+else {
+Path subPath = MutablePath.make();
+int size = this.size();
--- End diff --

Missed a `final` on `size` - that variable doesn't appear to be re-assigned 
elsewhere.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928342#comment-15928342
 ] 

ASF GitHub Bot commented on TINKERPOP-1387:
---

GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/574

TINKERPOP-1387: from and to modulators for path steps

https://issues.apache.org/jira/browse/TINKERPOP-1387

`path()`, `simplePath()`, and `cyclicPath()` now all support `to()`-, 
`from()`-, and `by()`-modulation. Support for `to()`/`from()` modulation is 
made possible by a new interface `FromToModulating` which `AddEdgeStep` now 
implements. To isolate sub-paths, `Path.subPath(String,String)` was added to 
`Path` interface with a default implementation. Added respective tests and 
documentation updates.

@dkuppitz -- can you give this bad boy a whirl. Also, if you come up with a 
some cool doc examples during your play, can you add them please?

VOTE +1.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1387

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/574.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #574


commit 9265ddf6d1e5bded0ef6b3a0229ea1ce405e5259
Author: Marko A. Rodriguez 
Date:   2017-03-16T14:40:39Z

added support for Path.getSubPath(). Added FromToModulating for from() and 
to()-based step modulations. Added support for path().from().to(). Added 
respective test cases. Going to add simplePath().from().to().by() and 
cyclicPath().from().to().by() to this ticket as well and then PR this mo fo ya 
know.

commit 0fe3b1d8f4b49db80a59e9d29d8082735edfcef4
Author: Marko A. Rodriguez 
Date:   2017-03-16T14:44:43Z

Cleaned up and added JavaDoc for now sub-path work.

commit 65b3ad06b15b75ae944c11bfbdc592994fa706b2
Author: Marko A. Rodriguez 
Date:   2017-03-16T15:14:40Z

removed CyclicPathStep and SimplePathStep for a more abstract, generalized 
step called PathFilterStep which handles cyclic/simple filtering as well as 
to() and from() modulation. Updated UPGRADE docs. Will add by()-modulation to 
PathFilterStep next.

commit 936344f33f62fd3b3d7adee6bf0bf8fb11b8e5e5
Author: Marko A. Rodriguez 
Date:   2017-03-16T15:26:45Z

added to()/from() test support for cyclicPath() and added to()/from() 
example to the-traversal.asciidoc.

commit 8ec49c433ae472116853df12247fa903e41f958d
Author: Marko A. Rodriguez 
Date:   2017-03-16T15:34:25Z

PathFilterStep now support by() modulation. Removed unneeded 
CyclicPathStepTest and SimplePathStepTest.

commit 35ecf8c0f56139953187769ee719c95b66cfa477
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:03:28Z

added test support for simplePath() and cyclicPath() by()/to()/from(). 
Really cool. Works great and makes sense. Updated this-traversal.asciidoc with 
examples.

commit 9155c464b78abfe0772d1c8e12ba4196d829e28b
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:05:17Z

updated CHANGELOG.

commit 718a29bb6ff5a2f5294cd3629b616fb615bc3e15
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:07:30Z

renamed Path.getSubPath() to Path.subPath() as its in the fluent style of 
operations on Path.

commit a9c2f65e0557dfd5f486b2ba683c571bb60f5fe6
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:07:50Z

renamed Path.getSubPath() to Path.subPath() as its in the fluent style of 
operations on Path.




> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread okram
GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/574

TINKERPOP-1387: from and to modulators for path steps

https://issues.apache.org/jira/browse/TINKERPOP-1387

`path()`, `simplePath()`, and `cyclicPath()` now all support `to()`-, 
`from()`-, and `by()`-modulation. Support for `to()`/`from()` modulation is 
made possible by a new interface `FromToModulating` which `AddEdgeStep` now 
implements. To isolate sub-paths, `Path.subPath(String,String)` was added to 
`Path` interface with a default implementation. Added respective tests and 
documentation updates.

@dkuppitz -- can you give this bad boy a whirl. Also, if you come up with a 
some cool doc examples during your play, can you add them please?

VOTE +1.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1387

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/574.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #574


commit 9265ddf6d1e5bded0ef6b3a0229ea1ce405e5259
Author: Marko A. Rodriguez 
Date:   2017-03-16T14:40:39Z

added support for Path.getSubPath(). Added FromToModulating for from() and 
to()-based step modulations. Added support for path().from().to(). Added 
respective test cases. Going to add simplePath().from().to().by() and 
cyclicPath().from().to().by() to this ticket as well and then PR this mo fo ya 
know.

commit 0fe3b1d8f4b49db80a59e9d29d8082735edfcef4
Author: Marko A. Rodriguez 
Date:   2017-03-16T14:44:43Z

Cleaned up and added JavaDoc for now sub-path work.

commit 65b3ad06b15b75ae944c11bfbdc592994fa706b2
Author: Marko A. Rodriguez 
Date:   2017-03-16T15:14:40Z

removed CyclicPathStep and SimplePathStep for a more abstract, generalized 
step called PathFilterStep which handles cyclic/simple filtering as well as 
to() and from() modulation. Updated UPGRADE docs. Will add by()-modulation to 
PathFilterStep next.

commit 936344f33f62fd3b3d7adee6bf0bf8fb11b8e5e5
Author: Marko A. Rodriguez 
Date:   2017-03-16T15:26:45Z

added to()/from() test support for cyclicPath() and added to()/from() 
example to the-traversal.asciidoc.

commit 8ec49c433ae472116853df12247fa903e41f958d
Author: Marko A. Rodriguez 
Date:   2017-03-16T15:34:25Z

PathFilterStep now support by() modulation. Removed unneeded 
CyclicPathStepTest and SimplePathStepTest.

commit 35ecf8c0f56139953187769ee719c95b66cfa477
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:03:28Z

added test support for simplePath() and cyclicPath() by()/to()/from(). 
Really cool. Works great and makes sense. Updated this-traversal.asciidoc with 
examples.

commit 9155c464b78abfe0772d1c8e12ba4196d829e28b
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:05:17Z

updated CHANGELOG.

commit 718a29bb6ff5a2f5294cd3629b616fb615bc3e15
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:07:30Z

renamed Path.getSubPath() to Path.subPath() as its in the fluent style of 
operations on Path.

commit a9c2f65e0557dfd5f486b2ba683c571bb60f5fe6
Author: Marko A. Rodriguez 
Date:   2017-03-16T16:07:50Z

renamed Path.getSubPath() to Path.subPath() as its in the fluent style of 
operations on Path.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #574: TINKERPOP-1387: from and to modulators for path...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/574#discussion_r106463235
  
--- Diff: docs/src/upgrade/release-3.2.x-incubating.asciidoc ---
@@ -63,6 +63,13 @@ See: 
link:https://issues.apache.org/jira/browse/TINKERPOP-1599[TINKERPOP-1599]
 Upgrading for Providers
--- End diff --

You added something here for providers which is good. I think it would be 
good to add something to the users section as well to bring attention to the 
new available syntax that is available to them with a links to the respective 
reference docs where the new examples are.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106462086
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928340#comment-15928340
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106460712
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106460712
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928331#comment-15928331
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106459384
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106459384
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928321#comment-15928321
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106454863
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928320#comment-15928320
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106456922
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread pluradj
Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106454863
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928319#comment-15928319
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on the issue:

https://github.com/apache/tinkerpop/pull/569
  
@spmallette Updated with your suggestions; only thing i have not addressed 
is `closeGraph()` versus `removeGraph()`.


> Consider GraphManager as an interface
> -
>
> Key: TINKERPOP-1438
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1438
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: server
>Affects Versions: 3.2.2
>Reporter: stephen mallette
>Priority: Minor
>  Labels: breaking
>
> If {{GraphManager}} were an interface it would make embedding Gremlin Server 
> easier as {{Graph}} instances could be more easily supplied by the host 
> application. In doing this, It also might be good to force a 
> {{TraversalSource}} to be referred to by both the {{Graph}} name and  
> {{TraversalSource}} name.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread pluradj
Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106456922
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,216 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public final Map getGraphs() {
+return graphs;
+}
+
+public final Graph getGraph(final String gName) {
+return graphs.get(gName);
+}
+
+public final void addGraph(final String gName, final Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public final Map getTraversalSources() {
+return traversalSources;
+}
+
+  

[jira] [Commented] (TINKERPOP-1303) add help for :remote config for Gephi Plugin

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928314#comment-15928314
 ] 

ASF GitHub Bot commented on TINKERPOP-1303:
---

GitHub user spmallette opened a pull request:

https://github.com/apache/tinkerpop/pull/573

TINKERPOP-1303 Adds help option to :remote config command

https://issues.apache.org/jira/browse/TINKERPOP-1303

Here's the output for "help" in the plugins that support `:remote` as an 
option in the console:

```text
gremlin> :remote connect tinkerpop.gephi
==>Connection to Gephi - http://localhost:8080/workspace1 with 
stepDelay:1000, startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, 
colorFadeRate:0.7, startSize:10.0,sizeDecrementRate:0.33
gremlin> :remote config help
==>:remote config [host |port |workspace |stepDelay 
|startRGBColor <0.0,0.0,0.0>|colorToFade [r|g|b]|colorFadeRate 
<0.0>|sizeDecrementRate <0.0>|startSize <0.0>|visualTraversal |help]
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote config help
==>:remote config [timeout [|none]|alias [reset|show| 
]|help]
gremlin> :remote connect tinkerpop.hadoop graph g

==>useTraversalSource=graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat],
 sparkgraphcomputer]
==>useSugar=false
gremlin> :remote config help
==>:remote config [useSugar [true|false]|useTraversalSource 
|help]
```

This was a pretty simple change, but since @pluradj added this ticket, I 
opted submit this to vote so that he could review before merge instead of just 
doing a CTR.

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1303

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/573.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #573


commit cf8b6b97eb6fcd5a4f1a11f92da89ef24f8bca81
Author: Stephen Mallette 
Date:   2017-03-16T15:51:23Z

TINKERPOP-1303 Adds help option to :remote config command




> add help for :remote config for Gephi Plugin
> 
>
> Key: TINKERPOP-1303
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1303
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: console
>Affects Versions: 3.2.1
>Reporter: Jason Plurad
>Priority: Minor
>
> This idea came from reviewing the 
> [patch|https://github.com/apache/incubator-tinkerpop/pull/308] for 
> TINKERPOP-1297. Currently {{:remote config}} with no arguments returns an 
> unfriendly message "Invalid config arguments - check syntax". It might be 
> more user-friendly if {{:remote config}} either returned the existing 
> configuration settings or if it listed some help.
>  {{:remote config help}} could let the user know what parameters are 
> available and how they can be configured. Or perhaps something similar to how 
> {{:remote connect}} works when you leave out parameters would help lead the 
> user down the path of getting the syntax right.
> Although I approached this from a Gephi perspective, it seems that the config 
> options help must be based on the remote type, whether it is 
> {{tinkerpop.gephi}} vs {{tinkerpop.server}} vs {{tinkerpop.hadoop}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #573: TINKERPOP-1303 Adds help option to :remote conf...

2017-03-16 Thread spmallette
GitHub user spmallette opened a pull request:

https://github.com/apache/tinkerpop/pull/573

TINKERPOP-1303 Adds help option to :remote config command

https://issues.apache.org/jira/browse/TINKERPOP-1303

Here's the output for "help" in the plugins that support `:remote` as an 
option in the console:

```text
gremlin> :remote connect tinkerpop.gephi
==>Connection to Gephi - http://localhost:8080/workspace1 with 
stepDelay:1000, startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, 
colorFadeRate:0.7, startSize:10.0,sizeDecrementRate:0.33
gremlin> :remote config help
==>:remote config [host |port |workspace |stepDelay 
|startRGBColor <0.0,0.0,0.0>|colorToFade [r|g|b]|colorFadeRate 
<0.0>|sizeDecrementRate <0.0>|startSize <0.0>|visualTraversal |help]
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote config help
==>:remote config [timeout [|none]|alias [reset|show| 
]|help]
gremlin> :remote connect tinkerpop.hadoop graph g

==>useTraversalSource=graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat],
 sparkgraphcomputer]
==>useSugar=false
gremlin> :remote config help
==>:remote config [useSugar [true|false]|useTraversalSource 
|help]
```

This was a pretty simple change, but since @pluradj added this ticket, I 
opted submit this to vote so that he could review before merge instead of just 
doing a CTR.

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1303

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/573.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #573


commit cf8b6b97eb6fcd5a4f1a11f92da89ef24f8bca81
Author: Stephen Mallette 
Date:   2017-03-16T15:51:23Z

TINKERPOP-1303 Adds help option to :remote config command




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Assigned] (TINKERPOP-1387) from and to modulators for path steps

2017-03-16 Thread Marko A. Rodriguez (JIRA)

 [ 
https://issues.apache.org/jira/browse/TINKERPOP-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marko A. Rodriguez reassigned TINKERPOP-1387:
-

Assignee: Marko A. Rodriguez

> from and to modulators for path steps
> -
>
> Key: TINKERPOP-1387
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1387
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.1
>Reporter: Daniel Kuppitz
>Assignee: Marko A. Rodriguez
>
> Just had this crazy idea of {{from}} and {{to}} modulators for path steps.
> {code}
> g.V(1).as("a").
>   
> repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
>   
> repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
>   path().from("a").to("p").as("pathFromMarkoToProject").
>   path().from("p").to("b").as("pathFromProjectToPeter").
>   match(
> __.as("pathFromMarkoToProject").count(local).is(lte(3)),
> __.as("pathFromProjectToPeter").count(local).is(lte(3))
>   ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TINKERPOP-1652) Disable PathRetractionStrategy strategy if VertexProgramStep has LABELLED_PATH requirement

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928168#comment-15928168
 ] 

ASF GitHub Bot commented on TINKERPOP-1652:
---

GitHub user twilmes opened a pull request:

https://github.com/apache/tinkerpop/pull/572

TINKERPOP-1652 Disable PathRetractionStrategy strategy if VertexProgamStep 
has LABELLED_PATH requirement

This PR updates `PathRetractionStrategy` to not run if the provided 
traversal has `VertexProgramStep` with a `LABELED_PATH` requirement.  I created 
a custom mock VertexProgram to test this out.  I saw a few uses of Mockito 
throughout the codebase but seem to remember that not being the preferred 
approach but if that is preferable, I can update to use it.

```
[INFO] 

[INFO] Reactor Summary:
[INFO] 
[INFO] Apache TinkerPop ... SUCCESS [  
3.083 s]
[INFO] Apache TinkerPop :: Gremlin Shaded . SUCCESS [  
2.043 s]
[INFO] Apache TinkerPop :: Gremlin Core ... SUCCESS [ 
57.388 s]
[INFO] Apache TinkerPop :: Gremlin Test ... SUCCESS [  
8.661 s]
[INFO] Apache TinkerPop :: Gremlin Groovy . SUCCESS [ 
53.662 s]
[INFO] Apache TinkerPop :: Gremlin Groovy Test  SUCCESS [  
4.362 s]
[INFO] Apache TinkerPop :: TinkerGraph Gremlin  SUCCESS [02:06 
min]
[INFO] Apache TinkerPop :: Gremlin Benchmark .. SUCCESS [  
3.511 s]
[INFO] Apache TinkerPop :: Gremlin Driver . SUCCESS [  
9.088 s]
[INFO] Apache TinkerPop :: Neo4j Gremlin .. SUCCESS [  
2.324 s]
[INFO] Apache TinkerPop :: Gremlin Server . SUCCESS [ 
42.555 s]
[INFO] Apache TinkerPop :: Gremlin Python . SUCCESS [  
7.699 s]
[INFO] Apache TinkerPop :: Hadoop Gremlin . SUCCESS [02:50 
min]
[INFO] Apache TinkerPop :: Spark Gremlin .. SUCCESS [01:03 
min]
[INFO] Apache TinkerPop :: Giraph Gremlin . SUCCESS [  
4.378 s]
[INFO] Apache TinkerPop :: Gremlin Console  SUCCESS [ 
16.988 s]
[INFO] Apache TinkerPop :: Gremlin Archetype .. SUCCESS [  
0.044 s]
[INFO] Apache TinkerPop :: Archetype - TinkerGraph  SUCCESS [  
4.036 s]
[INFO] Apache TinkerPop :: Archetype - Server . SUCCESS [  
9.915 s]
[INFO] 

[INFO] BUILD SUCCESS
[INFO] 

[INFO] Total time: 09:50 min
[INFO] Finished at: 2017-03-16T09:18:16-05:00
[INFO] Final Memory: 219M/3705M
[INFO] 

```

VOTE: +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1652

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/572.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #572


commit a5e3c4f33642043d2f7c7a473cd4024c956d6f28
Author: Ted Wilmes 
Date:   2017-03-16T14:23:29Z

TINKERPOP-1652 Disable PathRetractionStrategy strategy if VertexProgramStep 
has LABELLED_PATH requirement

If traversal has a VertexProgramStep with a LABELED_PATH, 
PathRetractionStrategy is not run.




> Disable PathRetractionStrategy strategy if VertexProgramStep has 
> LABELLED_PATH requirement
> --
>
> Key: TINKERPOP-1652
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1652
> Project: TinkerPop
>  Issue Type: Bug
>Reporter: Ted Wilmes
>Assignee: Ted Wilmes
>
> [~dkuppitz] notified me that there is an issue where 
> {{PathRetractionStrategy}} is incorrectly dropping path elements when a 
> {{VertexProgramStep}} is present that has a {{LABELLED_PATH}} requirement.  
> We already handle the case where path is required but this issue will also 
> disable the strategy if a vertex program is present that requires 
> {{LABELLED_PATH}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #572: TINKERPOP-1652 Disable PathRetractionStrategy s...

2017-03-16 Thread twilmes
GitHub user twilmes opened a pull request:

https://github.com/apache/tinkerpop/pull/572

TINKERPOP-1652 Disable PathRetractionStrategy strategy if VertexProgamStep 
has LABELLED_PATH requirement

This PR updates `PathRetractionStrategy` to not run if the provided 
traversal has `VertexProgramStep` with a `LABELED_PATH` requirement.  I created 
a custom mock VertexProgram to test this out.  I saw a few uses of Mockito 
throughout the codebase but seem to remember that not being the preferred 
approach but if that is preferable, I can update to use it.

```
[INFO] 

[INFO] Reactor Summary:
[INFO] 
[INFO] Apache TinkerPop ... SUCCESS [  
3.083 s]
[INFO] Apache TinkerPop :: Gremlin Shaded . SUCCESS [  
2.043 s]
[INFO] Apache TinkerPop :: Gremlin Core ... SUCCESS [ 
57.388 s]
[INFO] Apache TinkerPop :: Gremlin Test ... SUCCESS [  
8.661 s]
[INFO] Apache TinkerPop :: Gremlin Groovy . SUCCESS [ 
53.662 s]
[INFO] Apache TinkerPop :: Gremlin Groovy Test  SUCCESS [  
4.362 s]
[INFO] Apache TinkerPop :: TinkerGraph Gremlin  SUCCESS [02:06 
min]
[INFO] Apache TinkerPop :: Gremlin Benchmark .. SUCCESS [  
3.511 s]
[INFO] Apache TinkerPop :: Gremlin Driver . SUCCESS [  
9.088 s]
[INFO] Apache TinkerPop :: Neo4j Gremlin .. SUCCESS [  
2.324 s]
[INFO] Apache TinkerPop :: Gremlin Server . SUCCESS [ 
42.555 s]
[INFO] Apache TinkerPop :: Gremlin Python . SUCCESS [  
7.699 s]
[INFO] Apache TinkerPop :: Hadoop Gremlin . SUCCESS [02:50 
min]
[INFO] Apache TinkerPop :: Spark Gremlin .. SUCCESS [01:03 
min]
[INFO] Apache TinkerPop :: Giraph Gremlin . SUCCESS [  
4.378 s]
[INFO] Apache TinkerPop :: Gremlin Console  SUCCESS [ 
16.988 s]
[INFO] Apache TinkerPop :: Gremlin Archetype .. SUCCESS [  
0.044 s]
[INFO] Apache TinkerPop :: Archetype - TinkerGraph  SUCCESS [  
4.036 s]
[INFO] Apache TinkerPop :: Archetype - Server . SUCCESS [  
9.915 s]
[INFO] 

[INFO] BUILD SUCCESS
[INFO] 

[INFO] Total time: 09:50 min
[INFO] Finished at: 2017-03-16T09:18:16-05:00
[INFO] Final Memory: 219M/3705M
[INFO] 

```

VOTE: +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1652

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/572.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #572


commit a5e3c4f33642043d2f7c7a473cd4024c956d6f28
Author: Ted Wilmes 
Date:   2017-03-16T14:23:29Z

TINKERPOP-1652 Disable PathRetractionStrategy strategy if VertexProgramStep 
has LABELLED_PATH requirement

If traversal has a VertexProgramStep with a LABELED_PATH, 
PathRetractionStrategy is not run.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928144#comment-15928144
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106428624
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
+
+/**
+ * Add {@link Graph} g with name {@link String} gName to 
+ * {@link Map} returned by call to getGraphs()
  */
-public Map getGraphs() {
-return graphs;
-}
+public void addGraph(String gName, Graph g);
 
 /**
- * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
- * initialization scripts.
+ * Get a list of the {@link TraversalSource} instances and their 
binding names
  *
  * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
  * {@link TraversalSource} itself
  */
-public Map getTraversalSources() {
-return traversalSources;
-}
+public Map getTraversalSources();
 
 /**
+ * Get {@link TraversalSource} instance whose name matches {@link 
tsName}
+ *
+ * @return {@link TraversalSource} if exists, else null
+ */
+
+public TraversalSource getTraversalSource(String tsName);
+/**
  * Get the {@link Graph} and {@link 

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928096#comment-15928096
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106424001
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and 

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928110#comment-15928110
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106425058
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106425058
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public Map getTraversalSources() {
+return traversalSources;
+}
+
+public TraversalSource 

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928100#comment-15928100
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106424327
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
+
+/**
+ * Add {@link Graph} g with name {@link String} gName to 
+ * {@link Map} returned by call to getGraphs()
  */
-public Map getGraphs() {
-return graphs;
-}
+public void addGraph(String gName, Graph g);
 
 /**
- * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
- * initialization scripts.
+ * Get a list of the {@link TraversalSource} instances and their 
binding names
  *
  * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
  * {@link TraversalSource} itself
  */
-public Map getTraversalSources() {
-return traversalSources;
-}
+public Map getTraversalSources();
 
 /**
+ * Get {@link TraversalSource} instance whose name matches {@link 
tsName}
+ *
+ * @return {@link TraversalSource} if exists, else null
+ */
+
+public TraversalSource getTraversalSource(String tsName);
+/**
  * Get the {@link Graph} and {@link 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106424327
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
+
+/**
+ * Add {@link Graph} g with name {@link String} gName to 
+ * {@link Map} returned by call to getGraphs()
  */
-public Map getGraphs() {
-return graphs;
-}
+public void addGraph(String gName, Graph g);
 
 /**
- * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
- * initialization scripts.
+ * Get a list of the {@link TraversalSource} instances and their 
binding names
  *
  * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
  * {@link TraversalSource} itself
  */
-public Map getTraversalSources() {
-return traversalSources;
-}
+public Map getTraversalSources();
 
 /**
+ * Get {@link TraversalSource} instance whose name matches {@link 
tsName}
+ *
+ * @return {@link TraversalSource} if exists, else null
+ */
+
+public TraversalSource getTraversalSource(String tsName);
+/**
  * Get the {@link Graph} and {@link TraversalSource} list as a set of 
bindings.
  */
-public Bindings getAsBindings() {
-final Bindings bindings = new SimpleBindings();
-graphs.forEach(bindings::put);
-traversalSources.forEach(bindings::put);

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread dpitera
Github user dpitera commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106424001
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public Map getTraversalSources() {
+return traversalSources;
+}
+
+public TraversalSource 

[jira] [Created] (TINKERPOP-1652) Disable PathRetractionStrategy strategy if VertexProgramStep has LABELLED_PATH requirement

2017-03-16 Thread Ted Wilmes (JIRA)
Ted Wilmes created TINKERPOP-1652:
-

 Summary: Disable PathRetractionStrategy strategy if 
VertexProgramStep has LABELLED_PATH requirement
 Key: TINKERPOP-1652
 URL: https://issues.apache.org/jira/browse/TINKERPOP-1652
 Project: TinkerPop
  Issue Type: Bug
Reporter: Ted Wilmes
Assignee: Ted Wilmes


[~dkuppitz] notified me that there is an issue where {{PathRetractionStrategy}} 
is incorrectly dropping path elements when a {{VertexProgramStep}} is present 
that has a {{LABELLED_PATH}} requirement.  We already handle the case where 
path is required but this issue will also disable the strategy if a vertex 
program is present that requires {{LABELLED_PATH}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop issue #569: TINKERPOP-1438: GraphManager becomes a customizable in...

2017-03-16 Thread spmallette
Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/569
  
I think I'm done with this round of comments. I suspect I might have a few 
more yet about the `GraphManager` interface itself - still rolling some ideas 
around in my mind on it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928023#comment-15928023
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106415356
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106415356
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
+ * {@link TraversalSource} itself
+ */
+public Map getTraversalSources() {
+return traversalSources;
+}
+
+public TraversalSource 

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15928005#comment-15928005
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106413754
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
+
+/**
+ * Add {@link Graph} g with name {@link String} gName to 
+ * {@link Map} returned by call to getGraphs()
  */
-public Map getGraphs() {
-return graphs;
-}
+public void addGraph(String gName, Graph g);
 
 /**
- * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
- * initialization scripts.
+ * Get a list of the {@link TraversalSource} instances and their 
binding names
  *
  * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
  * {@link TraversalSource} itself
  */
-public Map getTraversalSources() {
-return traversalSources;
-}
+public Map getTraversalSources();
 
 /**
+ * Get {@link TraversalSource} instance whose name matches {@link 
tsName}
+ *
+ * @return {@link TraversalSource} if exists, else null
+ */
+
+public TraversalSource getTraversalSource(String tsName);
+/**
  * Get the {@link Graph} and {@link 

[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106413754
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
+
+/**
+ * Add {@link Graph} g with name {@link String} gName to 
+ * {@link Map} returned by call to getGraphs()
  */
-public Map getGraphs() {
-return graphs;
-}
+public void addGraph(String gName, Graph g);
 
 /**
- * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
- * initialization scripts.
+ * Get a list of the {@link TraversalSource} instances and their 
binding names
  *
  * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and the value is the
  * {@link TraversalSource} itself
  */
-public Map getTraversalSources() {
-return traversalSources;
-}
+public Map getTraversalSources();
 
 /**
+ * Get {@link TraversalSource} instance whose name matches {@link 
tsName}
+ *
+ * @return {@link TraversalSource} if exists, else null
+ */
+
+public TraversalSource getTraversalSource(String tsName);
+/**
  * Get the {@link Graph} and {@link TraversalSource} list as a set of 
bindings.
  */
-public Bindings getAsBindings() {
-final Bindings bindings = new SimpleBindings();
-graphs.forEach(bindings::put);
-

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15927992#comment-15927992
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106412544
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
 ---
@@ -0,0 +1,201 @@
+/*
+ * 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.server.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.server.GraphManager;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+/**
+ * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
+ * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
+ * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
+ * initialization scripts construct them.
+ */
+public final class DefaultGraphManager implements GraphManager {
+private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
+
+private final Map graphs = new ConcurrentHashMap<>();
+private final Map traversalSources = new 
ConcurrentHashMap<>();
+
+/**
+ * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ */
+public DefaultGraphManager(final Settings settings) {
+settings.graphs.entrySet().forEach(e -> {
+try {
+final Graph newGraph = GraphFactory.open(e.getValue());
+graphs.put(e.getKey(), newGraph);
+logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
+} catch (RuntimeException re) {
+logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
+e.getKey(), e.getValue(), re.getMessage()), re);
+if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
+}
+});
+}
+
+/**
+ * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
+ * configuration file.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ */
+public Map getGraphs() {
+return graphs;
+}
+
+public Graph getGraph(String gName) {
+return graphs.get(gName);
+}
+
+public void addGraph(String gName, Graph g) {
+graphs.put(gName, g);
+}
+
+/**
+ * Get a list of the {@link TraversalSource} instances and their 
binding names as defined by Gremlin Server
+ * initialization scripts.
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
TraversalSource} and 

[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15927973#comment-15927973
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106410916
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
 ---
@@ -100,9 +101,28 @@ public ServerGremlinExecutor(final Settings settings, 
final ExecutorService grem
  */
 public ServerGremlinExecutor(final Settings settings, final 
ExecutorService gremlinExecutorService,
  final T scheduledExecutorService, final 
Class scheduleExecutorServiceClass,
- final GraphManager graphManager) {
+ GraphManager graphManager) {
 this.settings = settings;
 
+if (null == graphManager) {
--- End diff --

looks like there's some indentation problems in the following lines of 
code. should be four spaces between the curly brackets.


> Consider GraphManager as an interface
> -
>
> Key: TINKERPOP-1438
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1438
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: server
>Affects Versions: 3.2.2
>Reporter: stephen mallette
>Priority: Minor
>  Labels: breaking
>
> If {{GraphManager}} were an interface it would make embedding Gremlin Server 
> easier as {{Graph}} instances could be more easily supplied by the host 
> application. In doing this, It also might be good to force a 
> {{TraversalSource}} to be referred to by both the {{Graph}} name and  
> {{TraversalSource}} name.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106410916
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
 ---
@@ -100,9 +101,28 @@ public ServerGremlinExecutor(final Settings settings, 
final ExecutorService grem
  */
 public ServerGremlinExecutor(final Settings settings, final 
ExecutorService gremlinExecutorService,
  final T scheduledExecutorService, final 
Class scheduleExecutorServiceClass,
- final GraphManager graphManager) {
+ GraphManager graphManager) {
 this.settings = settings;
 
+if (null == graphManager) {
--- End diff --

looks like there's some indentation problems in the following lines of 
code. should be four spaces between the curly brackets.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15927970#comment-15927970
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106410530
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
--- End diff --

Looks like you're still missing a bunch of "final" declarations. I would 
normally just handle them for you at merge, but you have a pretty large PR 
going here, so it would be helpful if you got them all for us.


> Consider GraphManager as an interface
> -
>
> Key: TINKERPOP-1438
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1438
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: server
>Affects Versions: 3.2.2
>Reporter: stephen mallette
>Priority: Minor
>  Labels: breaking
>
> If {{GraphManager}} were an interface it would make embedding Gremlin Server 
> easier as {{Graph}} instances could be more easily supplied by the host 
> application. In doing this, It also might be good to force a 
> {{TraversalSource}} to be referred to by both the {{Graph}} name and  
> {{TraversalSource}} name.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106410530
  
--- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
 ---
@@ -21,139 +21,87 @@
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-
-/**
- * Holder for {@link Graph} and {@link TraversalSource} instances 
configured for the server to be passed to script
- * engine bindings. The {@link Graph} instances are read from the {@link 
Settings} for Gremlin Server as defined in
- * the configuration file. The {@link TraversalSource} instances are 
rebound to the {@code GraphManager} once
- * initialization scripts construct them.
- */
-public final class GraphManager {
-private static final Logger logger = 
LoggerFactory.getLogger(GremlinServer.class);
-
-private final Map graphs = new ConcurrentHashMap<>();
-private final Map traversalSources = new 
ConcurrentHashMap<>();
+import java.util.function.Supplier;
 
+public interface GraphManager {
 /**
- * Create a new instance using the {@link Settings} from Gremlin 
Server.
+ * Get a list of the {@link Graph} instances and their binding names
+ *
+ * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
  */
-public GraphManager(final Settings settings) {
-settings.graphs.entrySet().forEach(e -> {
-try {
-final Graph newGraph = GraphFactory.open(e.getValue());
-graphs.put(e.getKey(), newGraph);
-logger.info("Graph [{}] was successfully configured via 
[{}].", e.getKey(), e.getValue());
-} catch (RuntimeException re) {
-logger.warn(String.format("Graph [%s] configured at [%s] 
could not be instantiated and will not be available in Gremlin Server.  
GraphFactory message: %s",
-e.getKey(), e.getValue(), re.getMessage()), re);
-if (re.getCause() != null) logger.debug("GraphFactory 
exception", re.getCause());
-}
-});
-}
-
+public Map getGraphs();
+
 /**
- * Get a list of the {@link Graph} instances and their binding names 
as defined in the Gremlin Server
- * configuration file.
+ * Get {@link Graph} instance whose name matches {@link gName}
  *
- * @return a {@link Map} where the key is the name of the {@link 
Graph} and the value is the {@link Graph} itself
+ * @return {@link Graph} if exists, else null 
+ */
+public Graph getGraph(String gName);
--- End diff --

Looks like you're still missing a bunch of "final" declarations. I would 
normally just handle them for you at merge, but you have a pretty large PR 
going here, so it would be helpful if you got them all for us.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1438) Consider GraphManager as an interface

2017-03-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15927968#comment-15927968
 ] 

ASF GitHub Bot commented on TINKERPOP-1438:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106410060
  
--- Diff: CHANGELOG.asciidoc ---
@@ -47,6 +47,9 @@ TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED 
YET)
 * Improved error handling of compilation failures for very large or highly 
parameterized script sent to Gremlin Server.
 * Fixed a bug in `RangeByIsCountStrategy` that changed the meaning of 
inner traversals.
 * Improved Gremlin-Python Driver implementation by adding a threaded 
client with basic connection pooling and support for pluggable websocket 
clients.
+* Changed GraphManager from a final class implementation to an interface.
--- End diff --

minor formatting thing - make sure that class/interface/code names have the 
backtick around them so that they format properly when the asciidoc is 
generated. you might want to look at the other docs you wrote as you missed a 
few instances there as well.


> Consider GraphManager as an interface
> -
>
> Key: TINKERPOP-1438
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1438
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: server
>Affects Versions: 3.2.2
>Reporter: stephen mallette
>Priority: Minor
>  Labels: breaking
>
> If {{GraphManager}} were an interface it would make embedding Gremlin Server 
> easier as {{Graph}} instances could be more easily supplied by the host 
> application. In doing this, It also might be good to force a 
> {{TraversalSource}} to be referred to by both the {{Graph}} name and  
> {{TraversalSource}} name.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] tinkerpop pull request #569: TINKERPOP-1438: GraphManager becomes a customiz...

2017-03-16 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/569#discussion_r106410060
  
--- Diff: CHANGELOG.asciidoc ---
@@ -47,6 +47,9 @@ TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED 
YET)
 * Improved error handling of compilation failures for very large or highly 
parameterized script sent to Gremlin Server.
 * Fixed a bug in `RangeByIsCountStrategy` that changed the meaning of 
inner traversals.
 * Improved Gremlin-Python Driver implementation by adding a threaded 
client with basic connection pooling and support for pluggable websocket 
clients.
+* Changed GraphManager from a final class implementation to an interface.
--- End diff --

minor formatting thing - make sure that class/interface/code names have the 
backtick around them so that they format properly when the asciidoc is 
generated. you might want to look at the other docs you wrote as you missed a 
few instances there as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (TINKERPOP-1651) Remove deprecated gremlin.sh init syntax

2017-03-16 Thread stephen mallette (JIRA)
stephen mallette created TINKERPOP-1651:
---

 Summary: Remove deprecated gremlin.sh init syntax
 Key: TINKERPOP-1651
 URL: https://issues.apache.org/jira/browse/TINKERPOP-1651
 Project: TinkerPop
  Issue Type: Improvement
  Components: console
Affects Versions: 3.2.4
Reporter: stephen mallette
Priority: Minor


The old method for initializing the gremlin-console needs to be removed:

{code}
bn/gremlin.sh init.groovy
{code}

The new method that has been in play for a while now is:

{code}
bn/gremlin.sh -i init.groovy
{code}




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)