OmniSciDB  72c90bc290
 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)
 
int get_fragment (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)
 
ChunkKey get_fragment_key (const ChunkKey &key)
 
std::string show_chunk (const ChunkKey &key)
 

Macro Definition Documentation

Typedef Documentation

using ChunkKey = std::vector<int>

Definition at line 36 of file types.h.

Function Documentation

int get_fragment ( const ChunkKey key)
inline

Definition at line 52 of file types.h.

References CHECK, and CHUNK_KEY_FRAGMENT_IDX.

Referenced by foreign_storage::fragment_maps_to_leaf().

52  {
53  CHECK(key.size() > CHUNK_KEY_FRAGMENT_IDX);
54  return key[CHUNK_KEY_FRAGMENT_IDX];
55 }
#define CHUNK_KEY_FRAGMENT_IDX
Definition: types.h:41
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

ChunkKey get_fragment_key ( const ChunkKey key)
inline

Definition at line 90 of file types.h.

References CHECK, CHUNK_KEY_COLUMN_IDX, CHUNK_KEY_DB_IDX, CHUNK_KEY_FRAGMENT_IDX, and CHUNK_KEY_TABLE_IDX.

Referenced by foreign_storage::CachingForeignStorageMgr::getBufferSize().

90  {
91  CHECK(key.size() >= 4);
92  return ChunkKey{key[CHUNK_KEY_DB_IDX],
96 }
std::vector< int > ChunkKey
Definition: types.h:36
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
#define CHUNK_KEY_FRAGMENT_IDX
Definition: types.h:41
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
#define CHECK(condition)
Definition: Logger.h:291
#define CHUNK_KEY_COLUMN_IDX
Definition: types.h:40

+ Here is the caller graph for this function:

ChunkKey get_table_key ( const ChunkKey key)
inline

Definition at line 57 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::getChunkMetadataVecForKeyPrefix(), foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment(), and File_Namespace::CachingFileMgr::touchKey().

57  {
58  CHECK(has_table_prefix(key));
60 }
std::vector< int > ChunkKey
Definition: types.h:36
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
bool has_table_prefix(const ChunkKey &key)
Definition: types.h:48
#define CHECK(condition)
Definition: Logger.h:291

+ 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 62 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(), foreign_storage::CachingForeignStorageMgr::eraseDataWrapper(), File_Namespace::CachingFileMgr::evictMetadataPages(), File_Namespace::CachingGlobalFileMgr::fetchBuffer(), foreign_storage::get_foreign_table_for_key(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecFromDataWrapper(), File_Namespace::FileBuffer::getFileMgrEpoch(), foreign_storage::CachingForeignStorageMgr::populateChunkBuffersSafely(), and File_Namespace::CachingFileMgr::removeKey().

62  {
63  CHECK(has_table_prefix(key));
64  return std::pair<int, int>{key[CHUNK_KEY_DB_IDX], key[CHUNK_KEY_TABLE_IDX]};
65 }
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
bool has_table_prefix(const ChunkKey &key)
Definition: types.h:48
#define CHECK(condition)
Definition: Logger.h:291

+ 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 83 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().

83  {
84  CHECK(has_table_prefix(left_key));
85  CHECK(has_table_prefix(right_key));
86  return (left_key[CHUNK_KEY_DB_IDX] == right_key[CHUNK_KEY_DB_IDX] &&
87  left_key[CHUNK_KEY_TABLE_IDX] == right_key[CHUNK_KEY_TABLE_IDX]);
88 }
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
bool has_table_prefix(const ChunkKey &key)
Definition: types.h:48
#define CHECK(condition)
Definition: Logger.h:291

+ 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 67 of file types.h.

67  {
68  return key.size() == 3;
69 }
bool is_table_key ( const ChunkKey key)
inline
bool is_varlen_data_key ( const ChunkKey key)
inline

Definition at line 75 of file types.h.

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

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

+ Here is the caller graph for this function:

bool is_varlen_index_key ( const ChunkKey key)
inline

Definition at line 79 of file types.h.

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

79  {
80  return key.size() == 5 && key[4] == 2;
81 }

+ Here is the caller graph for this function:

bool is_varlen_key ( const ChunkKey key)
inline

Definition at line 71 of file types.h.

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

71  {
72  return key.size() == 5;
73 }

+ Here is the caller graph for this function: