Marko A. Rodriguez created TINKERPOP3-921:
---------------------------------------------
Summary: A backwards compatible solution to the bulk/sack situation
Key: TINKERPOP3-921
URL: https://issues.apache.org/jira/browse/TINKERPOP3-921
Project: TinkerPop 3
Issue Type: Improvement
Components: process
Affects Versions: 3.0.2-incubating
Reporter: Marko A. Rodriguez
Assignee: Marko A. Rodriguez
This ticket is more a proposal/brainstorm. I was thinking we should abandon the
concept of sack and bulk and simply have "Gremlin guts." :). Bare with me, its
backwards compatible... so its not as crazy as it sounds.
We should have an interface (where "Guts" is just a place holder for now):
{code}
public interface Guts<T extends Guts> {
public T merge(T other);
public T split();
}
{code}
What most people do is NO sack and a bulk that incrs a long with merge being
bulk sums. This would be the "Gremlin guts" of:
{code}
public BulkGuts implements Guts<BulkGuts> {
public BulkGuts merge(BulkGuts other) {
this.bulk = this.bulk + other.bulk;
}
public BulkGuts split() {
return new BulkGuts(this.bulk);
}
}
{code}
Now, whenever a Gremlin splits/mergers, its guts are respectively split and
merged. You want sacks without bulk, well, you have a Gut that does real
numbers... no such thing as bulk.
This makes it so the concept of "bulk" and "sack" are NOT part of
{{Traverser}}, but are accessible via:
{code}
public interface Traverser<T extends Guts> {
T getGuts();
}
{code}
.... This isn't fully thought out, but by 3.2.0, when we release the full
virtual machine specification, this may come into play.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)