[improve][cli]Support for pulsar-shell persistent modes#22515
Closed
sandeep-mst wants to merge 2 commits into
Closed
[improve][cli]Support for pulsar-shell persistent modes#22515sandeep-mst wants to merge 2 commits into
sandeep-mst wants to merge 2 commits into
Conversation
lhotari
reviewed
Apr 16, 2024
Comment on lines
+605
to
+607
| private static boolean isExitModeCommand(String line) { | ||
| return line.equalsIgnoreCase("exitmode"); | ||
| } |
Member
There was a problem hiding this comment.
there shouldn't be a separate exitmode command. Simple exit or pressing CTRL-D should do that.
lhotari
reviewed
Apr 16, 2024
| } | ||
|
|
||
| private static boolean isChangeModeCommand(String line) { | ||
| return line.equalsIgnoreCase("admin") || line.equalsIgnoreCase("client") || line.equalsIgnoreCase("config"); |
Member
There was a problem hiding this comment.
seems like duplication. I'd assume that the ShellMode enum would have a status lookup method instead.
Member
There was a problem hiding this comment.
for example https://www.baeldung.com/java-enum-values contains some advice how this could be handled.
Member
|
@sandeep-mst Thanks for the contribution. Please target the |
Contributor
Author
|
Closing in favour of #22522 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes 21194 of apache/pulsar
Motivation
Pulsar shell doesn't support persistent mode for admin, client, config. If we need to run a lot of admin commands for example, we would need to prefix admin each time. This will provide an alternative approach.
Modifications
Modified so that
admin,client,configcommands individually will launch their own mode and prompt message also gets updated.exitmodecommand will exit from the mode to the default mode.In the admin mode, we can run command
topicsinstead ofadmin topics.Verifying this change
(Please pick either of the following options)
This change is already covered by existing tests, such as (please describe tests).
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository:
cognitree#5