kakao / s2graph

This code base is retained for historical interest only, please visit Apache Incubator Repo for latest one
https://github.com/apache/incubator-s2graph
Other
250 stars 32 forks source link

Example label script is something wrong from README.rd file. #59

Open suhyunjeon opened 9 years ago

suhyunjeon commented 9 years ago

This example is a wrong.

curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d '
{
    "label": "user_article_liked",
    "srcServiceName": "s2graph",
    "srcColumnName": "user_id",
    "srcColumnType": "long",
    "tgtServiceName": "s2graph_news",
    "tgtColumnName": "article_id",
    "tgtColumnType": "string",
    "indexProps": {}, 
    "props": {},
   "serviceName": "s2graph_news"
}
'

It can't run this, it shows me an error.

[error] application - java.lang.RuntimeException: target service s2graph_news is not created.
java.lang.RuntimeException: target service s2graph_news is not created.

Change the example like this. There is no s2graph_news service in a test/script. It is not that good example.

curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d '
{
    "label": "user_article_liked",
    "srcServiceName": "s2graph",
    "srcColumnName": "user_id",
    "srcColumnType": "long",
    "tgtServiceName": "s2graph",
    "tgtColumnName": "article_id",
    "tgtColumnType": "string",
    "indexProps": {}, 
    "props": {}
}
'

Result

{"message":"user_article_liked is created"}%
daewon commented 9 years ago

@suhyunjeon It's fixed, you can get updated document using develop branch.

suhyunjeon commented 9 years ago

I thought, This is better than that I wrote.

Added create s2graph_news service script in script/test.sh

# create <s2graph> service.
curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: Application/json' -d '
{"serviceName": "s2graph"}
'
# check service.
curl -XGET localhost:9000/graphs/getService/s2graph

# create <s2graph_news> service.
curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: Application/json' -d '
{"serviceName": "s2graph_news"}
'
# check service.
curl -XGET localhost:9000/graphs/getService/s2graph_news

Then it can be use original script to README.rd