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

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

Github user SteamShon commented on a diff in the pull request:

    https://github.com/apache/incubator-s2graph/pull/34#discussion_r54368864
  
    --- Diff: 
s2core/src/main/scala/com/kakao/s2graph/core/rest/RequestParser.scala ---
    @@ -432,31 +429,39 @@ class RequestParser(config: Config) extends 
JSONParser {
     
       def toEdgesWithOrg(jsValue: JsValue, operation: String): (List[Edge], 
List[JsValue]) = {
         val jsValues = toJsValues(jsValue)
    -    val edges = jsValues.map(toEdge(_, operation))
    +    val edges = jsValues.flatMap(toEdge(_, operation))
     
         (edges, jsValues)
       }
     
       def toEdges(jsValue: JsValue, operation: String): List[Edge] = {
    -    toJsValues(jsValue).map(toEdge(_, operation))
    +    toJsValues(jsValue).flatMap { edgeJson =>
    +      toEdge(edgeJson, operation)
    +    }
       }
     
    -  def toEdge(jsValue: JsValue, operation: String) = {
     
    -    val srcId = parse[JsValue](jsValue, "from") match {
    -      case s: JsString => s.as[String]
    -      case o@_ => s"${o}"
    -    }
    -    val tgtId = parse[JsValue](jsValue, "to") match {
    +  private def toEdge(jsValue: JsValue, operation: String): List[Edge] = {
    --- End diff --
    
    change toEdge return multiple edges.


> Remove unnecessary abstraction layer, Storage.
> ----------------------------------------------
>
>                 Key: S2GRAPH-17
>                 URL: https://issues.apache.org/jira/browse/S2GRAPH-17
>             Project: S2Graph
>          Issue Type: Task
>            Reporter: DOYUNG YOON
>            Assignee: DOYUNG YOON
>              Labels: client, refactoring
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Currently Graph contains following components.
> Graph has storage and each storage have followings.
> # SerDe: serialize and deserialize IndexEdge/SnapshotEdge/Vertex into bytes.
> # MutationBuilder: convert IndexEdge/SnapshotEdge into RPC which is dependent 
> on storage backend. 
> # QueryBuilder: issue RPC for fetch on storage backend
> With these components, storage know how to actually store/fetch 
> IndexEdge/SnapshotEdge/Vertex to, from storage backend.
> In my opinion, storage layer is unnecessary since all graph instance does is 
> delegating into storage. I am suggesting to remove storage layer and use 
> different Graph class for different storage backend.
> So for example, change AsynchbaseStorage into AsynchbaseGraph.
> I want to discuss how our Graph Client should be on this issue and change it 
> according to discussion.



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

Reply via email to