{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/42961073","id":42961073,"diff_hunk":"@@ -14,81 +14,559 @@\n package meta\n \n import (\n+\t\"encoding/binary\"\n+\t\"encoding/json\"\n \t\"fmt\"\n+\t\"strconv\"\n+\t\"strings\"\n \t\"sync\"\n \n \t\"github.com/juju/errors\"\n-\t\"github.com/ngaut/log\"\n \t\"github.com/pingcap/tidb/kv\"\n+\t\"github.com/pingcap/tidb/model\"\n+\t\"github.com/pingcap/tidb/structure\"\n )\n \n var (\n-\t// SchemaMetaPrefix is the prefix for database meta key prefix.\n-\tSchemaMetaPrefix = string(MakeMetaKey(\"mDB:\"))\n-\n-\t// TableMetaPrefix is the prefix for table meta key prefix.\n-\tTableMetaPrefix = MakeMetaKey(\"mTable:\")\n+\tglobalIDMutex sync.Mutex\n+)\n \n-\t// SchemaMetaVersionKey is used as lock for changing schema\n-\tSchemaMetaVersionKey = MakeMetaKey(\"mSchemaVersion\")\n+// Meta structure:\n+//\tmNextGlobalID -> int64\n+//\tmSchemaVersion -> int64\n+//\tmDBs -> {\n+//\t\tmDB:1 -> db meta data []byte\n+//\t\tmDB:2 -> db meta data []byte\n+//\t}\n+//\tmDB:1 -> {\n+//\t\tmTable:1 -> table meta data []byte\n+//\t\tmTable:2 -> table meta data []byte\n+//\t\tmTID:1 -> int64\n+//\t\tmTID:2 -> int64\n+//\t}\n+//\n \n-\t// globalIDPrefix is used as key of global ID\n-\tglobalIDKey = MakeMetaKey(\"mNextGlobalID\")\n+var (\n+\tmNextGlobalIDKey  = []byte(\"mNextGlobalID\")\n+\tmSchemaVersionKey = []byte(\"mSchemaVersionKey\")\n+\tmDBs              = []byte(\"mDBs\")\n+\tmDBPrefix         = \"mDB\"\n+\tmTablePrefix      = \"mTable\"\n+\tmTableIDPrefix    = \"mTID\"\n )\n \n var (\n-\tglobalIDMutex sync.Mutex\n+\t// ErrDBExists is the error for db exists.\n+\tErrDBExists = errors.New(\"database already exists\")\n+\t// ErrDBNotExists is the error for db not exists\n+\tErrDBNotExists = errors.New(\"database doesn't exist\")\n+\t// ErrTableExists is the error for table exists\n+\tErrTableExists = errors.New(\"table already exists\")\n+\t// ErrTableNotExists is the error for table not exists\n+\tErrTableNotExists = errors.New(\"table doesn't exist\")\n )\n \n-// MakeMetaKey creates meta key\n-func MakeMetaKey(key string) []byte {\n-\treturn append([]byte{0x0}, key...)\n+// Meta is the structure saving meta information.\n+type Meta struct {\n+\tstore *structure.TStore\n+}\n+\n+// TMeta is for handling meta information in a transaction.\n+type TMeta struct {\n+\ttxn *structure.TxStructure\n+}\n+\n+// NewMeta creates a Meta with kv storage.\n+func NewMeta(store kv.Storage) *Meta {\n+\tm := &Meta{}\n+\n+\tm.store = structure.NewStore(store, []byte{0x00})\n+\n+\treturn m\n+}\n+\n+// Begin creates a TMeta object and you can handle meta information in a transaction.\n+func (m *Meta) Begin() (*TMeta, error) {\n+\ttxn := &TMeta{}\n+\n+\tvar err error\n+\ttxn.txn, err = m.store.Begin()\n+\tif err != nil {\n+\t\treturn nil, errors.Trace(err)\n+\t}\n+\treturn txn, nil\n+}\n+\n+// RunInNewTxn runs fn in a new transaction.\n+func (m *Meta) RunInNewTxn(retryable bool, f func(t *TMeta) error) error {\n+\tfn := func(txn *structure.TxStructure) error {\n+\t\tt := &TMeta{txn: txn}\n+\t\treturn errors.Trace(f(t))\n+\t}\n+\n+\terr := m.store.RunInNewTxn(retryable, fn)\n+\treturn errors.Trace(err)\n+}\n+\n+// GenGlobalID generates next id globally.\n+func (m *Meta) GenGlobalID() (int64, error) {\n+\tvar (\n+\t\tid  int64\n+\t\terr error\n+\t)\n+\n+\terr1 := m.RunInNewTxn(true, func(t *TMeta) error {\n+\t\tid, err = t.GenGlobalID()\n+\t\treturn errors.Trace(err)\n+\t})\n+\n+\treturn id, errors.Trace(err1)\n }\n \n-// GenID adds step to the value for key and returns the sum.\n-func GenID(txn kv.Transaction, key []byte, step int) (int64, error) {\n-\tif len(key) == 0 {\n-\t\treturn 0, errors.New(\"Invalid key\")\n+// GenGlobalID generates next id globally.\n+func (m *TMeta) GenGlobalID() (int64, error) {\n+\tglobalIDMutex.Lock()\n+\tdefer globalIDMutex.Unlock()\n+\n+\treturn m.txn.Inc(mNextGlobalIDKey, 1)\n+}\n+\n+// GetGlobalID gets current global id.\n+func (m *TMeta) GetGlobalID() (int64, error) {\n+\treturn m.txn.GetInt64(mNextGlobalIDKey)\n+}\n+\n+func (m *TMeta) dbKey(dbID int64) []byte {\n+\treturn []byte(fmt.Sprintf(\"%s:%d\", mDBPrefix, dbID))\n+}\n+\n+func (m *TMeta) parseDatabaseID(key string) (int64, error) {\n+\tseps := strings.Split(key, \":\")\n+\tif len(seps) != 2 {\n+\t\treturn 0, errors.Errorf(\"invalid db key %s\", key)\n \t}\n-\terr := txn.LockKeys(key)\n+\n+\tn, err := strconv.ParseInt(seps[1], 10, 64)\n+\treturn n, errors.Trace(err)\n+}\n+\n+func (m *TMeta) autoTalbeIDKey(tableID int64) []byte {\n+\treturn []byte(fmt.Sprintf(\"%s:%d\", mTableIDPrefix, tableID))\n+}\n+\n+func (m *TMeta) tableKey(tableID int64) []byte {\n+\treturn []byte(fmt.Sprintf(\"%s:%d\", mTablePrefix, tableID))\n+}\n+\n+func (m *TMeta) parseTableID(key string) (int64, error) {\n+\tseps := strings.Split(key, \":\")\n+\tif len(seps) != 2 {\n+\t\treturn 0, errors.Errorf(\"invalid db meta key %s\", key)\n+\t}\n+\n+\tn, err := strconv.ParseInt(seps[1], 10, 64)\n+\treturn n, errors.Trace(err)\n+}\n+\n+// GenAutoTableID adds step to the auto id of the table and returns the sum.\n+func (m *TMeta) GenAutoTableID(dbID int64, tableID int64, step int64) (int64, error) {\n+\t// check db exists\n+\tdbKey := m.dbKey(dbID)\n+\tif err := m.checkDBExists(dbKey); err != nil {\n+\t\treturn 0, errors.Trace(err)\n+\t}\n+\n+\t// check table exists\n+\ttableKey := m.tableKey(tableID)\n+\tif err := m.checkTableExists(dbKey, tableKey); err != nil {\n+\t\treturn 0, errors.Trace(err)\n+\t}\n+\n+\treturn m.txn.HInc(dbKey, m.autoTalbeIDKey(tableID), step)\n+}\n+\n+// GetAutoTableID gets current auto id with table id.\n+func (m *TMeta) GetAutoTableID(dbID int64, tableID int64) (int64, error) {\n+\treturn m.txn.HGetInt64(m.dbKey(dbID), m.autoTalbeIDKey(tableID))\n+}\n+\n+// GetSchemaVersion gets current global schema version.\n+func (m *TMeta) GetSchemaVersion() (int64, error) {\n+\treturn m.txn.GetInt64(mSchemaVersionKey)\n+}\n+\n+// GenSchemaVersion generates next schema version.\n+func (m *TMeta) GenSchemaVersion() (int64, error) {\n+\treturn m.txn.Inc(mSchemaVersionKey, 1)\n+}\n+\n+func (m *TMeta) checkDBExists(dbKey []byte) error {\n+\tv, err := m.txn.HGet(mDBs, dbKey)\n \tif err != nil {\n-\t\treturn 0, err\n+\t\treturn err\n+\t} else if v == nil {\n+\t\treturn ErrDBNotExists\n \t}\n-\tid, err := txn.Inc(key, int64(step))\n+\n+\treturn nil\n+}\n+\n+func (m *TMeta) checkDBNotExists(dbKey []byte) error {\n+\tv, err := m.txn.HGet(mDBs, dbKey)\n \tif err != nil {\n-\t\treturn 0, errors.Trace(err)\n+\t\treturn err\n+\t} else if v != nil {\n+\t\treturn ErrDBExists\n \t}\n \n-\treturn id, errors.Trace(err)\n+\treturn nil\n }\n \n-// DBMetaKey generates database meta key according to databaseID.\n-func DBMetaKey(databaseID int64) string {\n-\treturn fmt.Sprintf(\"%s:%d\", SchemaMetaPrefix, databaseID)\n+func (m *TMeta) checkTableExists(dbKey []byte, tableKey []byte) error {\n+\tv, err := m.txn.HGet(dbKey, tableKey)\n+\tif err != nil {\n+\t\treturn err\n+\t} else if v == nil {\n+\t\treturn ErrTableNotExists\n+\t}\n+\n+\treturn nil\n }\n \n-// AutoIDKey generates table autoID meta key according to tableID.\n-func AutoIDKey(tableID int64) string {\n-\tif tableID == 0 {\n-\t\tlog.Error(\"Invalid tableID\")\n+func (m *TMeta) checkTableNotExists(dbKey []byte, tableKey []byte) error {\n+\tv, err := m.txn.HGet(dbKey, tableKey)\n+\tif err != nil {\n+\t\treturn err","path":"meta/meta.go","position":null,"original_position":256,"commit_id":"c7592fc1ad2c16471f0e5b226aaeaf9980236992","original_commit_id":"cc10d2030f748e836f7bb1353b453a8c6fd062f1","user":{"login":"qiuyesuifeng","id":1953644,"avatar_url":"https://avatars.githubusercontent.com/u/1953644?v=3","gravatar_id":"","url":"https://api.github.com/users/qiuyesuifeng","html_url":"https://github.com/qiuyesuifeng","followers_url":"https://api.github.com/users/qiuyesuifeng/followers","following_url":"https://api.github.com/users/qiuyesuifeng/following{/other_user}","gists_url":"https://api.github.com/users/qiuyesuifeng/gists{/gist_id}","starred_url":"https://api.github.com/users/qiuyesuifeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiuyesuifeng/subscriptions","organizations_url":"https://api.github.com/users/qiuyesuifeng/orgs","repos_url":"https://api.github.com/users/qiuyesuifeng/repos","events_url":"https://api.github.com/users/qiuyesuifeng/events{/privacy}","received_events_url":"https://api.github.com/users/qiuyesuifeng/received_events","type":"User","site_admin":false},"body":"errors.Trace(err)","created_at":"2015-10-26T05:32:09Z","updated_at":"2015-10-26T05:32:09Z","html_url":"https://github.com/pingcap/tidb/pull/443#discussion_r42961073","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/443","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/42961073"},"html":{"href":"https://github.com/pingcap/tidb/pull/443#discussion_r42961073"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/443"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/443","id":48554382,"html_url":"https://github.com/pingcap/tidb/pull/443","diff_url":"https://github.com/pingcap/tidb/pull/443.diff","patch_url":"https://github.com/pingcap/tidb/pull/443.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/443","number":443,"state":"open","locked":false,"title":"dev structure","user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars.githubusercontent.com/u/1080370?v=3","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"body":"+ add base structure function\r\n+ add meta function \r\n+ add base async ddl framework ","created_at":"2015-10-23T08:36:06Z","updated_at":"2015-10-26T05:32:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c26f3b93fa8509c1515dd1fc9ad352e797b39a4c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/443/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/443/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/443/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/c7592fc1ad2c16471f0e5b226aaeaf9980236992","head":{"label":"pingcap:siddontang/dev-structure","ref":"siddontang/dev-structure","sha":"c7592fc1ad2c16471f0e5b226aaeaf9980236992","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tidb","description":"TiDB is a distributed SQL database compatible with MySQL protocol.","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","created_at":"2015-09-06T04:01:52Z","updated_at":"2015-10-26T04:37:36Z","pushed_at":"2015-10-26T05:20:57Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"","size":12089,"stargazers_count":2699,"watchers_count":2699,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":257,"mirror_url":null,"open_issues_count":59,"forks":257,"open_issues":59,"watchers":2699,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"1bb9362ed793c079258e1d0fd79a20fd16d282c9","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tidb","description":"TiDB is a distributed SQL database compatible with MySQL protocol.","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","created_at":"2015-09-06T04:01:52Z","updated_at":"2015-10-26T04:37:36Z","pushed_at":"2015-10-26T05:20:57Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"","size":12089,"stargazers_count":2699,"watchers_count":2699,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":257,"mirror_url":null,"open_issues_count":59,"forks":257,"open_issues":59,"watchers":2699,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/443"},"html":{"href":"https://github.com/pingcap/tidb/pull/443"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/443"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/443/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/443/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/443/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/c7592fc1ad2c16471f0e5b226aaeaf9980236992"}}}}