You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/07/13 12:09:52 UTC
[GitHub] [hive] dddddai opened a new pull request #1246: HIVE-23839: Use LongAdder instead of AtomicLong
dddddai opened a new pull request #1246:
URL: https://github.com/apache/hive/pull/1246
For the thread safety of counting,LongAdder is a better choice than AtomicLong.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] dddddai commented on pull request #1246: HIVE-23839: Use LongAdder instead of AtomicLong
Posted by GitBox <gi...@apache.org>.
dddddai commented on pull request #1246:
URL: https://github.com/apache/hive/pull/1246#issuecomment-657601071
@belugabehr Thank you for pointing that out.
If we need to use methods like `compareAndSet(a,b)` and `incrementAndGet()`, then AtomicLong would be preferable.
These cases just update a sum for collecting statistics.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] dddddai closed pull request #1246: HIVE-23839: Use LongAdder instead of AtomicLong
Posted by GitBox <gi...@apache.org>.
dddddai closed pull request #1246:
URL: https://github.com/apache/hive/pull/1246
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] belugabehr commented on pull request #1246: HIVE-23839: Use LongAdder instead of AtomicLong
Posted by GitBox <gi...@apache.org>.
belugabehr commented on pull request #1246:
URL: https://github.com/apache/hive/pull/1246#issuecomment-657576657
> This class is usually preferable to AtomicLong when multiple threads update a common sum that is used for purposes such as collecting statistics, not for fine-grained synchronization control. Under low update contention, the two classes have similar characteristics.
Are these use cases, that have been modified, meet this criteria?
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] dddddai edited a comment on pull request #1246: HIVE-23839: Use LongAdder instead of AtomicLong
Posted by GitBox <gi...@apache.org>.
dddddai edited a comment on pull request #1246:
URL: https://github.com/apache/hive/pull/1246#issuecomment-657601071
@belugabehr Thank you for pointing that out.
If we need to use methods like `compareAndSet(a,b)` and `incrementAndGet()` (the return value is not ignored), then AtomicLong would be preferable.
These cases just update a sum for collecting statistics.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] dddddai closed pull request #1246: HIVE-23839: Use LongAdder instead of AtomicLong
Posted by GitBox <gi...@apache.org>.
dddddai closed pull request #1246:
URL: https://github.com/apache/hive/pull/1246
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org