You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "3pacccccc (via GitHub)" <gi...@apache.org> on 2025/05/11 12:10:43 UTC
[PR] [improve][build]enable FindPublicAttributes check of SpotBugs [pulsar]
3pacccccc opened a new pull request, #24285:
URL: https://github.com/apache/pulsar/pull/24285
<!-- Either this PR fixes an issue, -->
Fixes https://github.com/apache/pulsar/issues/24245
### Motivation
enable FindPublicAttributes check of SpotBugs
### Modifications
as the FindPublicAttributes check of SpotBugs requires, change the Primitive field from public into private to limit external accessibility.
<!-- Describe the modifications you've done. -->
### Verifying this change
- [x] Make sure that the change passes the CI checks.
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*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
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: https://github.com/3pacccccc/pulsar/pull/6
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][build]enable FindPublicAttributes check of SpotBugs [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24285:
URL: https://github.com/apache/pulsar/pull/24285#discussion_r2084076346
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java:
##########
@@ -23,19 +23,27 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
/**
* This object is populated using meta data in zookeeper without actually bringing the topic online.
*/
public class PersistentOfflineTopicStats {
/** Space used to store the messages for the topic (bytes). */
- public long storageSize;
+ @Getter
+ @Setter
+ private long storageSize;
/** Total number of messages. */
- public long totalMessages;
+ @Getter
+ @Setter
+ private long totalMessages;
/** Total backlog. */
- public long messageBacklog;
+ @Getter
+ @Setter
+ private long messageBacklog;
/** Broker host where this stat was generated. */
public final String brokerName;
Review Comment:
These fields should be handled for consistency.
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java:
##########
@@ -23,19 +23,27 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
/**
* This object is populated using meta data in zookeeper without actually bringing the topic online.
*/
public class PersistentOfflineTopicStats {
/** Space used to store the messages for the topic (bytes). */
- public long storageSize;
+ @Getter
+ @Setter
+ private long storageSize;
/** Total number of messages. */
- public long totalMessages;
+ @Getter
+ @Setter
+ private long totalMessages;
/** Total backlog. */
- public long messageBacklog;
+ @Getter
+ @Setter
+ private long messageBacklog;
Review Comment:
These are most likely a breaking change in the public API. In other stats classes there's a separate "Impl" class and a separate interface. I don't see a way how to preserve API compatibility and perhaps we should just break the API when making the change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][build]enable FindPublicAttributes check of SpotBugs [pulsar]
Posted by "3pacccccc (via GitHub)" <gi...@apache.org>.
3pacccccc closed pull request #24285: [improve][build]enable FindPublicAttributes check of SpotBugs
URL: https://github.com/apache/pulsar/pull/24285
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][build]enable FindPublicAttributes check of SpotBugs [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24285:
URL: https://github.com/apache/pulsar/pull/24285#discussion_r2084076346
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java:
##########
@@ -23,19 +23,27 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
/**
* This object is populated using meta data in zookeeper without actually bringing the topic online.
*/
public class PersistentOfflineTopicStats {
/** Space used to store the messages for the topic (bytes). */
- public long storageSize;
+ @Getter
+ @Setter
+ private long storageSize;
/** Total number of messages. */
- public long totalMessages;
+ @Getter
+ @Setter
+ private long totalMessages;
/** Total backlog. */
- public long messageBacklog;
+ @Getter
+ @Setter
+ private long messageBacklog;
/** Broker host where this stat was generated. */
public final String brokerName;
Review Comment:
These final fields should be handled with getters for consistency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org