spark-instrumented-optimizer/common
Ajith 700293207d [SPARK-30406] OneForOneStreamManager ensure that compound operations on shared variables are atomic
Using compound operations as well as increments and decrements on primitive fields are not atomic operations. Here when volatile primitive field is incremented or decremented,  we run into data loss if threads interleave in steps of update.

 Refer: https://wiki.sei.cmu.edu/confluence/display/java/VNA02-J.+Ensure+that+compound+operations+on+shared+variables+are+atomic

### What changes were proposed in this pull request?
Using `AtomicLong` instead of `long`

### Why are the changes needed?
volatile primitive field is incremented or decremented,  we run into data loss if threads interleave in steps of update.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
All Existing UT can pass with the Change

Closes #27071 from ajithme/atomic.

Authored-by: Ajith <ajith2489@gmail.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
2020-01-03 11:41:45 -06:00
..
kvstore [SPARK-30272][SQL][CORE] Remove usage of Guava that breaks in 27; replace with workalikes 2019-12-20 08:55:04 -06:00
network-common [SPARK-30406] OneForOneStreamManager ensure that compound operations on shared variables are atomic 2020-01-03 11:41:45 -06:00
network-shuffle [SPARK-30290][CORE] Count for merged block when fetching continuous blocks in batch 2019-12-25 18:57:02 +08:00
network-yarn [SPARK-30272][SQL][CORE] Remove usage of Guava that breaks in 27; replace with workalikes 2019-12-20 08:55:04 -06:00
sketch [INFRA] Reverts commit 56dcd79 and c216ef1 2019-12-16 19:57:44 -07:00
tags [INFRA] Reverts commit 56dcd79 and c216ef1 2019-12-16 19:57:44 -07:00
unsafe [INFRA] Reverts commit 56dcd79 and c216ef1 2019-12-16 19:57:44 -07:00