Skip to content

[improve][broker] Remove ClassLoaderSwitcher to avoid objects allocations and consistent the codestyle - #22796

Merged
dao-jun merged 1 commit into
apache:masterfrom
dao-jun:dev/remove_classloader_switcher
May 29, 2024
Merged

[improve][broker] Remove ClassLoaderSwitcher to avoid objects allocations and consistent the codestyle#22796
dao-jun merged 1 commit into
apache:masterfrom
dao-jun:dev/remove_classloader_switcher

Conversation

@dao-jun

@dao-jun dao-jun commented May 29, 2024

Copy link
Copy Markdown
Member

Motivation

Apply #22790 's pattern and address the comment #22767 (comment)

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@dao-jun dao-jun added type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use area/broker ready-to-test category/performance Performance issues fix or improvements labels May 29, 2024
@dao-jun dao-jun added this to the 3.4.0 milestone May 29, 2024
@dao-jun dao-jun self-assigned this May 29, 2024
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label May 29, 2024
@dao-jun
dao-jun requested a review from Technoboy- May 29, 2024 10:48

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.22%. Comparing base (bbc6224) to head (69b0ab7).
Report is 313 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22796      +/-   ##
============================================
- Coverage     73.57%   73.22%   -0.35%     
  Complexity    32624    32624              
============================================
  Files          1877     1890      +13     
  Lines        139502   141628    +2126     
  Branches      15299    15540     +241     
============================================
+ Hits         102638   103708    +1070     
- Misses        28908    29928    +1020     
- Partials       7956     7992      +36     
Flag Coverage Δ
inttests 27.39% <0.00%> (+2.80%) ⬆️
systests 24.63% <0.00%> (+0.30%) ⬆️
unittests 72.24% <100.00%> (-0.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ugin/servlet/AdditionalServletWithClassLoader.java 88.88% <100.00%> (+4.67%) ⬆️
...roker/protocol/ProtocolHandlerWithClassLoader.java 92.50% <100.00%> (+4.03%) ⬆️

... and 365 files with indirect coverage changes

@mattisonchao

Copy link
Copy Markdown
Member

Object allocations are not a big deal here. The main purpose is that you wanna align the code style, right?

@dao-jun

dao-jun commented May 29, 2024

Copy link
Copy Markdown
Member Author

Object allocations are not a big deal here. The main purpose is that you wanna align the code style, right?

Yes, Protocol handler and AdditionalServlet is not in the message publish/consume calling chain, and they don't call frequently, the PR just consistent the codestyle.

@dao-jun

dao-jun commented May 29, 2024

Copy link
Copy Markdown
Member Author

merging..

@dao-jun
dao-jun merged commit 60b9f87 into apache:master May 29, 2024
@dao-jun
dao-jun deleted the dev/remove_classloader_switcher branch May 29, 2024 14:19
Technoboy- pushed a commit that referenced this pull request May 30, 2024
Technoboy- pushed a commit that referenced this pull request May 30, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request May 31, 2024
…ions and consistent the codestyle (apache#22796)

(cherry picked from commit 7918ed5)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2024
…ions and consistent the codestyle (apache#22796)

(cherry picked from commit 7918ed5)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2024
…ions and consistent the codestyle (apache#22796)

(cherry picked from commit 7918ed5)
Technoboy- pushed a commit that referenced this pull request Jun 6, 2024
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 7, 2024
…ions and consistent the codestyle (apache#22796)

(cherry picked from commit 7918ed5)
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker category/performance Performance issues fix or improvements cherry-picked/branch-3.0 cherry-picked/branch-3.2 cherry-picked/branch-3.3 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.6 release/3.2.4 release/3.3.1 type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants