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

#include <StringDictionaryGenerations.h>

Public Member Functions

 StringDictionaryGenerations ()
 
void setGeneration (const shared::StringDictKey &dict_key, const uint64_t generation)
 
void updateGeneration (const shared::StringDictKey &dict_key, const uint64_t generation)
 
int64_t getGeneration (const shared::StringDictKey &dict_key) const
 
const std::unordered_map
< shared::StringDictKey,
uint64_t > & 
asMap () const
 
void clear ()
 

Private Attributes

std::unordered_map
< shared::StringDictKey,
uint64_t > 
dict_key_to_generation_
 

Detailed Description

Definition at line 23 of file StringDictionaryGenerations.h.

Constructor & Destructor Documentation

StringDictionaryGenerations::StringDictionaryGenerations ( )
inline

Definition at line 25 of file StringDictionaryGenerations.h.

25 {};

Member Function Documentation

const std::unordered_map< shared::StringDictKey, uint64_t > & StringDictionaryGenerations::asMap ( ) const

Definition at line 52 of file StringDictionaryGenerations.cpp.

References dict_key_to_generation_.

52  {
54 }
std::unordered_map< shared::StringDictKey, uint64_t > dict_key_to_generation_
void StringDictionaryGenerations::clear ( )

Definition at line 56 of file StringDictionaryGenerations.cpp.

References dict_key_to_generation_, and gpu_enabled::swap().

56  {
58 }
DEVICE void swap(ARGS &&...args)
Definition: gpu_enabled.h:114
std::unordered_map< shared::StringDictKey, uint64_t > dict_key_to_generation_

+ Here is the call graph for this function:

int64_t StringDictionaryGenerations::getGeneration ( const shared::StringDictKey dict_key) const

Definition at line 32 of file StringDictionaryGenerations.cpp.

References dict_key_to_generation_.

33  {
34  const auto it = dict_key_to_generation_.find(id);
35  if (it != dict_key_to_generation_.end()) {
36  return it->second;
37  }
38  if (id.isTransientDict()) {
39  return 0;
40  }
41  // This happens when the query didn't need to do any translation from string
42  // to id. Return an invalid generation and StringDictionaryProxy will assert
43  // the methods which require a generation (the ones which go from string to id)
44  // are called on it if it has an invalid generation, only the id from string
45  // direction is allowed in such cases. Once a query finishes its effective
46  // execution, the generations are cleared and the string to id direction
47  // isn't needed anymore, only the opposite for the returned result set.
48  return -1;
49 }
std::unordered_map< shared::StringDictKey, uint64_t > dict_key_to_generation_
void StringDictionaryGenerations::setGeneration ( const shared::StringDictKey dict_key,
const uint64_t  generation 
)

Definition at line 21 of file StringDictionaryGenerations.cpp.

References dict_key_to_generation_.

Referenced by Executor::computeStringDictionaryGenerations(), and ThriftSerializers::string_dictionary_generations_from_thrift().

22  {
23  dict_key_to_generation_.emplace(dict_key, generation);
24 }
std::unordered_map< shared::StringDictKey, uint64_t > dict_key_to_generation_

+ Here is the caller graph for this function:

void StringDictionaryGenerations::updateGeneration ( const shared::StringDictKey dict_key,
const uint64_t  generation 
)

Definition at line 26 of file StringDictionaryGenerations.cpp.

References CHECK, and dict_key_to_generation_.

27  {
28  CHECK(dict_key_to_generation_.count(dict_key));
29  dict_key_to_generation_[dict_key] = generation;
30 }
#define CHECK(condition)
Definition: Logger.h:291
std::unordered_map< shared::StringDictKey, uint64_t > dict_key_to_generation_

Member Data Documentation

std::unordered_map<shared::StringDictKey, uint64_t> StringDictionaryGenerations::dict_key_to_generation_
private

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