[jira] [Commented] (TINKERPOP-2061) Add with() configuration as global to a traversal

2018-10-22 Thread ASF GitHub Bot (JIRA)


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

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

spmallette closed pull request #961: TINKERPOP-2061 Added with() option for 
traversal configuration
URL: https://github.com/apache/tinkerpop/pull/961
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add with() configuration as global to a traversal
> -
>
> Key: TINKERPOP-2061
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2061
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.4.0
>Reporter: stephen mallette
>Assignee: stephen mallette
>Priority: Major
> Fix For: 3.4.0
>
>
> Provide a for {{with(String)}} and {{with(String,Object)}} at the 
> configuration of the {{TraversalSource}} - basically a shorthand for using 
> {{OptionsStrategy}} manually and {{withStrategies()}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TINKERPOP-2061) Add with() configuration as global to a traversal

2018-10-22 Thread ASF GitHub Bot (JIRA)


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

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

spmallette commented on a change in pull request #961: TINKERPOP-2061 Added 
with() option for traversal configuration
URL: https://github.com/apache/tinkerpop/pull/961#discussion_r227050936
 
 

 ##
 File path: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
 ##
 @@ -93,6 +96,39 @@ private Symbols() {
 
 /
 
+/**
+ * Provides a configuration to a traversal in the form of a key which is 
the same as {@code with(key, true)}. The
+ * key of the configuration must be graph provider specific and therefore 
a configuration could be supplied that
+ * is not known to be valid until execution.
+ *
+ * @param key the key of the configuration to apply to a traversal
+ * @return a new traversal source with the included configuration
+ * @since 3.4.0
+ */
+public default TraversalSource with(final String key) {
+return with(key, true);
+}
+
+/**
+ * Provides a configuration to a traversal in the form of a key value 
pair. The  key of the configuration must be
+ * graph provider specific and therefore a configuration could be supplied 
that is not known to be valid until
+ * execution. This is a handy shortcut for building an {@link 
OptionsStrategy} manually and then add with
+ * {@link #withStrategies(TraversalStrategy[])}.
+ *
+ * @param key the key of the configuration to apply to a traversal
+ * @param value the value of the configuration to apply to a traversal
+ * @return a new traversal source with the included configuration
+ * @since 3.4.0
+ */
+public default TraversalSource with(final String key, final Object value) {
+final Optional opt = 
getStrategies().getStrategy(OptionsStrategy.class);
+final OptionsStrategy strategy = opt.orElse(OptionsStrategy.EMPTY);
+final OptionsStrategy.Builder builder = OptionsStrategy.build();
+strategy.getOptions().forEach(builder::with);
+builder.with(key, value);
+return withStrategies(builder.create());
+}
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add with() configuration as global to a traversal
> -
>
> Key: TINKERPOP-2061
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2061
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.4.0
>Reporter: stephen mallette
>Assignee: stephen mallette
>Priority: Major
> Fix For: 3.4.0
>
>
> Provide a for {{with(String)}} and {{with(String,Object)}} at the 
> configuration of the {{TraversalSource}} - basically a shorthand for using 
> {{OptionsStrategy}} manually and {{withStrategies()}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TINKERPOP-2061) Add with() configuration as global to a traversal

2018-10-11 Thread ASF GitHub Bot (JIRA)


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

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

dkuppitz commented on a change in pull request #961: TINKERPOP-2061 Added 
with() option for traversal configuration
URL: https://github.com/apache/tinkerpop/pull/961#discussion_r224530299
 
 

 ##
 File path: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
 ##
 @@ -93,6 +96,39 @@ private Symbols() {
 
 /
 
+/**
+ * Provides a configuration to a traversal in the form of a key which is 
the same as {@code with(key, true)}. The
+ * key of the configuration must be graph provider specific and therefore 
a configuration could be supplied that
+ * is not known to be valid until execution.
+ *
+ * @param key the key of the configuration to apply to a traversal
+ * @return a new traversal source with the included configuration
+ * @since 3.4.0
+ */
+public default TraversalSource with(final String key) {
+return with(key, true);
+}
+
+/**
+ * Provides a configuration to a traversal in the form of a key value 
pair. The  key of the configuration must be
+ * graph provider specific and therefore a configuration could be supplied 
that is not known to be valid until
+ * execution. This is a handy shortcut for building an {@link 
OptionsStrategy} manually and then add with
+ * {@link #withStrategies(TraversalStrategy[])}.
+ *
+ * @param key the key of the configuration to apply to a traversal
+ * @param value the value of the configuration to apply to a traversal
+ * @return a new traversal source with the included configuration
+ * @since 3.4.0
+ */
+public default TraversalSource with(final String key, final Object value) {
+final Optional opt = 
getStrategies().getStrategy(OptionsStrategy.class);
+final OptionsStrategy strategy = opt.orElse(OptionsStrategy.EMPTY);
+final OptionsStrategy.Builder builder = OptionsStrategy.build();
+strategy.getOptions().forEach(builder::with);
+builder.with(key, value);
+return withStrategies(builder.create());
+}
 
 Review comment:
   Perhaps a little bit more elegant:
   ```java
   public default TraversalSource with(final String key, final Object 
value) {
   final OptionsStrategy.Builder builder = OptionsStrategy.build();
   getStrategies().getStrategy(OptionsStrategy.class)
   .ifPresent(optionsStrategy -> 
optionsStrategy.getOptions().forEach(builder::with));
   builder.with(key, value);
   return withStrategies(builder.create());
   }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add with() configuration as global to a traversal
> -
>
> Key: TINKERPOP-2061
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2061
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.4.0
>Reporter: stephen mallette
>Assignee: stephen mallette
>Priority: Major
>
> Provide a for {{with(String)}} and {{with(String,Object)}} at the 
> configuration of the {{TraversalSource}} - basically a shorthand for using 
> {{OptionsStrategy}} manually and {{withStrategies()}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TINKERPOP-2061) Add with() configuration as global to a traversal

2018-10-10 Thread ASF GitHub Bot (JIRA)


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

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

spmallette opened a new pull request #961: TINKERPOP-2061 Added with() option 
for traversal configuration
URL: https://github.com/apache/tinkerpop/pull/961
 
 
   https://issues.apache.org/jira/browse/TINKERPOP-2061
   
   Basically just shorthands the direct use of `OptionStrategy` which is much 
more verbose and less nice to look at. See the upgrade doc changes in this PR 
for an example of usage.
   
   All tests pass with `docker/build.sh -t -n -i`
   
   VOTE +1


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add with() configuration as global to a traversal
> -
>
> Key: TINKERPOP-2061
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2061
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.4.0
>Reporter: stephen mallette
>Assignee: stephen mallette
>Priority: Major
>
> Provide a for {{with(String)}} and {{with(String,Object)}} at the 
> configuration of the {{TraversalSource}} - basically a shorthand for using 
> {{OptionsStrategy}} manually and {{withStrategies()}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)