Skip to content
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

[improve][broker] In OverloadShedder, repeatedly filter local bundles #18463

Merged
merged 1 commit into from Nov 15, 2022

Conversation

lordcheng10
Copy link
Contributor

@lordcheng10 lordcheng10 commented Nov 14, 2022

Motivation

In the OverloadShedder#findBundlesForUnloading method, the local bundles are repeatedly filtered twice:

loadData.getBundleDataForLoadShedding().entrySet().stream()
.filter(e -> localData.getBundles().contains(e.getKey()))
.map((e) -> {

}).filter(e ->
localData.getBundles().contains(e.getLeft())
).sorted((e1, e2) -> {

Modifications

Remove duplicate filters.

Documentation

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

Matching PR in forked repository

PR in forked repository: lordcheng10#40

@nodece nodece added this to the 2.12.0 milestone Nov 15, 2022
@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Merging #18463 (dc9190a) into master (fdf86d3) will increase coverage by 2.25%.
The diff coverage is 2.38%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18463      +/-   ##
============================================
+ Coverage     45.67%   47.92%   +2.25%     
+ Complexity    10075     9370     -705     
============================================
  Files           693      617      -76     
  Lines         67940    58471    -9469     
  Branches       7273     6090    -1183     
============================================
- Hits          31030    28022    -3008     
+ Misses        33333    27438    -5895     
+ Partials       3577     3011     -566     
Flag Coverage Δ
unittests 47.92% <2.38%> (+2.25%) ⬆️

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

Impacted Files Coverage Δ
...adbalance/extensions/channel/ServiceUnitState.java 0.00% <0.00%> (ø)
...lance/extensions/channel/ServiceUnitStateData.java 0.00% <0.00%> (ø)
...ar/broker/loadbalance/extensions/models/Split.java 0.00% <0.00%> (ø)
...r/broker/loadbalance/extensions/models/Unload.java 0.00% <0.00%> (ø)
...ulsar/broker/loadbalance/impl/OverloadShedder.java 6.12% <0.00%> (+0.24%) ⬆️
...va/org/apache/pulsar/client/impl/ConsumerImpl.java 15.07% <0.00%> (-0.03%) ⬇️
...apache/pulsar/client/impl/ConsumerBuilderImpl.java 27.80% <50.00%> (+0.29%) ⬆️
...rvice/schema/KeyValueSchemaCompatibilityCheck.java 21.62% <0.00%> (-45.95%) ⬇️
...apache/pulsar/client/impl/AutoClusterFailover.java 70.00% <0.00%> (-5.56%) ⬇️
...he/pulsar/broker/admin/v2/NonPersistentTopics.java 60.64% <0.00%> (-1.39%) ⬇️
... and 149 more

@nodece nodece merged commit 6efe575 into apache:master Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc-not-needed Your PR changes do not impact docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants