Skip to content

[cleanup] PIP-457: Remove NamespaceName.isGlobal() and TopicName.isGlobal() - #25319

Merged
lhotari merged 1 commit into
apache:masterfrom
merlimat:pip-457-cleanup
Mar 16, 2026
Merged

[cleanup] PIP-457: Remove NamespaceName.isGlobal() and TopicName.isGlobal()#25319
lhotari merged 1 commit into
apache:masterfrom
merlimat:pip-457-cleanup

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Motivation

Follow-up cleanup for PIP-457 (V1 topic name and namespace removal, #25275 and #25304).

With V1 namespace removal, NamespaceName.isGlobal() always returns true (since all namespaces are now 2-part V2 format). This makes isGlobal() dead code — every condition checking it is either always-true or always-false.

Modifications

  • Removed NamespaceName.isGlobal() and TopicName.isGlobal() methods
  • Simplified all call sites across the broker:
    • Always-true if (x.isGlobal()) conditions: unwrapped to just the body
    • Always-false if (!x.isGlobal()) conditions: removed as dead code
    • Combined conditions: removed the isGlobal() term
  • Cleaned up PersistentTopicsBase.java: chained thenCompose() calls directly instead of using intermediate variables with block lambdas (~30 methods simplified)

Verifying this change

This change is a pure refactor with no behavioral change — isGlobal() already returned true unconditionally.

Documentation

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

…obal()

With V1 namespace removal, isGlobal() always returns true, making it
dead code. Removed the methods and simplified all call sites:
- Always-true conditions unwrapped to just the body
- Always-false conditions (negated) removed as dead code
- Combined conditions simplified by removing the isGlobal() term
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Mar 13, 2026
@codecov-commenter

codecov-commenter commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.74%. Comparing base (735b429) to head (4b986d3).
⚠️ Report is 124 commits behind head on master.

Files with missing lines Patch % Lines
...oker/service/nonpersistent/NonPersistentTopic.java 47.05% 6 Missing and 3 partials ⚠️
...sar/broker/service/persistent/PersistentTopic.java 57.89% 7 Missing and 1 partial ⚠️
...he/pulsar/broker/admin/v2/NonPersistentTopics.java 20.00% 4 Missing ⚠️
...pulsar/broker/admin/impl/PersistentTopicsBase.java 97.89% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #25319      +/-   ##
============================================
- Coverage     72.97%   72.74%   -0.23%     
+ Complexity    34347    34217     -130     
============================================
  Files          1954     1954              
  Lines        154715   154609     -106     
  Branches      17704    17693      -11     
============================================
- Hits         112898   112475     -423     
- Misses        32816    33125     +309     
- Partials       9001     9009       +8     
Flag Coverage Δ
inttests 25.90% <31.15%> (-0.33%) ⬇️
systests 22.49% <19.56%> (-0.13%) ⬇️
unittests 73.73% <83.33%> (-0.21%) ⬇️

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

Files with missing lines Coverage Δ
.../org/apache/pulsar/broker/admin/AdminResource.java 77.26% <100.00%> (+0.20%) ⬆️
...rg/apache/pulsar/broker/service/BrokerService.java 83.68% <ø> (-0.16%) ⬇️
...rg/apache/pulsar/broker/web/PulsarWebResource.java 65.70% <100.00%> (+0.15%) ⬆️
...org/apache/pulsar/common/naming/NamespaceName.java 89.28% <ø> (-0.19%) ⬇️
...ava/org/apache/pulsar/common/naming/TopicName.java 90.72% <ø> (-0.07%) ⬇️
...pulsar/broker/admin/impl/PersistentTopicsBase.java 69.98% <97.89%> (+1.05%) ⬆️
...he/pulsar/broker/admin/v2/NonPersistentTopics.java 64.00% <20.00%> (+0.28%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 80.23% <57.89%> (-0.04%) ⬇️
...oker/service/nonpersistent/NonPersistentTopic.java 71.42% <47.05%> (-0.97%) ⬇️

... and 89 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lhotari
lhotari merged commit 2e3e78d into apache:master Mar 16, 2026
56 of 57 checks passed
@merlimat
merlimat deleted the pip-457-cleanup branch March 16, 2026 19:30
@lhotari lhotari added this to the 4.2.0 milestone Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants