forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lazily init PulsarAdmin in PulsarAdminTool (apache#9312)
### Motivation pulsar-admin (PulsarAdminTool) initialises eagerly the PulsarAdmin object and some of the the underlying REST API intefaces. This initialisation process triggers lot of resource loading (like SSL/RESTAPI classes....) that slows down the JVM even for stuff that is not needed. Also there are shutdown hooks that are useless by they are executed while existing from the command. Removing initialisation of useless stuff helps in having a better bootstrap time, especially in case that you are not performing API calls, like when you are learning the tool and you make lots of syntax errors. ### Modifications - Initialise as lazily as possible PulsarAdmin - Make PulsarAdminTool#main "testable" by allowing it to not call System.exit - Use halt instead of exit in order to not trigger shutdown hooks ### Verifying this change This change is a trivial rework / code cleanup, but I have added tests for parts that have been touched and had not unit tests.
- Loading branch information
Showing
28 changed files
with
654 additions
and
492 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.