OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpeculativeTopNBlacklist Class Reference

#include <SpeculativeTopN.h>

Public Member Functions

void add (const std::shared_ptr< Analyzer::Expr > expr, const bool desc)
 
bool contains (const std::shared_ptr< Analyzer::Expr > expr, const bool desc) const
 

Private Attributes

std::mutex mutex_
 
std::vector< std::pair
< std::shared_ptr
< Analyzer::Expr >, bool > > 
blacklist_
 

Detailed Description

Definition at line 94 of file SpeculativeTopN.h.

Member Function Documentation

void SpeculativeTopNBlacklist::add ( const std::shared_ptr< Analyzer::Expr expr,
const bool  desc 
)

Definition at line 158 of file SpeculativeTopN.cpp.

References blacklist_, CHECK, and mutex_.

Referenced by RelAlgExecutor::executeSort().

159  {
160  std::lock_guard<std::mutex> lock(mutex_);
161  for (const auto& e : blacklist_) {
162  CHECK(!(*e.first == *expr) || e.second != desc);
163  }
164  blacklist_.emplace_back(expr, desc);
165 }
#define CHECK(condition)
Definition: Logger.h:291
std::vector< std::pair< std::shared_ptr< Analyzer::Expr >, bool > > blacklist_

+ Here is the caller graph for this function:

bool SpeculativeTopNBlacklist::contains ( const std::shared_ptr< Analyzer::Expr expr,
const bool  desc 
) const

Definition at line 167 of file SpeculativeTopN.cpp.

References blacklist_, and mutex_.

Referenced by RelAlgExecutor::createSortInputWorkUnit().

168  {
169  std::lock_guard<std::mutex> lock(mutex_);
170  for (const auto& e : blacklist_) {
171  if (*e.first == *expr && e.second == desc) {
172  return true;
173  }
174  }
175  return false;
176 }
std::vector< std::pair< std::shared_ptr< Analyzer::Expr >, bool > > blacklist_

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<std::pair<std::shared_ptr<Analyzer::Expr>, bool> > SpeculativeTopNBlacklist::blacklist_
private

Definition at line 101 of file SpeculativeTopN.h.

Referenced by add(), and contains().

std::mutex SpeculativeTopNBlacklist::mutex_
mutableprivate

Definition at line 100 of file SpeculativeTopN.h.

Referenced by add(), and contains().


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