-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-15975. Use LongAdder instead of AtomicLong #2907
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
Conversation
virajjasani
left a comment
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.
Nice one. For metrics and statistics, LongAdder provides much better throughput.
Thanks @virajjasani for the review. |
|
💔 -1 overall
This message was automatically generated. |
virajjasani
left a comment
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.
Left few nits and one question
...n-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/MutableCounterLong.java
Outdated
Show resolved
Hide resolved
...hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Show resolved
Hide resolved
...s-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSOpsCountStatistics.java
Outdated
Show resolved
Hide resolved
Thanks @virajjasani for your good advice, I fixed it. |
|
💔 -1 overall
This message was automatically generated. |
...hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetCache.java
Show resolved
Hide resolved
Agreed with @virajjasani. Thanks for working on this, @tomscut. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
Merged it. Thanks for your contribution, @tomscut. Thanks for your reviews, @virajjasani. |
|
@tomscut I think this is a good optimization. Would you mind creating another PR for branch-3.3? |
JIRA: HDFS-15975
When counting some indicators, we can use LongAdder instead of AtomicLong to improve performance. The long value is not an atomic snapshot in LongAdder, but I think we can tolerate that.