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

api: better region key output. #836

Merged
merged 1 commit into from Nov 7, 2017

Conversation

Projects
None yet
3 participants
@disksing
Member

disksing commented Nov 7, 2017

Fix #816
Fix #498

before:

» region 6
{
  "id": 6,
  "start_key": "dIAAAAAAAAD/BQAAAAAAAAD4",
  "end_key": "dIAAAAAAAAD/BwAAAAAAAAD4",
  "region_epoch": {
    "conf_ver": 1,
    "version": 3
  },
  "peers": [
    {
      "id": 7,
      "store_id": 1
    }
  ],
  "Leader": {
    "id": 7,
    "store_id": 1
  },
  "DownPeers": [],
  "PendingPeers": [],
  "WrittenBytes": 0,
  "ReadBytes": 0
}

after:

» region 6
{
  "id": 6,
  "start_key": "t\\x80\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\x05\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xf8",
  "end_key": "t\\x80\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\a\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xf8",
  "epoch": {
    "conf_ver": 1,
    "version": 3
  },
  "peers": [
    {
      "id": 7,
      "store_id": 1
    }
  ],
  "leader": {
    "id": 7,
    "store_id": 1
  }
}

@disksing disksing requested review from siddontang, nolouch and Connor1996 Nov 7, 2017

return &regionInfo{
ID: r.Id,
StartKey: strings.Trim(fmt.Sprintf("%q", r.StartKey), "\""),
EndKey: strings.Trim(fmt.Sprintf("%q", r.EndKey), "\""),

This comment has been minimized.

@siddontang

siddontang Nov 7, 2017

Member

what is the output if start or end key is empty?

@siddontang

siddontang Nov 7, 2017

Member

what is the output if start or end key is empty?

This comment has been minimized.

@disksing

disksing Nov 7, 2017

Member

empty string.

@disksing

disksing Nov 7, 2017

Member

empty string.

This comment has been minimized.

@disksing

disksing Nov 7, 2017

Member

like this "end_key": "".

@disksing

disksing Nov 7, 2017

Member

like this "end_key": "".

@siddontang

This comment has been minimized.

Show comment
Hide comment
@siddontang

siddontang Nov 7, 2017

Member

LGTM

Member

siddontang commented Nov 7, 2017

LGTM

@nolouch

nolouch approved these changes Nov 7, 2017

LGTM

@disksing disksing merged commit beff2d1 into pingcap:master Nov 7, 2017

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@disksing disksing deleted the disksing:api-region branch Nov 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment