OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HashTypeCache Class Reference

#include <BaselineJoinHashTable.h>

Static Public Member Functions

static void set (const std::vector< ChunkKey > &key, const HashType hash_type)
 
static std::pair< HashType, bool > get (const std::vector< ChunkKey > &key)
 
static void clear ()
 

Static Private Attributes

static std::map< std::vector
< ChunkKey >, HashType
hash_type_cache_
 
static std::mutex hash_type_cache_mutex_
 

Detailed Description

Definition at line 53 of file BaselineJoinHashTable.h.

Member Function Documentation

void HashTypeCache::clear ( )
static

Definition at line 939 of file BaselineJoinHashTable.cpp.

Referenced by BaselineJoinHashTable::getCacheInvalidator().

939  {
940  std::lock_guard<std::mutex> hash_type_cache_lock(hash_type_cache_mutex_);
941  hash_type_cache_.clear();
942 }
static std::mutex hash_type_cache_mutex_
static std::map< std::vector< ChunkKey >, HashType > hash_type_cache_

+ Here is the caller graph for this function:

std::pair< HashType, bool > HashTypeCache::get ( const std::vector< ChunkKey > &  key)
static

Definition at line 930 of file BaselineJoinHashTable.cpp.

References OneToOne.

Referenced by BaselineJoinHashTable::reify().

930  {
931  std::lock_guard<std::mutex> hash_type_cache_lock(hash_type_cache_mutex_);
932  const auto it = hash_type_cache_.find(key);
933  if (it == hash_type_cache_.end()) {
934  return {HashType::OneToOne, false};
935  }
936  return {it->second, true};
937 }
static std::mutex hash_type_cache_mutex_
static std::map< std::vector< ChunkKey >, HashType > hash_type_cache_

+ Here is the caller graph for this function:

void HashTypeCache::set ( const std::vector< ChunkKey > &  key,
const HashType  hash_type 
)
static

Definition at line 919 of file BaselineJoinHashTable.cpp.

References CHECK_GE.

Referenced by BaselineJoinHashTable::reify().

919  {
920  for (auto chunk_key : key) {
921  CHECK_GE(chunk_key.size(), size_t(2));
922  if (chunk_key[1] < 0) {
923  return;
924  }
925  }
926  std::lock_guard<std::mutex> hash_type_cache_lock(hash_type_cache_mutex_);
927  hash_type_cache_[key] = hash_type;
928 }
static std::mutex hash_type_cache_mutex_
static std::map< std::vector< ChunkKey >, HashType > hash_type_cache_
#define CHECK_GE(x, y)
Definition: Logger.h:219

+ Here is the caller graph for this function:

Member Data Documentation

std::map< std::vector< ChunkKey >, HashType > HashTypeCache::hash_type_cache_
staticprivate

Definition at line 62 of file BaselineJoinHashTable.h.

std::mutex HashTypeCache::hash_type_cache_mutex_
staticprivate

Definition at line 63 of file BaselineJoinHashTable.h.


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