Skip to content

Conversation

@AnonHxy
Copy link
Contributor

@AnonHxy AnonHxy commented May 12, 2025

Motivation

  1. Optimze bookkeepr shell activeledgers .
    Currently activeledgers only print the ledger id of the active ledgers. if we want to know the size of the active ledgers in then entry log, we need caculate manually.

In this PR, we will also print the active ledgers and the usage of the entrylog.

  1. No more print usage of the entrylog in bookkeepr shell readlogmetadata, because the usage will always be 1.0 which is a false result.

  2. Examples after optimization

  • bin/bookkeeper shell activeledgers

before:
image
after:
image

  • bin/bookkeeper shell readlogmetadata

before:
image
after:
image

Changes

  1. Print more info in activeledgers cmd
  2. No more print usage in readlogmetadata cmd

@AnonHxy AnonHxy force-pushed the opt_ListActiveLedgersCommand branch from 8c6f0a4 to 37e70ed Compare May 12, 2025 16:13
@AnonHxy AnonHxy force-pushed the opt_ListActiveLedgersCommand branch from 37e70ed to d614cf3 Compare May 12, 2025 16:14
Copy link
Member

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

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

Good jobs

@StevenLuMT
Copy link
Member

You have 2 Checkstyle violations:

[INFO] Starting audit...
Error:  /home/runner/work/bookkeeper/bookkeeper/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/ListActiveLedgersCommandTest.java:74: Line is longer than 120 characters (found 139). [LineLength]
Error:  /home/runner/work/bookkeeper/bookkeeper/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/ListActiveLedgersCommandTest.java:85:75: Empty statement. [EmptyStatement]
Audit done.
[INFO] There are 2 errors reported by Checkstyle 9.3 with buildtools/src/main/resources/bookkeeper/checkstyle.xml ruleset.
Error:  src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/ListActiveLedgersCommandTest.java:[74] (sizes) LineLength: Line is longer than 120 characters (found 139).
Error:  src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/ListActiveLedgersCommandTest.java:[85,75] (coding) EmptyStatement: Empty statement.

@AnonHxy
Copy link
Contributor Author

AnonHxy commented May 16, 2025

rerun failure checks

@StevenLuMT
Copy link
Member

@hezhangjian @zymap help review,thanks

Copy link
Member

@hezhangjian hezhangjian left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@xiezhx9 xiezhx9 left a comment

Choose a reason for hiding this comment

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

LGTM

@StevenLuMT StevenLuMT merged commit 0816a3c into apache:master May 16, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants