[
https://issues.apache.org/jira/browse/S2GRAPH-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703680#comment-15703680
]
DOYUNG YOON commented on S2GRAPH-131:
-------------------------------------
I want to suggest on following issue.
Because of using user provided id as internal vertex id and edge's row key
consist of this internal vertex id, it is possible to fetch edges from some
start vertices without fetching actual vertices. S2Graph can create vertex on
memory, then use it's id as row key for edges from given vertex.
For example consider user want to find out all adjacent edges for "testLabel"
label from vertex with service = "s", column = "user", id = 10.
{noformat}
g.traversal().V(g.newVertexId("s", "user", 10)).out("testLabel")
{noformat}
we can return adjacent edges by running above traversal, but internally, it
first call S2Graph#vertices which currently fetch vertex from storage. This is
expensive since there is IO operation between s2graph and storage engine. The
nice part about supporting user provided id is that user can access adjacent
edges without fetching start vertex. s2graph already know what is row key of
edges we are looking for and fire get or scan operation on storage based on
storage schema.
I am suggesting below to provide flag to skip fetching vertex from storage if
user only need start vertices as starting point to get adjacent edges.
{noformat}
g.traversal().V(g.newVertexId("s", "user", 10), false).out("testLabel")
{noformat}
I think using explicitly different name on DSL make more sense, but I am not
sure how to extends standard gremlin DSL, so my suggestion might looks odd at
this point.
Lastly, I am not sure about default value for fetchVertices. The default value
for fetchVertices has been false in S2Graph. It make huge difference on
traversal performance, so I think the default should be skip the actual
fetching vertices from storage, but downside of this is making users from other
system confused.
> Add actual implementation on interfaces from TinkerPop3 structure package.
> --------------------------------------------------------------------------
>
> Key: S2GRAPH-131
> URL: https://issues.apache.org/jira/browse/S2GRAPH-131
> Project: S2Graph
> Issue Type: Sub-task
> Affects Versions: 0.2.0
> Reporter: DOYUNG YOON
> Assignee: DOYUNG YOON
> Fix For: 0.2.0
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Based on changes from S2GRAPH-129, S2GRAPH-130, it's easy to implement
> tinkerpop3's structure interfaces directly.
> This issue is about change our previous core entity {{Edge/Vertex/Graph}}
> into {{S2Edge/S2Vertex/S2Graph}}.
> I suggest to focus on naive implementation first on this issue, then improve
> tp3 integration while we discuss.
> Of course test cases, documentations should be followed up.
> I suggest to create more subtask under S2GRAPH-72, so we can track them
> easily.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)