OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
types.h File Reference
#include <sstream>
#include <string>
#include <thread>
#include <vector>
#include "Logger/Logger.h"
+ Include dependency graph for types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHUNK_KEY_DB_IDX   0
 
#define CHUNK_KEY_TABLE_IDX   1
 
#define CHUNK_KEY_COLUMN_IDX   2
 
#define CHUNK_KEY_FRAGMENT_IDX   3
 
#define CHUNK_KEY_VARLEN_IDX   4
 

Typedefs

using ChunkKey = std::vector< int >
 

Functions

bool is_table_key (const ChunkKey &key)
 
bool has_table_prefix (const ChunkKey &key)
 
ChunkKey get_table_key (const ChunkKey &key)
 
std::pair< int, int > get_table_prefix (const ChunkKey &key)
 
bool is_column_key (const ChunkKey &key)
 
bool is_varlen_key (const ChunkKey &key)
 
bool is_varlen_data_key (const ChunkKey &key)
 
bool is_varlen_index_key (const ChunkKey &key)
 
bool in_same_table (const ChunkKey &left_key, const ChunkKey &right_key)
 
std::string show_chunk (const ChunkKey &key)
 

Macro Definition Documentation

Typedef Documentation

using ChunkKey = std::vector<int>

Definition at line 37 of file types.h.

Function Documentation

ChunkKey get_table_key ( const ChunkKey key)
inline

Definition at line 53 of file types.h.

References CHECK, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, and has_table_prefix().

Referenced by foreign_storage::CachingForeignStorageMgr::createDataWrapperIfNotExists(), File_Namespace::CachingGlobalFileMgr::deleteBuffersWithPrefix(), foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment(), and File_Namespace::CachingFileMgr::touchKey().

53  {
54  CHECK(has_table_prefix(key));
56 }
std::vector< int > ChunkKey
Definition: types.h:37
#define CHUNK_KEY_DB_IDX
Definition: types.h:39
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:40
bool has_table_prefix(const ChunkKey &key)
Definition: types.h:49
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::pair<int, int> get_table_prefix ( const ChunkKey key)
inline

Definition at line 58 of file types.h.

References CHECK, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, and has_table_prefix().

Referenced by File_Namespace::CachingGlobalFileMgr::checkpoint(), File_Namespace::CachingFileMgr::createBufferFromHeaders(), File_Namespace::CachingFileMgr::createBufferUnlocked(), foreign_storage::CachingForeignStorageMgr::createDataWrapperIfNotExists(), File_Namespace::CachingFileMgr::evictMetadataPages(), File_Namespace::CachingGlobalFileMgr::fetchBuffer(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecFromDataWrapper(), File_Namespace::FileBuffer::getFileMgrEpoch(), foreign_storage::CachingForeignStorageMgr::populateChunkBuffersSafely(), and File_Namespace::CachingFileMgr::removeKey().

58  {
59  CHECK(has_table_prefix(key));
60  return std::pair<int, int>{key[CHUNK_KEY_DB_IDX], key[CHUNK_KEY_TABLE_IDX]};
61 }
#define CHUNK_KEY_DB_IDX
Definition: types.h:39
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:40
bool has_table_prefix(const ChunkKey &key)
Definition: types.h:49
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool in_same_table ( const ChunkKey left_key,
const ChunkKey right_key 
)
inline

Definition at line 79 of file types.h.

References CHECK, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, and has_table_prefix().

Referenced by foreign_storage::ForeignStorageCache::cacheMetadataVec(), and File_Namespace::CachingFileMgr::getChunkKeysForPrefix().

79  {
80  CHECK(has_table_prefix(left_key));
81  CHECK(has_table_prefix(right_key));
82  return (left_key[CHUNK_KEY_DB_IDX] == right_key[CHUNK_KEY_DB_IDX] &&
83  left_key[CHUNK_KEY_TABLE_IDX] == right_key[CHUNK_KEY_TABLE_IDX]);
84 }
#define CHUNK_KEY_DB_IDX
Definition: types.h:39
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:40
bool has_table_prefix(const ChunkKey &key)
Definition: types.h:49
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool is_column_key ( const ChunkKey key)
inline

Definition at line 63 of file types.h.

63  {
64  return key.size() == 3;
65 }
bool is_table_key ( const ChunkKey key)
inline

Definition at line 45 of file types.h.

Referenced by foreign_storage::ForeignStorageCache::clearForTablePrefix(), foreign_storage::CachingForeignStorageMgr::refreshAppendTableInCache(), foreign_storage::CachingForeignStorageMgr::refreshNonAppendTableInCache(), foreign_storage::CachingForeignStorageMgr::refreshTable(), and foreign_storage::CachingForeignStorageMgr::refreshTableInCache().

45  {
46  return key.size() == 2;
47 }

+ Here is the caller graph for this function:

bool is_varlen_data_key ( const ChunkKey key)
inline

Definition at line 71 of file types.h.

Referenced by foreign_storage::ForeignStorageCache::cacheMetadataVec(), foreign_storage::ForeignStorageCache::getCachedChunkIfExists(), foreign_storage::anonymous_namespace{InternalCatalogDataWrapper.cpp}::initialize_chunks(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

71  {
72  return key.size() == 5 && key[4] == 1;
73 }

+ Here is the caller graph for this function:

bool is_varlen_index_key ( const ChunkKey key)
inline

Definition at line 75 of file types.h.

Referenced by foreign_storage::anonymous_namespace{InternalCatalogDataWrapper.cpp}::initialize_chunks().

75  {
76  return key.size() == 5 && key[4] == 2;
77 }

+ Here is the caller graph for this function:

bool is_varlen_key ( const ChunkKey key)
inline

Definition at line 67 of file types.h.

Referenced by foreign_storage::ForeignStorageCache::cacheMetadataVec(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

67  {
68  return key.size() == 5;
69 }

+ Here is the caller graph for this function:

std::string show_chunk ( const ChunkKey key)
inline