You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by Marko Rodriguez <ok...@gmail.com> on 2015/03/23 16:04:47 UTC

Strategy on or off?

Hi,

Friday afternoon I wrote LambdaRestrictionStrategy which makes it so that if a user uses a lambda (e.g. filter{}) an exception is thrown.

	https://github.com/apache/incubator-tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LambdaRestrictionStrategy.java
		https://issues.apache.org/jira/browse/TINKERPOP3-540?jql=project%20%3D%20TINKERPOP3%20AND%20status%20in%20(Open%2C%20Closed)%20AND%20fixVersion%20%3D%203.0.0.GA

I think we will want to make this a default strategy, but there will be "power users" that will want this turned off. Right now with TraversalSource, you have a builder model that allows you to add strategies (Builder.strategy()), but not remove them. I'm wondering if we should support --

	g = graph.traversal(standard.with(MyStrategy.instance()).without(LambdaRestrictionStrategy.class))

Any strong preferences?

Marko.

http://markorodriguez.com


Re: Strategy on or off?

Posted by Marko Rodriguez <ok...@gmail.com>.
Hi,

I made it so you do:

	g = graph.traversal(standard().with(ReadOnlyStrategy.instance()))
	g = graph.traversal(standard().without(LambdaRestrictionStrategy.class))

Note that I got rid of the static standard and computer fields. You have to do standard() or computer() now. Little cleaner and less confusing I think.

Thanks,
Marko.

http://markorodriguez.com

On Mar 23, 2015, at 10:55 AM, Daniel Kuppitz <me...@gremlin.guru> wrote:

> Yep, +1 for the suggested builder extension.
> 
> On Mon, Mar 23, 2015 at 4:25 PM, Stephen Mallette <sp...@gmail.com>
> wrote:
> 
>> I agree that we need some mode of turning LambdaRestrictionStrategy and
>> other strategies off.  I guess the best way to do that is to extend the
>> builder model for removals as you suggested.
>> 
>> On Mon, Mar 23, 2015 at 11:04 AM, Marko Rodriguez <ok...@gmail.com>
>> wrote:
>> 
>>> Hi,
>>> 
>>> Friday afternoon I wrote LambdaRestrictionStrategy which makes it so that
>>> if a user uses a lambda (e.g. filter{}) an exception is thrown.
>>> 
>>> 
>>> 
>> https://github.com/apache/incubator-tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LambdaRestrictionStrategy.java
>>> 
>>> 
>> https://issues.apache.org/jira/browse/TINKERPOP3-540?jql=project%20%3D%20TINKERPOP3%20AND%20status%20in%20(Open%2C%20Closed)%20AND%20fixVersion%20%3D%203.0.0.GA
>>> 
>>> I think we will want to make this a default strategy, but there will be
>>> "power users" that will want this turned off. Right now with
>>> TraversalSource, you have a builder model that allows you to add
>> strategies
>>> (Builder.strategy()), but not remove them. I'm wondering if we should
>>> support --
>>> 
>>>        g =
>>> 
>> graph.traversal(standard.with(MyStrategy.instance()).without(LambdaRestrictionStrategy.class))
>>> 
>>> Any strong preferences?
>>> 
>>> Marko.
>>> 
>>> http://markorodriguez.com
>>> 
>>> 
>> 


Re: Strategy on or off?

Posted by Daniel Kuppitz <me...@gremlin.guru>.
Yep, +1 for the suggested builder extension.

On Mon, Mar 23, 2015 at 4:25 PM, Stephen Mallette <sp...@gmail.com>
wrote:

> I agree that we need some mode of turning LambdaRestrictionStrategy and
> other strategies off.  I guess the best way to do that is to extend the
> builder model for removals as you suggested.
>
> On Mon, Mar 23, 2015 at 11:04 AM, Marko Rodriguez <ok...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Friday afternoon I wrote LambdaRestrictionStrategy which makes it so that
> > if a user uses a lambda (e.g. filter{}) an exception is thrown.
> >
> >
> >
> https://github.com/apache/incubator-tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LambdaRestrictionStrategy.java
> >
> >
> https://issues.apache.org/jira/browse/TINKERPOP3-540?jql=project%20%3D%20TINKERPOP3%20AND%20status%20in%20(Open%2C%20Closed)%20AND%20fixVersion%20%3D%203.0.0.GA
> >
> > I think we will want to make this a default strategy, but there will be
> > "power users" that will want this turned off. Right now with
> > TraversalSource, you have a builder model that allows you to add
> strategies
> > (Builder.strategy()), but not remove them. I'm wondering if we should
> > support --
> >
> >         g =
> >
> graph.traversal(standard.with(MyStrategy.instance()).without(LambdaRestrictionStrategy.class))
> >
> > Any strong preferences?
> >
> > Marko.
> >
> > http://markorodriguez.com
> >
> >
>

Re: Strategy on or off?

Posted by Stephen Mallette <sp...@gmail.com>.
I agree that we need some mode of turning LambdaRestrictionStrategy and
other strategies off.  I guess the best way to do that is to extend the
builder model for removals as you suggested.

On Mon, Mar 23, 2015 at 11:04 AM, Marko Rodriguez <ok...@gmail.com>
wrote:

> Hi,
>
> Friday afternoon I wrote LambdaRestrictionStrategy which makes it so that
> if a user uses a lambda (e.g. filter{}) an exception is thrown.
>
>
> https://github.com/apache/incubator-tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LambdaRestrictionStrategy.java
>
> https://issues.apache.org/jira/browse/TINKERPOP3-540?jql=project%20%3D%20TINKERPOP3%20AND%20status%20in%20(Open%2C%20Closed)%20AND%20fixVersion%20%3D%203.0.0.GA
>
> I think we will want to make this a default strategy, but there will be
> "power users" that will want this turned off. Right now with
> TraversalSource, you have a builder model that allows you to add strategies
> (Builder.strategy()), but not remove them. I'm wondering if we should
> support --
>
>         g =
> graph.traversal(standard.with(MyStrategy.instance()).without(LambdaRestrictionStrategy.class))
>
> Any strong preferences?
>
> Marko.
>
> http://markorodriguez.com
>
>