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

#include <DataRecycler.h>

Static Public Member Functions

static std::string getDeviceIdentifierString (DeviceIdentifier device_identifier)
 
static QueryPlanHash getUnitaryTableKey ()
 
static std::unordered_set< size_t > getAlternativeTableKeys (const std::vector< ChunkKey > &chunk_keys, const shared::TableKey &inner_table_key)
 

Static Public Attributes

static constexpr DeviceIdentifier CPU_DEVICE_IDENTIFIER = 0
 

Detailed Description

Definition at line 134 of file DataRecycler.h.

Member Function Documentation

static std::unordered_set<size_t> DataRecyclerUtil::getAlternativeTableKeys ( const std::vector< ChunkKey > &  chunk_keys,
const shared::TableKey inner_table_key 
)
inlinestatic

Definition at line 154 of file DataRecycler.h.

References getUnitaryTableKey(), shared::TableKey::hash(), hash_value(), and shared::TableKey::table_id.

Referenced by PerfectJoinHashTable::reify(), RangeJoinHashTable::reifyWithLayout(), BoundingBoxIntersectJoinHashTable::reifyWithLayout(), and BaselineJoinHashTable::reifyWithLayout().

156  {
157  std::unordered_set<size_t> alternative_table_keys;
158  if (!chunk_keys.empty() && chunk_keys.front().size() > 2 &&
159  chunk_keys.front()[1] > 0) {
160  auto& chunk_key = chunk_keys.front();
161  // the actual chunks fetched per device can be different but they constitute the
162  // same table in the same db, so we can exploit this to create an alternative table
163  // key
164  std::vector<int> alternative_table_key{chunk_key[0], chunk_key[1]};
165  alternative_table_keys.insert(boost::hash_value(alternative_table_key));
166  } else if (inner_table_key.table_id > 0) {
167  // use this path if chunk_keys is empty
168  alternative_table_keys.insert(inner_table_key.hash());
169  } else {
170  // this can happen when we use synthetic table generated by table function such as
171  // generate_series, i.e., SELECT ... FROM table(generate_series(...)) ...
172  // then we try to manage them via predefined static chunk key
173  // and remove them "all" when necessary
174  alternative_table_keys.insert(DataRecyclerUtil::getUnitaryTableKey());
175  }
176  return alternative_table_keys;
177  }
static QueryPlanHash getUnitaryTableKey()
Definition: DataRecycler.h:145
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
Definition: RelAlgDag.cpp:3548
size_t hash() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static std::string DataRecyclerUtil::getDeviceIdentifierString ( DeviceIdentifier  device_identifier)
inlinestatic

Definition at line 138 of file DataRecycler.h.

References CPU_DEVICE_IDENTIFIER, and to_string().

Referenced by HashingSchemeRecycler::clearCache(), BoundingBoxIntersectTuningParamRecycler::clearCache(), ChunkMetadataRecycler::clearCache(), ResultSetRecycler::clearCache(), HashtableRecycler::clearCache(), BoundingBoxIntersectTuningParamRecycler::getItemFromCache(), HashingSchemeRecycler::putItemToCache(), BoundingBoxIntersectTuningParamRecycler::putItemToCache(), ChunkMetadataRecycler::putItemToCache(), ResultSetRecycler::putItemToCache(), HashtableRecycler::putItemToCache(), HashingSchemeRecycler::removeItemFromCache(), BoundingBoxIntersectTuningParamRecycler::removeItemFromCache(), ChunkMetadataRecycler::removeItemFromCache(), ResultSetRecycler::removeItemFromCache(), HashtableRecycler::removeItemFromCache(), HashingSchemeRecycler::toString(), ChunkMetadataRecycler::toString(), ResultSetRecycler::toString(), and HashtableRecycler::toString().

138  {
139  std::string device_type = device_identifier == CPU_DEVICE_IDENTIFIER ? "CPU" : "GPU-";
140  return device_identifier != CPU_DEVICE_IDENTIFIER
141  ? device_type.append(std::to_string(device_identifier))
142  : device_type;
143  }
std::string to_string(char const *&&v)
static constexpr DeviceIdentifier CPU_DEVICE_IDENTIFIER
Definition: DataRecycler.h:136

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static QueryPlanHash DataRecyclerUtil::getUnitaryTableKey ( )
inlinestatic

Definition at line 145 of file DataRecycler.h.

Referenced by getAlternativeTableKeys(), and HashtableRecycler::removeCachedHashtableBuiltFromSyntheticTable().

145  {
146  // C++20 will support constexpr vector
147  // Before we have C++20, let's use a pre-computed constant which is retrieved from
148  // std::vector<int> unitary_table_identifier = {-1, -1};
149  // UNITARY_TABLE_ID_HASH_VALUE = boost::hash_value(unitary_table_identifier);
150  constexpr QueryPlanHash UNITARY_TABLE_ID_HASH_VALUE = 1703092966009212028;
151  return UNITARY_TABLE_ID_HASH_VALUE;
152  }
size_t QueryPlanHash

+ Here is the caller graph for this function:

Member Data Documentation


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