[jira] [Commented] (S2GRAPH-12) Add Label Name Swap Feature
[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15484383#comment-15484383 ] ASF GitHub Bot commented on S2GRAPH-12: --- Github user asfgit closed the pull request at: https://github.com/apache/incubator-s2graph/pull/79 > Add Label Name Swap Feature > --- > > Key: S2GRAPH-12 > URL: https://issues.apache.org/jira/browse/S2GRAPH-12 > Project: S2Graph > Issue Type: New Feature >Reporter: Hyunsung Jo >Assignee: DOYUNG YOON > Labels: feature > Fix For: 0.1.0 > > > Operating live services on S2Graph, there are a few cases where interchanging > two label names could come in handy. > For example, assume that a social graph is being served under the label name > _A_, and an updated graph has been loaded to _A'_. > It would be nice if one can refer to the updated data of _A'_ while still > making requests to the same label name _A_ so that no client-side code change > is required. > Obviously, this feature should have transaction support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (S2GRAPH-12) Add Label Name Swap Feature
[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15484361#comment-15484361 ] ASF GitHub Bot commented on S2GRAPH-12: --- Github user SteamShon commented on the issue: https://github.com/apache/incubator-s2graph/pull/79 @HyunsungJo one minor note. `var/metastore.mv.db` file should be not added into git, since it is metastorage for your local environment. I am going to remove this while I am merge this PR. > Add Label Name Swap Feature > --- > > Key: S2GRAPH-12 > URL: https://issues.apache.org/jira/browse/S2GRAPH-12 > Project: S2Graph > Issue Type: New Feature >Reporter: Hyunsung Jo >Assignee: DOYUNG YOON > Labels: feature > Fix For: 0.1.0 > > > Operating live services on S2Graph, there are a few cases where interchanging > two label names could come in handy. > For example, assume that a social graph is being served under the label name > _A_, and an updated graph has been loaded to _A'_. > It would be nice if one can refer to the updated data of _A'_ while still > making requests to the same label name _A_ so that no client-side code change > is required. > Obviously, this feature should have transaction support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (S2GRAPH-12) Add Label Name Swap Feature
[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15484344#comment-15484344 ] ASF GitHub Bot commented on S2GRAPH-12: --- Github user SteamShon commented on the issue: https://github.com/apache/incubator-s2graph/pull/79 @HyunsungJo PR looks good to me. if there is no other comment, then I will merge this for version 0.1.0. Thanks for contributing! > Add Label Name Swap Feature > --- > > Key: S2GRAPH-12 > URL: https://issues.apache.org/jira/browse/S2GRAPH-12 > Project: S2Graph > Issue Type: New Feature >Reporter: Hyunsung Jo > Labels: feature > > Operating live services on S2Graph, there are a few cases where interchanging > two label names could come in handy. > For example, assume that a social graph is being served under the label name > _A_, and an updated graph has been loaded to _A'_. > It would be nice if one can refer to the updated data of _A'_ while still > making requests to the same label name _A_ so that no client-side code change > is required. > Obviously, this feature should have transaction support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (S2GRAPH-12) Add Label Name Swap Feature
[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15484341#comment-15484341 ] ASF GitHub Bot commented on S2GRAPH-12: --- Github user SteamShon commented on a diff in the pull request: https://github.com/apache/incubator-s2graph/pull/79#discussion_r78388184 --- Diff: s2core/src/main/scala/org/apache/s2graph/core/Management.scala --- @@ -270,22 +270,35 @@ object Management extends JSONParser { props } - /** * update label name. */ def updateLabelName(oldLabelName: String, newLabelName: String) = { -for { - old <- Label.findByName(oldLabelName) -} { - Label.findByName(newLabelName) match { -case None => - Label.updateName(oldLabelName, newLabelName) -case Some(_) => -// throw new RuntimeException(s"$newLabelName already exist") +Model withTx { implicit session => --- End diff -- for using Transaction. > Add Label Name Swap Feature > --- > > Key: S2GRAPH-12 > URL: https://issues.apache.org/jira/browse/S2GRAPH-12 > Project: S2Graph > Issue Type: New Feature >Reporter: Hyunsung Jo > Labels: feature > > Operating live services on S2Graph, there are a few cases where interchanging > two label names could come in handy. > For example, assume that a social graph is being served under the label name > _A_, and an updated graph has been loaded to _A'_. > It would be nice if one can refer to the updated data of _A'_ while still > making requests to the same label name _A_ so that no client-side code change > is required. > Obviously, this feature should have transaction support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (S2GRAPH-12) Add Label Name Swap Feature
[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15483827#comment-15483827 ] ASF GitHub Bot commented on S2GRAPH-12: --- GitHub user HyunsungJo opened a pull request: https://github.com/apache/incubator-s2graph/pull/79 [S2GRAPH-12] Add Label Name Swap Feature - add route and functions for label name swap - updateLabelName to support transactions - add test cases - minor error message changes You can merge this pull request into a Git repository by running: $ git pull https://github.com/HyunsungJo/incubator-s2graph S2GRAPH-12 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-s2graph/pull/79.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 #79 commit 76348704f898fe13e624452ac590738e8868091d Author: jojoDate: 2016-09-12T09:24:05Z [S2GRAPH-12] Add Label Name Swap Feature - add route and functions for label name swap - add test cases - minor error message changes > Add Label Name Swap Feature > --- > > Key: S2GRAPH-12 > URL: https://issues.apache.org/jira/browse/S2GRAPH-12 > Project: S2Graph > Issue Type: New Feature >Reporter: Hyunsung Jo > Labels: feature > > Operating live services on S2Graph, there are a few cases where interchanging > two label names could come in handy. > For example, assume that a social graph is being served under the label name > _A_, and an updated graph has been loaded to _A'_. > It would be nice if one can refer to the updated data of _A'_ while still > making requests to the same label name _A_ so that no client-side code change > is required. > Obviously, this feature should have transaction support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (S2GRAPH-12) Add Label Name Swap Feature
[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15159926#comment-15159926 ] Hyunsung Jo commented on S2GRAPH-12: *Create service* {noformat} curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: Application/json' -d ' {"serviceName": "KakaoFavorites", "compressionAlgorithm" : "gz", "hTableName": "KakaoFavorites-dev"} ' curl -XGET localhost:9000/graphs/getService/KakaoFavorites {noformat} *Create label* {noformat} curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d ' { "label": "friends_old", "srcServiceName": "KakaoFavorites", "srcColumnName": "userName", "srcColumnType": "string", "tgtServiceName": "KakaoFavorites", "tgtColumnName": "userName", "tgtColumnType": "string", "isDirected": "false", "indices": [], "props": [] } ' {noformat} *Insert data to label* {noformat} curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d ' {"from":"Cookie Monster","to":"Oscar","label":"friends_old","props":{},"timestamp":1} ' {noformat} *Create new label* {noformat} curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d ' { "label": "friends_new", "srcServiceName": "KakaoFavorites", "srcColumnName": "userName", "srcColumnType": "string", "tgtServiceName": "KakaoFavorites", "tgtColumnName": "userName", "tgtColumnType": "string", "isDirected": "false", "indices": [], "props": [] } ' {noformat} *Insert data to new label* {noformat} curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d ' {"from":"Cookie Monster","to":"Elmo","label":"friends","props":{},"timestamp":2} ' {noformat} *Swap labels (This API is what we're trying to implement!)* {noformat} curl -XPOST localhost:9000/admin/swapLabel/friends_old/friends_new {noformat} *Access the new data "Cookie Monster - Elmo" from the original label* {noformat} curl -XPOST localhost:9000/graphs/checkEdges -H 'Content-Type: Application/json' -d ' [ {"label": "friends_old", "direction": "out", "from": "Cookie Monster", "to": "Oscar"} ] ' {noformat} > Add Label Name Swap Feature > --- > > Key: S2GRAPH-12 > URL: https://issues.apache.org/jira/browse/S2GRAPH-12 > Project: S2Graph > Issue Type: New Feature >Reporter: Hyunsung Jo > Labels: feature > > Operating live services on S2Graph, there are a few cases where interchanging > two label names could come in handy. > For example, assume that a social graph is being served under the label name > _A_, and an updated graph has been loaded to _A'_. > It would be nice if one can refer to the updated data of _A'_ while still > making requests to the same label name _A_ so that no client-side code change > is required. > Obviously, this feature should have transaction support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)