-
Notifications
You must be signed in to change notification settings - Fork 14.6k
MINOR: Refactor brokerContactTimesMs and brokerRegistrationStates to use Long and Integer #19888
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
MINOR: Refactor brokerContactTimesMs and brokerRegistrationStates to use Long and Integer #19888
Conversation
kafka/metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java Line 78 in 8c71ab0
This is the same situation. |
…kerContactTimesMs-from-AtomicLong-to-Long
@kevin-wu24 could you please take a look? |
metadata/src/main/java/org/apache/kafka/controller/metrics/QuorumControllerMetrics.java
Outdated
Show resolved
Hide resolved
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java
Outdated
Show resolved
Hide resolved
…kerContactTimesMs-from-AtomicLong-to-Long
…ead of AtomicLong
@Yunyung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
metadata/src/main/java/org/apache/kafka/controller/metrics/QuorumControllerMetrics.java
Show resolved
Hide resolved
…kerContactTimesMs-from-AtomicLong-to-Long
This reverts commit 5533075.
…kerContactTimesMs-from-AtomicLong-to-Long
This PR simplifies two ConcurrentHashMap fields by removing their Atomic
wrappers:
Change
brokerContactTimesMs
fromConcurrentHashMap<Integer, AtomicLong>
toConcurrentHashMap<Integer, Long>
.Change
brokerRegistrationStates
fromConcurrentHashMap<Integer, AtomicInteger>
toConcurrentHashMap<Integer, Integer>
.This removes mutable holders without affecting thread safety (see
discussion in #19828).
Reviewers: Chia-Ping Tsai chia7712@gmail.com, TengYao Chi frankvicky@apache.org, Kevin Wu kevin.wu2412@gmail.com, Ken Huang s7133700@gmail.com