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

stl-like iterator interface. More...

#include <hash-table.h>

Collaboration diagram for impala::HashTable::Iterator:

Public Member Functions

 Iterator ()
 
void IR_ALWAYS_INLINE Next ()
 Iterates to the next element. It should be called only if !AtEnd(). More...
 
void IR_ALWAYS_INLINE NextDuplicate ()
 
void NextUnmatched ()
 
TupleRowGetRow () const
 
TupleGetTuple () const
 
void SetMatched ()
 
bool IsMatched () const
 
void SetAtEnd ()
 Resets everything but the pointer to the hash table. More...
 
bool AtEnd () const
 Returns true if this iterator is at the end, i.e. GetRow() cannot be called. More...
 

Private Member Functions

 Iterator (HashTable *table, TupleRow *row, int bucket_idx, DuplicateNode *node, uint32_t hash)
 

Private Attributes

HashTabletable_
 
TupleRowrow_
 
int64_t bucket_idx_
 
DuplicateNodenode_
 Pointer to the current duplicate node. More...
 

Static Private Attributes

static const int64_t BUCKET_NOT_FOUND = -1
 Bucket index value when probe is not successful. More...
 

Friends

class HashTable
 

Detailed Description

stl-like iterator interface.

Definition at line 450 of file hash-table.h.

Constructor & Destructor Documentation

impala::HashTable::Iterator::Iterator ( )
inline

Definition at line 457 of file hash-table.h.

impala::HashTable::Iterator::Iterator ( HashTable table,
TupleRow row,
int  bucket_idx,
DuplicateNode node,
uint32_t  hash 
)
inlineprivate

Definition at line 497 of file hash-table.h.

Member Function Documentation

TupleRow * impala::HashTable::Iterator::GetRow ( ) const
inline
bool impala::HashTable::Iterator::IsMatched ( ) const
inline

Returns the 'matched' flag of the current Bucket or DuplicateNode, depending on whether the bucket has duplicates or not. It should be called only if !AtEnd().

Definition at line 269 of file hash-table.inline.h.

References impala::HashTable::Bucket::hasDuplicates, and impala::HashTable::Bucket::matched.

Referenced by impala::PartitionedHashJoinNode::OutputUnmatchedBuild(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().

void impala::HashTable::Iterator::Next ( )
inline
void impala::HashTable::Iterator::NextDuplicate ( )
inline

Iterates to the next duplicate node. If the bucket does not have duplicates or when it reaches the last duplicate node, then it moves the Iterator to AtEnd(). Used when we want to iterate over all the duplicate nodes bypassing the Next() interface (e.g. in semi/outer joins without other_join_conjuncts, in order to iterate over all nodes of an unmatched bucket).

Definition at line 292 of file hash-table.inline.h.

Referenced by impala::PartitionedHashJoinNode::ProcessProbeBatch().

void impala::HashTable::Iterator::NextUnmatched ( )
inline

Iterates to the next element that does not have its matched flag set. Used in right-outer and full-outer joins.

Definition at line 302 of file hash-table.inline.h.

References BUCKET_NOT_FOUND, impala::HashTable::Bucket::hasDuplicates, and impala::HashTable::Bucket::matched.

Referenced by impala::PartitionedHashJoinNode::OutputUnmatchedBuild().

void impala::HashTable::Iterator::SetAtEnd ( )
inline

Resets everything but the pointer to the hash table.

Definition at line 278 of file hash-table.inline.h.

Referenced by impala::PartitionedHashJoinNode::ProcessProbeBatch(), and impala::PartitionedHashJoinNode::ResetForProbe().

void impala::HashTable::Iterator::SetMatched ( )
inline

Sets as matched the Bucket or DuplicateNode currently pointed by the iterator, depending on whether the bucket has duplicates or not. The iterator cannot be AtEnd().

Definition at line 256 of file hash-table.inline.h.

References impala::HashTable::Bucket::hasDuplicates, and impala::HashTable::Bucket::matched.

Referenced by impala::PartitionedHashJoinNode::OutputUnmatchedBuild(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().

Friends And Related Function Documentation

friend class HashTable
friend

Definition at line 495 of file hash-table.h.

Member Data Documentation

int64_t impala::HashTable::Iterator::bucket_idx_
private

Current bucket idx. TODO: Use uint32_t?

Definition at line 510 of file hash-table.h.

Referenced by AtEnd(), and GetRow().

const int64_t impala::HashTable::Iterator::BUCKET_NOT_FOUND = -1
staticprivate
DuplicateNode* impala::HashTable::Iterator::node_
private

Pointer to the current duplicate node.

Definition at line 513 of file hash-table.h.

Referenced by GetRow().

TupleRow* impala::HashTable::Iterator::row_
private

Definition at line 506 of file hash-table.h.

Referenced by GetRow().

HashTable* impala::HashTable::Iterator::table_
private

Definition at line 505 of file hash-table.h.

Referenced by GetRow().


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