You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@s2graph.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/15 18:24:58 UTC

[jira] [Commented] (S2GRAPH-122) Change data types of Edge/IndexEdge/SnapshotEdge.

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

ASF GitHub Bot commented on S2GRAPH-122:
----------------------------------------

GitHub user SteamShon opened a pull request:

    https://github.com/apache/incubator-s2graph/pull/97

    [S2GRAPH-122]: Change data types of Edge/IndexEdge/SnapshotEdge.

    + Change props data type on Edge/IndexEdge/SnapshotEdge.
    + Separate LabelWithDirection.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/SteamShon/incubator-s2graph S2GRAPH-122

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-s2graph/pull/97.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #97
    
----
commit 4454188dce5c2044a919f42f373722f3eade79cf
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-14T17:53:59Z

    [S2GRAPH-121]: Create `Result` class to hold traverse result edges.
    - add StepResult to abstract traversal result.
    - change GroupBy, OrderBy, FilterOut logic from PostProcess and refactor PostProcess to only perform formatting.

commit 2fbb6aad19b10e6f95369eb41670d795609f7c6c
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T09:14:51Z

    start work on QueryParam.

commit 6ecf6ba7fb6aecf4b1ebaec76348da8483b8e876
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T09:20:08Z

    start working on Edge.

commit dd784afbaa32bece93d9ac998dd09a42564d3226
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T09:41:57Z

    change LabelWithDirection on Edge.

commit 9ec3cf753e2d54b02f4cbe53a774a4ba01a59f11
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T09:43:21Z

    start working on serde.

commit fc53f1fdf6a6aa875222e6d582466364ef5bb534
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T09:51:13Z

    fix compile error on QueryParam, QueryResult.

commit c025d000fa5730cf44d43ea74e5488b5038ef812
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T09:54:56Z

    fix compile error on PostProcess.

commit 5dd6727dc25fd05a72eb2db3583833355b62bb90
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T10:07:28Z

    RequestParser.

commit a400acbddccd9ce74d0fe66ddd183f6fde0bf410
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T10:10:32Z

    temp.

commit 8110a46f879bc366d35ffa43c11fadb41d541702
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T10:42:41Z

    now RequestParser compiles.

commit f8ab08e6b13e0f54cad384962b51a6fc5dc9acd0
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T10:49:14Z

    start compile on Management.

commit 0d0b9f6012134e629099ce528c18fc1e94dfa5ba
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T10:57:18Z

    update utils.

commit c61289ccf6dbce9737d8c8d15db6c211e00c63e8
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T10:58:24Z

    update types package.

commit 47bada835af401dbfd2299686f44d73e963ff3ef
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T11:08:41Z

    fix compile error on Storage.scala.

commit 56c3d6d81c18060b475b78d30c934c1a3db69930
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T11:21:57Z

    almost done with AsynchbaseStorage.

commit e7e72fc69add680adb2263c63c613170e7236fec
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T11:25:01Z

    fix compile error on QueryParam.

commit 8db14f1627f04c3a99055fc2f1666c10008f9b9a
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T11:29:33Z

    fixed compile erros on s2core/src.

commit 4a5e46bda9fc5f4b8707d516a342d1105c292830
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T11:45:09Z

    fix compile error on Graph.

commit a09fbe924e08cb120c808822734630c48eea75d7
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T11:51:05Z

    all s2core/src compiles except Vertex serde.

commit 275b84021b401b719a6cbc61739b2aa2aada3007
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T12:11:12Z

    s2core/src all compiled!

commit 3ca83c4c8f3f256b2ed93278e43a45d8f4ec6752
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T12:14:42Z

    fix compile error on s2rest_play.

commit 78af7dc7699225c1f464b83ca198b93baa0bb7d0
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T14:48:20Z

    fix compile errors on test.

commit a610d3159b795e72b4f5a9a1fe6bf4d8f0f98b3f
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T16:28:11Z

    update etcs.

commit 7b69a51102276d188a4c766edaa6c57ed00dba06
Author: DO YUNG YOON <st...@apache.org>
Date:   2016-11-15T16:43:24Z

    update QueryTest.

----


> Change data types of Edge/IndexEdge/SnapshotEdge.
> -------------------------------------------------
>
>                 Key: S2GRAPH-122
>                 URL: https://issues.apache.org/jira/browse/S2GRAPH-122
>             Project: S2Graph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: DOYUNG YOON
>            Assignee: DOYUNG YOON
>            Priority: Minor
>              Labels: performance
>             Fix For: 0.2.0
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Currently Edge have following interface.
> {noformat}
> case class Edge(srcVertex: Vertex,
>                 tgtVertex: Vertex,
>                 labelWithDir: LabelWithDirection,
>                 op: Byte = GraphUtil.defaultOpByte,
>                 version: Long = System.currentTimeMillis(),
>                 propsWithTs: Map[Byte, InnerValLikeWithTs],
>                 parentEdges: Seq[EdgeWithScore] = Nil,
>                 originalEdgeOpt: Option[Edge] = None,
>                 pendingEdgeOpt: Option[Edge] = None,
>                 statusCode: Byte = 0,
>                 lockTs: Option[Long] = None)
> case class IndexEdge(srcVertex: Vertex,
>                      tgtVertex: Vertex,
>                      labelWithDir: LabelWithDirection,
>                      op: Byte,
>                      version: Long,
>                      labelIndexSeq: Byte,
>                      props: Map[Byte, InnerValLikeWithTs])
> case class SnapshotEdge(srcVertex: Vertex,
>                         tgtVertex: Vertex,
>                         labelWithDir: LabelWithDirection,
>                         op: Byte,
>                         version: Long,
>                         props: Map[Byte, InnerValLikeWithTs],
>                         pendingEdgeOpt: Option[Edge],
>                         statusCode: Byte = 0,
>                         lockTs: Option[Long]) 
> {noformat}
> Following is my suggestion.
> 1. I think there is no reason to use `LabelWithDirection` which only have labelId and direction. Instead we can actually change it to hold `Label` which contains lots of other meta data(ex: write options which decide this edge need to store reverse direction or not). Because of using `LabelWithDirection`, there are lots of duplicate code to lookup to get `Label` instance from `LabelWithDirection`. Even though we are using local cache, It would be better if we can remove unnecessary lookup cost. I think storing `Label` is also good because we can remove lots of duplicate code which find `Label` instance from LabelWithDirection.
> 2. When we deserialize, we first deserialize `SKeyValue` into `IndexEdge`, then call `toEdge` to convert `IndexEdge` to `Edge`. when we convert, there is unnecessary data copy because `IndexEdge` and `Edge` has different data type for props value. 
> {noformat}
> props.map { case (k, v) => k -> InnerValLikeWithTs(v, version) } 
> {noformat}
> This will be called per each edge that fetched from storage, so we should avoid unnecessary iteration of properties. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)