-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Lazily init PulsarAdmin in PulsarAdminTool #9312
Lazily init PulsarAdmin in PulsarAdminTool #9312
Conversation
Thanks @eolivelli work for this, please fix the License header error:
|
@wolfstudy thank you for the heads up, I have to rebase on master, probably some other changes went in. |
@wolfstudy I have update this patch, thanks PTAL |
9dc10f5
to
5c570ab
Compare
This patch is good to go |
I would be interested in sending a backport for 2.7 |
@eolivelli I would suggest leaving this change in master for now. We can backport it when it becomes a challenge when cherry-picking changes. |
Good point. No need to pick it to 2.7 |
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
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.