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][cli] Fix NPE in admin-CLI topic stats command #18326

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

vineeth1995
Copy link
Contributor

@vineeth1995 vineeth1995 commented Nov 3, 2022

Motivation

The admin stats command throws NullPointerException when fetching stats for a topic. This PR aims to fix the issue

Stacktrace:

sudo cloud-messaging-admin persistent stats persistent://sessionsearch-k8s/global/search_history/get
java.lang.NullPointerException
at org.apache.pulsar.admin.cli.CmdPersistentTopics$GetStats.run(CmdPersistentTopics.java:349)
at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:87)
at org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:290)
at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:339)

Modifications

Get persistentTopics exclusively if the value is Null.

Verifying this change

This change is already covered by existing tests, such as PulsarAdminToolTest.persistentTopics().

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
  • Anything that affects deployment

Documentation

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

@vineeth1995 vineeth1995 changed the title [improve][admin] Fix NPE in admin-CLI topic stats command [improve][pulsar-client-tools] Fix NPE in admin-CLI topic stats command Nov 3, 2022
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 3, 2022
@vineeth1995 vineeth1995 changed the title [improve][pulsar-client-tools] Fix NPE in admin-CLI topic stats command [improve][cli] Fix NPE in admin-CLI topic stats command Nov 3, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #18326 (e09a80a) into master (2e878e8) will increase coverage by 6.06%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18326      +/-   ##
============================================
+ Coverage     40.04%   46.11%   +6.06%     
- Complexity     8625     8934     +309     
============================================
  Files           687      608      -79     
  Lines         67436    58071    -9365     
  Branches       7221     6054    -1167     
============================================
- Hits          27007    26781     -226     
+ Misses        37411    28275    -9136     
+ Partials       3018     3015       -3     
Flag Coverage Δ
unittests 46.11% <66.66%> (+6.06%) ⬆️

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

Impacted Files Coverage Δ
...ervice/persistent/MessageRedeliveryController.java 51.21% <ø> (-9.76%) ⬇️
...ulsar/utils/ConcurrentBitmapSortedLongPairSet.java 57.40% <ø> (-1.86%) ⬇️
...ersistentStickyKeyDispatcherMultipleConsumers.java 39.90% <33.33%> (-17.79%) ⬇️
...sistent/PersistentDispatcherMultipleConsumers.java 48.75% <75.00%> (-2.40%) ⬇️
...broker/delayed/InMemoryDelayedDeliveryTracker.java 65.00% <100.00%> (ø)
...g/apache/pulsar/client/impl/RawBatchConverter.java 3.12% <0.00%> (-89.07%) ⬇️
.../transaction/buffer/metadata/AbortTxnMetadata.java 28.57% <0.00%> (-57.15%) ⬇️
...lsar/broker/service/StickyKeyConsumerSelector.java 50.00% <0.00%> (-50.00%) ⬇️
...apache/pulsar/broker/service/TopicListService.java 10.65% <0.00%> (-44.27%) ⬇️
...ion/buffer/metadata/TransactionBufferSnapshot.java 42.85% <0.00%> (-42.86%) ⬇️
... and 308 more

@rdhabalia rdhabalia merged commit 251d9fd into apache:master Nov 3, 2022
@Technoboy- Technoboy- modified the milestones: 2.12.0, 2.11.0 Nov 4, 2022
Technoboy- pushed a commit that referenced this pull request Nov 4, 2022
Co-authored-by: Vineeth <vineeth.polamreddy@verizonmedia.com>
congbobo184 pushed a commit that referenced this pull request Nov 7, 2022
Co-authored-by: Vineeth <vineeth.polamreddy@verizonmedia.com>
(cherry picked from commit 251d9fd)
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 7, 2022
congbobo184 pushed a commit that referenced this pull request Nov 30, 2022
Co-authored-by: Vineeth <vineeth.polamreddy@verizonmedia.com>
(cherry picked from commit 251d9fd)
liangyepianzhou pushed a commit that referenced this pull request Dec 9, 2022
Co-authored-by: Vineeth <vineeth.polamreddy@verizonmedia.com>
(cherry picked from commit 251d9fd)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
Co-authored-by: Vineeth <vineeth.polamreddy@verizonmedia.com>
(cherry picked from commit 251d9fd)
(cherry picked from commit e1e9000)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
Co-authored-by: Vineeth <vineeth.polamreddy@verizonmedia.com>
(cherry picked from commit 251d9fd)
(cherry picked from commit e1e9000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants