[ https://issues.apache.org/jira/browse/S2GRAPH-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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)