Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <atomic.h>
Public Member Functions | |
AtomicInt (T initial=0) | |
operator T () const | |
AtomicInt & | operator= (T val) |
AtomicInt & | operator= (const AtomicInt< T > &val) |
AtomicInt & | operator+= (T delta) |
AtomicInt & | operator-= (T delta) |
AtomicInt & | operator|= (T v) |
AtomicInt & | operator&= (T v) |
AtomicInt & | operator++ () |
These define the preincrement (i.e. –value) operators. More... | |
AtomicInt & | operator-- () |
AtomicInt< T > | operator++ (int) |
This is post increment, which needs to return a new object. More... | |
AtomicInt< T > | operator-- (int) |
T | Read () |
Safe read of the value. More... | |
T | UpdateAndFetch (T delta) |
Increments by delta (i.e. += delta) and returns the new val. More... | |
T | FetchAndUpdate (T delta) |
Increment by delta and returns the old val. More... | |
void | UpdateMax (T value) |
Updates the int to 'value' if value is larger. More... | |
void | UpdateMin (T value) |
bool | CompareAndSwap (T old_val, T new_val) |
Returns true if the atomic compare-and-swap was successful. More... | |
T | CompareAndSwapVal (T old_val, T new_val) |
T | Swap (const T &new_val) |
Atomically updates value_ with new_val. Returns the old value_. More... | |
Private Attributes | |
T | value_ |
Wrapper for atomic integers. This should be switched to c++ 11 when we can switch. This class overloads operators to behave like a regular integer type but all operators and functions are thread safe.
|
inline |
|
inline |
Returns true if the atomic compare-and-swap was successful.
Definition at line 131 of file atomic.h.
Referenced by impala::CASDecrementThread(), impala::CASIncrementThread(), impala::PlanFragmentExecutor::FragmentComplete(), impala::TEST(), impala::RuntimeProfile::HighWaterMarkCounter::TryAdd(), impala::AtomicInt< int >::UpdateMax(), impala::AtomicInt< int >::UpdateMin(), and impala::PlanFragmentExecutor::UpdateStatus().
|
inline |
Returns the content of value_ before the operation. If returnValue == old_val, then the atomic compare-and-swap was successful.
Definition at line 137 of file atomic.h.
Referenced by impala::TEST().
|
inline |
Increment by delta and returns the old val.
Definition at line 110 of file atomic.h.
Referenced by impala::TEST().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Safe read of the value.
Definition at line 100 of file atomic.h.
Referenced by impala::CASDecrementThread(), impala::CASIncrementThread(), impala::PlanFragmentExecutor::ReportProfile(), and impala::PeriodicCounterUpdater::UpdateLoop().
|
inline |
Atomically updates value_ with new_val. Returns the old value_.
Definition at line 142 of file atomic.h.
Referenced by impala::TEST(), and impala::PeriodicCounterUpdater::~PeriodicCounterUpdater().
|
inline |
Increments by delta (i.e. += delta) and returns the new val.
Definition at line 105 of file atomic.h.
Referenced by impala::RuntimeProfile::HighWaterMarkCounter::Add(), impala::HdfsOperationSet::MarkOneOpDone(), impala::MemTracker::Release(), and impala::TEST().
|
inline |
Updates the int to 'value' if value is larger.
Definition at line 115 of file atomic.h.
Referenced by impala::RuntimeProfile::HighWaterMarkCounter::Add(), impala::RuntimeProfile::HighWaterMarkCounter::Set(), impala::TEST(), and impala::RuntimeProfile::HighWaterMarkCounter::TryAdd().
|
inline |
Definition at line 122 of file atomic.h.
Referenced by impala::TEST().
|
private |
Definition at line 147 of file atomic.h.
Referenced by impala::AtomicInt< int >::CompareAndSwap(), impala::AtomicInt< int >::CompareAndSwapVal(), impala::AtomicInt< int >::FetchAndUpdate(), impala::AtomicInt< uint32_t >::operator uint32_t(), impala::AtomicInt< int >::operator&=(), impala::AtomicInt< int >::operator++(), impala::AtomicInt< int >::operator+=(), impala::AtomicInt< int >::operator--(), impala::AtomicInt< int >::operator-=(), impala::AtomicInt< int >::operator=(), impala::AtomicInt< int >::operator|=(), impala::AtomicInt< int >::Read(), impala::AtomicInt< int >::Swap(), impala::AtomicInt< int >::UpdateAndFetch(), impala::AtomicInt< int >::UpdateMax(), and impala::AtomicInt< int >::UpdateMin().