Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: schema info api of http status server #5256

Merged
merged 9 commits into from Nov 30, 2017

Conversation

@jackysp
Copy link
Member

commented Nov 29, 2017

@jackysp jackysp added the status/WIP label Nov 29, 2017

@jackysp jackysp force-pushed the jackysp:index_mvcc branch from 9654511 to 8e5d5aa Nov 29, 2017

@jackysp jackysp force-pushed the jackysp:index_mvcc branch from 8e5d5aa to 61c61db Nov 29, 2017

@jackysp jackysp removed the status/WIP label Nov 29, 2017

// table schema of a specified table name
cTableName := model.NewCIStr(tableName)
if data, err := schema.TableByName(cDBName, cTableName); err != nil {
rh.writeError(w, err)

This comment has been minimized.

Copy link
@AndreMouche

AndreMouche Nov 29, 2017

Member

Could we return after writeXXX, since we do not care about this logic anymore?

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 29, 2017

Author Member

Done!

@jackysp

This comment has been minimized.

Copy link
Member Author

commented Nov 29, 2017

/run-all-tests

}
rh.writeError(w, infoschema.ErrDatabaseNotExists.GenByArgs(dbName))
return
} else if tableID := req.FormValue(pTableID); len(tableID) > 0 {

This comment has been minimized.

Copy link
@shenli

shenli Nov 29, 2017

Member

WIth the return in line 266, we do not need the else. So as line 280.

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 30, 2017

Author Member

Done.

err = decoder.Decode(&t)
c.Assert(err, IsNil)

resp, err = http.Get(fmt.Sprintf("http://127.0.0.1:10090/schema?table_id=a"))

This comment has been minimized.

Copy link
@zimulala

zimulala Nov 30, 2017

Member

If we don't check resp, using _ is better.

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 30, 2017

Author Member

done

pRegionID = "regionID"
pRecordID = "recordID"
pStartTS = "startTS"
pHexKey = "hexKey"
pTableID = "table_id"

This comment has been minimized.

Copy link
@zimulala

zimulala Nov 30, 2017

Member

Should we need to use the unified format? tableID or region_id

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 30, 2017

Author Member

It's based on @AndreMouche 's document. I'll check it out.

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 30, 2017

Author Member

Has moved it to a standalone part.

jackysp added 2 commits Nov 30, 2017
decoder := json.NewDecoder(resp.Body)
var dbs []*model.DBInfo
err = decoder.Decode(&dbs)
c.Assert(err, IsNil)

This comment has been minimized.

Copy link
@tiancaiamao

tiancaiamao Nov 30, 2017

Contributor

check dbs value?

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 30, 2017

Author Member

done

var t *tables.MemoryTable
decoder = json.NewDecoder(resp.Body)
err = decoder.Decode(&t)
c.Assert(err, IsNil)

This comment has been minimized.

Copy link
@tiancaiamao

tiancaiamao Nov 30, 2017

Contributor

ditto

This comment has been minimized.

Copy link
@jackysp

jackysp Nov 30, 2017

Author Member

done

jackysp added 2 commits Nov 30, 2017
@jackysp

This comment has been minimized.

Copy link
Member Author

commented Nov 30, 2017

/run-all-tests

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2017

LGTM

@AndreMouche
Copy link
Member

left a comment

LGTM

@jackysp jackysp merged commit 8a5b8d5 into pingcap:master Nov 30, 2017

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details

@jackysp jackysp deleted the jackysp:index_mvcc branch Nov 30, 2017

jackysp added a commit to jackysp/tidb that referenced this pull request Jan 12, 2018
ngaut added a commit that referenced this pull request Jan 14, 2018
server: schema info and mvcc index APIs for http status server (#5256) (
#5629)

* server: schema info api of http status server (#5256)

* server: support http index mvcc interface (#5304)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.