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

provide missing information on result of getLabel, getService #118

Closed SteamShon closed 9 years ago

SteamShon commented 9 years ago

getService, getLabel API do not return all information in DB.

SteamShon commented 9 years ago

response from getService

{
  "id": 1,
  "name": "s2graph",
  "accessToken": "s2graph",
  "hbaseTableName": "s2graph-alpha",
  "preSplitSize": 2,
  "hTableTTL": null
}

in this case hbase cluster zookeeper address field is missing.

response from getLabel

{
  "labelName": "graph_test",
  "from": {
    "serviceName": "s2graph-test",
    "columnName": "user_id",
    "columnType": "long"
  },
  "to": {
    "serviceName": "s2graph-test",
    "columnName": "item_id",
    "columnType": "string"
  },
  "defaultIndex": {
    "name": "_PK",
    "propNames": [
      "time",
      "weight"
    ]
  },
  "extraIndex": [
    {
      "name": "IDX_1",
      "propNames": [
        "score"
      ]
    }
  ],
  "metaProps": [
    {
      "name": "_timestamp",
      "defaultValue": "0",
      "dataType": "long"
    },
    {
      "name": "_count",
      "defaultValue": "-1",
      "dataType": "long"
    },
    {
      "name": "time",
      "defaultValue": "0",
      "dataType": "integer"
    },
    {
      "name": "weight",
      "defaultValue": "0.0",
      "dataType": "float"
    },
    {
      "name": "is_hidden",
      "defaultValue": "false",
      "dataType": "boolean"
    },
    {
      "name": "is_blocked",
      "defaultValue": "false",
      "dataType": "boolean"
    },
    {
      "name": "score",
      "defaultValue": "0",
      "dataType": "float"
    }
  ]
}

in this case, serviceName, consistencLevel, hbaseTableName, isAsync, hbaseTableTTL, schemaVersion, CompressionAlgorithm fields are missing.

SteamShon commented 9 years ago

now getService result contains cluster. also changed json key from hbaseTableName to hTableName.

{
  "id": 104,
  "name": "_test_service",
  "accessToken": null,
  "cluster": "localhost",
  "hTableName": "_test_cases",
  "preSplitSize": 0,
  "hTableTTL": null
}

and getLabel result contains missing fields. also remove reserved metaProps _count in result.

{
  "labelName": "graph_test",
  "from": {
    "serviceName": "s2graph-test",
    "columnName": "user_id",
    "columnType": "long"
  },
  "to": {
    "serviceName": "s2graph-test",
    "columnName": "item_id",
    "columnType": "string"
  },
  "isDirected": true,
  "serviceName": "s2graph-test",
  "consistencyLevel": "strong",
  "schemaVersion": "v2",
  "isAsync": false,
  "compressionAlgorithm": "lz4",
  "defaultIndex": {
    "name": "_PK",
    "propNames": [
      "time",
      "weight"
    ]
  },
  "extraIndex": [
    {
      "name": "IDX_1",
      "propNames": [
        "score"
      ]
    }
  ],
  "metaProps": [
    {
      "name": "time",
      "defaultValue": "0",
      "dataType": "integer"
    },
    {
      "name": "weight",
      "defaultValue": "0.0",
      "dataType": "float"
    },
    {
      "name": "is_hidden",
      "defaultValue": "false",
      "dataType": "boolean"
    },
    {
      "name": "is_blocked",
      "defaultValue": "false",
      "dataType": "boolean"
    },
    {
      "name": "score",
      "defaultValue": "0",
      "dataType": "float"
    }
  ]
}