[ https://issues.apache.org/jira/browse/TINKERPOP3-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marko A. Rodriguez closed TINKERPOP3-896. ----------------------------------------- Resolution: Won't Fix I don't think we should do this. The {{initialValue}} is the "identity" of the sack algebra. It is necessary to ensure no "null pointer exceptions." > Simplify the {{withSack}} methods of {{GraphTraversalSource}}. > -------------------------------------------------------------- > > Key: TINKERPOP3-896 > URL: https://issues.apache.org/jira/browse/TINKERPOP3-896 > Project: TinkerPop 3 > Issue Type: Improvement > Components: process > Affects Versions: 3.0.2-incubating > Reporter: Marko A. Rodriguez > Assignee: Marko A. Rodriguez > Labels: breaking > Fix For: 3.1.0-incubating > > > We currently have these method: > {code} > withSack(initialValue,splitOperator,mergeOperator) > {code} > I messed this up. It should be: > {code} > withSack(splitOperator,mergeOperator) > {code} > Why? Because we use {{new Traverser()}} at other points in the code besides > just with the {{TraverserGenerators}} (e.g. reducing barriers). Dah! The way > this should be done is: > {code} > g.withSack(splitOperator,mergeOperator).V().sack(1.0).... > {code} > This way, the user defines the sack value at the traversal level, not at the > construction level and thus, any other constructions of a traverser don't > have a sack value. > The other option is to simply say: > "Make sure your initial sack value is the identity in the set (given the > merge operator)" > Where you will do: > {code} > g.withSack(0,sum).V().sack(1).blah.blah > {code} > This ensures that EVERY traverser in the computation has a sack value, but > that if a traverser is created later in computation, its sack value is the > identity. With that, we should change the term "initial value" to "identity > value" so people understand the consequence of the logic. -- This message was sent by Atlassian JIRA (v6.3.4#6332)