[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-02 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on S2GRAPH-148:


Github user asfgit closed the pull request at:

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


> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-02 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on S2GRAPH-148:


Github user SteamShon commented on the issue:

https://github.com/apache/incubator-s2graph/pull/115
  
@daewon Thanks for the review and I commented out unnecessary global index 
on `S2GraphTest` as you suggest.


> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-02 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on S2GRAPH-148:


Github user daewon commented on the issue:

https://github.com/apache/incubator-s2graph/pull/115
  
The test seems to be failing because it is affected by other tests in 
parallel.

In this case, it would be correct to modify the TC because the schema is 
changing at the same time.

There are three ways to fix this problem:

1. Initializing the cache before the test runs does not fail.

`` `Scala
  Test ("findGlobalIndex.") {
// (weight: 34) AND (weight: [1 TO 100])
GlobalIndex.listCache.invalidateAll ()
GlobalIndex.optionCache.invalidateAll ()
`` `

2. Delete the conflict test `S2GraphTest`. (This test does not perform the 
actual TC)

`` `Scala
Class S2GraphTest extends FunSuite with Matchers with TestCommonWithModels {
`` `

3. Prevent TC in s2core / build.sbt from running in parallel.
`` `
ParallelExecution in Test: = false
`` `

We will fix it in the second method.


> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-02 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on S2GRAPH-148:


Github user daewon commented on the issue:

https://github.com/apache/incubator-s2graph/pull/115
  
@SteamShon I found an error situation during my retest with my colleague.
`rm -rf var storage ; sbt 'project s2core' 'test-only *GlobalIndexTest*'`

In a clean environment, if the test fails with the above command, the first 
execution fails and the next execution succeeds.

```scala
  def findAll(elementType: String, useCache: Boolean = true)(implicit 
session: DBSession = AutoSession): Seq[GlobalIndex] = {
lazy val ls = sql"""select * from global_indices where element_type = 
$elementType""".map { rs => GlobalIndex(rs) }.list.apply
if (useCache) {
  listCache.withCache(s"findAll:elementType=$elementType") {
putsToCache(ls.map { globalIndex =>
  val cacheKey = 
s"elementType=${globalIndex.elementType}:indexName=${globalIndex.indexName}"
  cacheKey -> globalIndex
})
ls
  }
} else {
  ls
}
  }
```

The above method does not return `ls` in the `useCache` situation (`ls` is 
updated in the background thread)

```scala
`rm -rf var storage ; sbt 'project s2core' 'test-only *GlobalIndexTest*'`

클린한 환경에서 위 명령어로 테스트를 실패시 첫 실행은 실패하고 그 다음 실행은 성공을 한다.

```
  def findAll(elementType: String, useCache: Boolean = true)(implicit 
session: DBSession = AutoSession): Seq[GlobalIndex] = {
lazy val ls = sql"""select * from global_indices where element_type = 
$elementType""".map { rs => GlobalIndex(rs) }.list.apply
if (useCache) {
  listCache.withCache(s"findAll:elementType=$elementType") {
putsToCache(ls.map { globalIndex =>
  val cacheKey = 
s"elementType=${globalIndex.elementType}:indexName=${globalIndex.indexName}"
  cacheKey -> globalIndex
})
ls
  }
} else {
  ls
}
  }
```

위 메서드에서 보면 `useCache`인 상황에서 ls를 반환하지 않고 있다(ls는 백그라운드에서 업데이트 된다) 이 때문에 위 코드를 
아래처럼 수정하면 에러가 발생하지 않는다.

```
  def findAll(elementType: String, useCache: Boolean = true)(implicit 
session: DBSession = AutoSession): Seq[GlobalIndex] = {
lazy val ls = sql"""select * from global_indices where element_type = 
$elementType""".map { rs => GlobalIndex(rs) }.list.apply
if (useCache) {
  listCache.withCache(s"findAll:elementType=$elementType") {
putsToCache(ls.map { globalIndex =>
  val cacheKey = 
s"elementType=${globalIndex.elementType}:indexName=${globalIndex.indexName}"
  cacheKey -> globalIndex
})
ls
  }

  ls
} else {
  ls
}
  }
```

I changed the code to return `ls` as shown below and confirmed that it 
works without problems.
Please review the fixed code.


> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-02 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on S2GRAPH-148:


Github user daewon commented on the issue:

https://github.com/apache/incubator-s2graph/pull/115
  
+1 
It works well


> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-01 Thread Daewon Jeong (JIRA)

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

Daewon Jeong commented on S2GRAPH-148:
--

[https://github.com/SteamShon/incubator-s2graph/tree/S2GRAPH-148/s2graph_gremlin]

I tried running the tinkerpop query in the gremlin shell as described above.
It works well and I think it is very good news.

+1

> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (S2GRAPH-148) Provide Gremlin Plugin

2017-08-01 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on S2GRAPH-148:


GitHub user SteamShon opened a pull request:

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

[S2GRAPH-148]: Provide Gremlin Plugin

- add README.md.
- add examples on s2graph_gremlin.
- add java interface for build global index.
- add helper on Management.
- add S2GraphFactory.
- update build.sbt
- add s2graph_gremlin as subproject for gremlin plugin.
- upgrate sbt-assembly.

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

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

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

https://github.com/apache/incubator-s2graph/pull/115.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 #115


commit ea36edaed262736a41aa73ea75ffc11980a441f5
Author: DO YUNG YOON 
Date:   2017-08-01T09:42:41Z

- add README.md.
- add examples on s2graph_gremlin.
- add java interface for build global index.
- add helper on Management.
- add S2GraphFactory.
- update build.sbt
- add s2graph_gremlin as subproject for gremlin plugin.
- upgrate sbt-assembly.




> Provide Gremlin Plugin
> --
>
> Key: S2GRAPH-148
> URL: https://issues.apache.org/jira/browse/S2GRAPH-148
> Project: S2Graph
>  Issue Type: Sub-task
>Affects Versions: 0.2.0
>Reporter: DOYUNG YOON
>Assignee: DOYUNG YOON
>  Labels: features
> Fix For: 0.2.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Provide `S2GraphGremlinPlugin` that implement `GremlinPlugin` interface. 
> I think by providing such plugin, users can use S2Graph through Gremlin 
> Console and Gremlin Server.
> [Reference|http://tinkerpop.apache.org/docs/3.2.4/dev/provider/#gremlin-plugins]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)