[
https://issues.apache.org/jira/browse/TINKERPOP-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134910#comment-17134910
]
ASF GitHub Bot commented on TINKERPOP-2014:
-------------------------------------------
spmallette opened a new pull request #1296:
URL: https://github.com/apache/tinkerpop/pull/1296
https://issues.apache.org/jira/browse/TINKERPOP-2014
Went with a strategy rather than another configuration option the the
`TraversalSource` (e.g. `withSeed()`) as this seemed like the kind of feature
we didn't need to run into the Gremlin language itself.
```text
gremlin> g.V().values('name').fold().order(local).by(shuffle)
==>[josh,marko,vadas,peter,ripple,lop]
gremlin> g.V().values('name').fold().order(local).by(shuffle)
==>[vadas,lop,marko,peter,josh,ripple]
gremlin> g.V().values('name').fold().order(local).by(shuffle)
==>[peter,ripple,josh,lop,marko,vadas]
gremlin> g.withStrategies(new
SeedStrategy(22323)).V().values('name').fold().order(local).by(shuffle)
==>[lop,peter,josh,marko,vadas,ripple]
gremlin> g.withStrategies(new
SeedStrategy(22323)).V().values('name').fold().order(local).by(shuffle)
==>[lop,peter,josh,marko,vadas,ripple]
gremlin> g.withStrategies(new
SeedStrategy(22323)).V().values('name').fold().order(local).by(shuffle)
==>[lop,peter,josh,marko,vadas,ripple]
```
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 to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Allow an ability to specify seeding for random methods such as coin, sample
> and Order.shuffle
> ---------------------------------------------------------------------------------------------
>
> Key: TINKERPOP-2014
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2014
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.3.3
> Reporter: Sam Rosen
> Priority: Minor
>
> Currently, all the methods that have non-deterministic behavior such as coin
> and sample have no ability to set a seed. The ability to set a seed will
> allow for reproducible and testable behavior as well as more control flow for
> random processes. If a certain backend does not support seeding, they could
> simply ignore it. Some possible API changes:
> graph.traversal.V().withSeed(2L).coin(.5)
> graph.traversal.V().sample(3, 0L)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)