OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringDictionaryProxy.cpp File Reference
#include "StringDictionary/StringDictionaryProxy.h"
#include "Logger/Logger.h"
#include "Shared/ThreadInfo.h"
#include "Shared/misc.h"
#include "Shared/sqltypes.h"
#include "Shared/thread_count.h"
#include "StringDictionary/StringDictionary.h"
#include "StringOps/StringOps.h"
#include "Utils/Regexp.h"
#include "Utils/StringLike.h"
#include <tbb/parallel_for.h>
#include <tbb/task_arena.h>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <string_view>
#include <thread>
+ Include dependency graph for StringDictionaryProxy.cpp:

Go to the source code of this file.

Classes

class  StringLocalCallback
 
class  StringNetworkCallback
 

Namespaces

 anonymous_namespace{StringDictionaryProxy.cpp}
 

Functions

int32_t truncate_to_generation (const int32_t id, const size_t generation)
 
void order_translation_locks (const int32_t source_dict_id, const int32_t dest_dict_id, std::shared_lock< std::shared_mutex > &source_proxy_read_lock, std::unique_lock< std::shared_mutex > &dest_proxy_write_lock)
 
bool anonymous_namespace{StringDictionaryProxy.cpp}::is_like (const std::string &str, const std::string &pattern, const bool icase, const bool is_simple, const char escape)
 
bool anonymous_namespace{StringDictionaryProxy.cpp}::do_compare (const std::string &str, const std::string &pattern, const std::string &comp_operator)
 
bool anonymous_namespace{StringDictionaryProxy.cpp}::is_regexp_like (const std::string &str, const std::string &pattern, const char escape)
 
std::ostream & operator<< (std::ostream &os, StringDictionaryProxy::IdMap const &id_map)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
StringDictionaryProxy::IdMap const &  id_map 
)

Definition at line 611 of file StringDictionaryProxy.cpp.

References StringDictionaryProxy::IdMap::offset_, shared::printContainer(), and StringDictionaryProxy::IdMap::vector_map_.

611  {
612  return os << "IdMap(offset_(" << id_map.offset_ << ") vector_map_"
613  << shared::printContainer(id_map.vector_map_) << ')';
614 }
PrintContainer< CONTAINER > printContainer(CONTAINER &container)
Definition: misc.h:107

+ Here is the call graph for this function:

void order_translation_locks ( const int32_t  source_dict_id,
const int32_t  dest_dict_id,
std::shared_lock< std::shared_mutex > &  source_proxy_read_lock,
std::unique_lock< std::shared_mutex > &  dest_proxy_write_lock 
)

Definition at line 285 of file StringDictionaryProxy.cpp.

288  {
289  if (source_dict_id == dest_dict_id) {
290  // proxies are same, only take one write lock
291  dest_proxy_write_lock.lock();
292  } else if (source_dict_id < dest_dict_id) {
293  source_proxy_read_lock.lock();
294  dest_proxy_write_lock.lock();
295  } else {
296  dest_proxy_write_lock.lock();
297  source_proxy_read_lock.lock();
298  }
299 }
int32_t truncate_to_generation ( const int32_t  id,
const size_t  generation 
)

Definition at line 44 of file StringDictionaryProxy.cpp.

References CHECK_GE, and StringDictionary::INVALID_STR_ID.

Referenced by StringDictionaryProxy::getIdOfStringFromClient().

44  {
46  return id;
47  }
48  CHECK_GE(id, 0);
49  return static_cast<size_t>(id) >= generation ? StringDictionary::INVALID_STR_ID : id;
50 }
#define CHECK_GE(x, y)
Definition: Logger.h:235
static constexpr int32_t INVALID_STR_ID

+ Here is the caller graph for this function: