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

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

GitHub user elric-k opened a pull request:

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

    [S2GRAPH-205] reuse S2Graph object on same executor

    I replaced S2GraphHeler.initS2graph method to getS2Graph that reuse created 
an S2Graph object

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

    $ git pull https://github.com/elric-k/incubator-s2graph S2GRAPH-205

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

    https://github.com/apache/incubator-s2graph/pull/158.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 #158
    
----
commit 6da382b9dfee810df0f51270d7c03f62e72b1874
Author: Chul Kang <elric@...>
Date:   2018-04-18T07:37:25Z

    reuse s2graph object

commit de3f2aa4130efb96caa6435e18c0d109e7cc29a1
Author: Chul Kang <elric@...>
Date:   2018-04-18T07:38:36Z

    fix wrong method reference

----


> too many initialize S2Graph when writeBatchMutate on S2GraphSink
> ----------------------------------------------------------------
>
>                 Key: S2GRAPH-205
>                 URL: https://issues.apache.org/jira/browse/S2GRAPH-205
>             Project: S2Graph
>          Issue Type: Sub-task
>          Components: s2jobs
>            Reporter: Chul Kang
>            Assignee: Chul Kang
>            Priority: Minor
>
> When call the function S2GraphHelper.initS2Graph() , S2Graph is initialized 
> every time.
> It causes initialize the Model class, so many connections can be created to 
> DB.
> In especially, when you call writeBatchWithMutate on the S2graphSink class, 
> the following code initializes S2Graph for each task.
> {code:java}
> df.foreachPartition { iters =>
>   val config = ConfigFactory.parseString(serializedConfig)
>   val s2Graph = S2GraphHelper.initS2Graph(config)
>   ...
> }
> {code}
>  
> I think it would be better if we can re-use S2Graph instance on the same 
> executor.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to