Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::Bitmap Class Reference

#include <bitmap.h>

Collaboration diagram for impala::Bitmap:

Public Member Functions

 Bitmap (int64_t num_bits)
 
template<bool mod>
void Set (int64_t bit_index, bool v)
 
template<bool mod>
bool Get (int64_t bit_index) const
 
void And (const Bitmap *src)
 Bitwise ANDs the src bitmap into this one. More...
 
void Or (const Bitmap *src)
 Bitwise ORs the src bitmap into this one. More...
 
void SetAllBits (bool b)
 
int64_t size () const
 
std::string DebugString (bool print_bits)
 If 'print_bits' prints 0/1 per bit, otherwise it prints the int64_t value. More...
 

Private Attributes

std::vector< uint64_tbuffer_
 
int64_t size_
 

Detailed Description

Bitmap vector utility class. TODO: investigate perf.

  • Precomputed bitmap
  • Explicit Set/Unset() apis
  • Bigger words
  • size bitmap to Mersenne prime.

Definition at line 29 of file bitmap.h.

Constructor & Destructor Documentation

impala::Bitmap::Bitmap ( int64_t  num_bits)
inline

Definition at line 31 of file bitmap.h.

References buffer_, impala::BitUtil::RoundUpNumi64(), and size_.

Member Function Documentation

void impala::Bitmap::And ( const Bitmap src)
inline

Bitwise ANDs the src bitmap into this one.

Definition at line 63 of file bitmap.h.

References buffer_, and size().

Referenced by impala::RuntimeState::AddBitmapFilter().

string Bitmap::DebugString ( bool  print_bits)

If 'print_bits' prints 0/1 per bit, otherwise it prints the int64_t value.

Definition at line 23 of file bitmap.cc.

References buffer_, impala::BitUtil::RoundUp(), size(), and size_.

template<bool mod>
bool impala::Bitmap::Get ( int64_t  bit_index) const
inline

Returns true if the bit at 'bit_index' is set. If mod is true, this function will first mod the bit_index by the bitmap size.

Definition at line 54 of file bitmap.h.

References buffer_, and size().

Referenced by impala::HdfsParquetScanner::ColumnReader< T >::ReadSlot().

void impala::Bitmap::Or ( const Bitmap src)
inline

Bitwise ORs the src bitmap into this one.

Definition at line 71 of file bitmap.h.

References buffer_, and size().

template<bool mod>
void impala::Bitmap::Set ( int64_t  bit_index,
bool  v 
)
inline

Sets the bit at 'bit_index' to v. If mod is true, this function will first mod the bit_index by the bitmap size.

Definition at line 39 of file bitmap.h.

References buffer_, and size().

void impala::Bitmap::SetAllBits ( bool  b)
inline

Definition at line 78 of file bitmap.h.

References buffer_.

int64_t impala::Bitmap::size ( ) const
inline

Definition at line 82 of file bitmap.h.

References size_.

Referenced by And(), DebugString(), Get(), Or(), and Set().

Member Data Documentation

std::vector<uint64_t> impala::Bitmap::buffer_
private

Definition at line 88 of file bitmap.h.

Referenced by And(), Bitmap(), DebugString(), Get(), Or(), Set(), and SetAllBits().

int64_t impala::Bitmap::size_
private

Definition at line 89 of file bitmap.h.

Referenced by Bitmap(), DebugString(), and size().


The documentation for this class was generated from the following files: