apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.26k stars 3.59k forks source link

[improve][broker] Add ServiceUnitStateTableView (ExtensibleLoadManagerImpl only) #23301

Closed heesung-sn closed 1 month ago

heesung-sn commented 2 months ago

PIP: https://github.com/apache/pulsar/pull/23300

Motivation

Implements the PIP: https://github.com/apache/pulsar/pull/23300

Modifications

Verifying this change

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

If the box was checked, please highlight the changes

Documentation

Matching PR in forked repository

PR in forked repository: https://github.com/heesung-sn/pulsar/pull/81

heesung-sn commented 2 months ago

@BewareMyPower @Demogorgon314 Updated the code. PTAL thanks.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 78.50746% with 144 lines in your changes missing coverage. Please review.

Project coverage is 74.70%. Comparing base (bbc6224) to head (bee4bd5). Report is 592 commits behind head on master.

Files with missing lines Patch % Lines
...sions/channel/ServiceUnitStateTableViewSyncer.java 68.25% 24 Missing and 16 partials :warning:
...ata/tableview/impl/MetadataStoreTableViewImpl.java 75.65% 24 Missing and 13 partials :warning:
...el/ServiceUnitStateMetadataStoreTableViewImpl.java 60.78% 14 Missing and 6 partials :warning:
...xtensions/channel/ServiceUnitStateChannelImpl.java 81.25% 14 Missing and 4 partials :warning:
...ensions/channel/ServiceUnitStateTableViewImpl.java 75.67% 11 Missing and 7 partials :warning:
...lance/extensions/channel/ServiceUnitStateData.java 50.00% 1 Missing and 2 partials :warning:
...dbalance/extensions/ExtensibleLoadManagerImpl.java 89.47% 1 Missing and 1 partial :warning:
...ensions/channel/ServiceUnitStateTableViewBase.java 94.44% 2 Missing :warning:
...er/loadbalance/extensions/store/LoadDataStore.java 0.00% 2 Missing :warning:
.../pulsar/metadata/cache/impl/MetadataCacheImpl.java 60.00% 1 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/23301/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #23301 +/- ## ============================================ + Coverage 73.57% 74.70% +1.13% + Complexity 32624 2757 -29867 ============================================ Files 1877 1936 +59 Lines 139502 145635 +6133 Branches 15299 15935 +636 ============================================ + Hits 102638 108802 +6164 + Misses 28908 28540 -368 - Partials 7956 8293 +337 ``` | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/23301/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/23301/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.89% <27.16%> (+3.30%)` | :arrow_up: | | [systests](https://app.codecov.io/gh/apache/pulsar/pull/23301/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.62% <4.77%> (+0.30%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/23301/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `74.07% <78.50%> (+1.23%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/23301?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...org/apache/pulsar/broker/ServiceConfiguration.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2FServiceConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9icm9rZXIvU2VydmljZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `98.96% <100.00%> (-0.43%)` | :arrow_down: | | [...adbalance/extensions/channel/ServiceUnitState.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Floadbalance%2Fextensions%2Fchannel%2FServiceUnitState.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZS5qYXZh) | `100.00% <100.00%> (ø)` | | | [.../channel/ServiceUnitStateDataConflictResolver.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Floadbalance%2Fextensions%2Fchannel%2FServiceUnitStateDataConflictResolver.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZURhdGFDb25mbGljdFJlc29sdmVyLmphdmE=) | `76.00% <100.00%> (ø)` | | | [...e/extensions/store/TableViewLoadDataStoreImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Floadbalance%2Fextensions%2Fstore%2FTableViewLoadDataStoreImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL3N0b3JlL1RhYmxlVmlld0xvYWREYXRhU3RvcmVJbXBsLmphdmE=) | `96.77% <100.00%> (+8.67%)` | :arrow_up: | | [...sar/broker/service/persistent/PersistentTopic.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Fservice%2Fpersistent%2FPersistentTopic.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL3BlcnNpc3RlbnQvUGVyc2lzdGVudFRvcGljLmphdmE=) | `79.54% <ø> (+1.08%)` | :arrow_up: | | [...pache/pulsar/metadata/api/MetadataCacheConfig.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-metadata%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fmetadata%2Fapi%2FMetadataCacheConfig.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLW1ldGFkYXRhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9wdWxzYXIvbWV0YWRhdGEvYXBpL01ldGFkYXRhQ2FjaGVDb25maWcuamF2YQ==) | `83.33% <100.00%> (+3.33%)` | :arrow_up: | | [...he/pulsar/metadata/api/MetadataStoreTableView.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-metadata%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fmetadata%2Fapi%2FMetadataStoreTableView.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLW1ldGFkYXRhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9wdWxzYXIvbWV0YWRhdGEvYXBpL01ldGFkYXRhU3RvcmVUYWJsZVZpZXcuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...dbalance/extensions/ExtensibleLoadManagerImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Floadbalance%2Fextensions%2FExtensibleLoadManagerImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL0V4dGVuc2libGVMb2FkTWFuYWdlckltcGwuamF2YQ==) | `83.33% <89.47%> (+3.24%)` | :arrow_up: | | [...ensions/channel/ServiceUnitStateTableViewBase.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Floadbalance%2Fextensions%2Fchannel%2FServiceUnitStateTableViewBase.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZVRhYmxlVmlld0Jhc2UuamF2YQ==) | `94.44% <94.44%> (ø)` | | | [...er/loadbalance/extensions/store/LoadDataStore.java](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Floadbalance%2Fextensions%2Fstore%2FLoadDataStore.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL3N0b3JlL0xvYWREYXRhU3RvcmUuamF2YQ==) | `0.00% <0.00%> (ø)` | | | ... and [7 more](https://app.codecov.io/gh/apache/pulsar/pull/23301?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | | ... and [579 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/23301/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)