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

[pulsar-admin] Print topic internal info as formatted json #12709

Merged
merged 1 commit into from Nov 10, 2021
Merged

[pulsar-admin] Print topic internal info as formatted json #12709

merged 1 commit into from Nov 10, 2021

Conversation

yuruguo
Copy link
Contributor

@yuruguo yuruguo commented Nov 10, 2021

Motivation

Currently, we can get topic internal info through CLI bin/pulsar-admin topics info-internal tn1/ns1/tp1, but I find that what we get is an unformatted and unreadable result, as below:

"{\"version\":0,\"partitions\":{\"persistent://pulsar/application-f75e774c-7e1e-405a-aa57-bfee90b93923/topic-partition-0\":{\"version\":0,\"creationDate\":\"2021-11-10T12:17:01.397+08:00\",\"modificationDate\":\"2021-11-10T12:17:01.397+08:00\",\"ledgers\":[],\"cursors\":{}},\"persistent://pulsar/application-f75e774c-7e1e-405a-aa57-bfee90b93923/topic-partition-1\":{\"version\":0,\"creationDate\":\"2021-11-10T12:17:01.414+08:00\",\"modificationDate\":\"2021-11-10T12:17:01.414+08:00\",\"ledgers\":[],\"cursors\":{}}}}"

The purpose of this PR is to format topic internal info to make it clear and readable, as below:

{
  "version": 0,
  "partitions": {
    "persistent://pulsar/application-f75e774c-7e1e-405a-aa57-bfee90b93923/topic-partition-0": {
      "version": 0,
      "creationDate": "2021-11-10T12:17:01.397+08:00",
      "modificationDate": "2021-11-10T12:17:01.397+08:00",
      "ledgers": [],
      "cursors": {}
    },
    "persistent://pulsar/application-f75e774c-7e1e-405a-aa57-bfee90b93923/topic-partition-1": {
      "version": 0,
      "creationDate": "2021-11-10T12:17:01.414+08:00",
      "modificationDate": "2021-11-10T12:17:01.414+08:00",
      "ledgers": [],
      "cursors": {}
    }
  }
}

Documentation

  • no-need-doc

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 10, 2021
Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codelipenghui codelipenghui added this to the 2.10.0 milestone Nov 10, 2021
@codelipenghui codelipenghui added release/2.9.1 release/2.8.3 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages labels Nov 10, 2021
@codelipenghui codelipenghui merged commit bcc8243 into apache:master Nov 10, 2021
codelipenghui pushed a commit that referenced this pull request Nov 18, 2021
@codelipenghui codelipenghui added cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.8.2 and removed release/2.8.3 labels Nov 18, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
codelipenghui pushed a commit that referenced this pull request Dec 20, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.2 release/2.9.2 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants