OmniSciDB  085a039ca4
 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 37 of file types.h.

Function Documentation

int get_fragment ( const ChunkKey key)
inline

Definition at line 53 of file types.h.

References CHECK, and CHUNK_KEY_FRAGMENT_IDX.

Referenced by foreign_storage::fragment_maps_to_leaf().

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

+ Here is the caller graph for this function:

ChunkKey get_fragment_key ( const ChunkKey key)
inline

Definition at line 91 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().

91  {
92  CHECK(key.size() >= 4);
93  return ChunkKey{key[CHUNK_KEY_DB_IDX],
97 }
std::vector< int > ChunkKey
Definition: types.h:37
#define CHUNK_KEY_DB_IDX
Definition: types.h:39
#define CHUNK_KEY_FRAGMENT_IDX
Definition: types.h:42
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:40
#define CHECK(condition)
Definition: Logger.h:223
#define CHUNK_KEY_COLUMN_IDX
Definition: types.h:41

+ Here is the caller graph for this function:

ChunkKey get_table_key ( 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 foreign_storage::CachingForeignStorageMgr::createDataWrapperIfNotExists(), File_Namespace::CachingGlobalFileMgr::deleteBuffersWithPrefix(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment(), and File_Namespace::CachingFileMgr::touchKey().

58  {
59  CHECK(has_table_prefix(key));
61 }
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:223

+ 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 63 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::getChunkMetadataVecFromDataWrapper(), File_Namespace::FileBuffer::getFileMgrEpoch(), foreign_storage::CachingForeignStorageMgr::populateChunkBuffersSafely(), and File_Namespace::CachingFileMgr::removeKey().

63  {
64  CHECK(has_table_prefix(key));
65  return std::pair<int, int>{key[CHUNK_KEY_DB_IDX], key[CHUNK_KEY_TABLE_IDX]};
66 }
#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:223

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

84  {
85  CHECK(has_table_prefix(left_key));
86  CHECK(has_table_prefix(right_key));
87  return (left_key[CHUNK_KEY_DB_IDX] == right_key[CHUNK_KEY_DB_IDX] &&
88  left_key[CHUNK_KEY_TABLE_IDX] == right_key[CHUNK_KEY_TABLE_IDX]);
89 }
#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:223

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

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

Definition at line 76 of file types.h.

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

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

+ Here is the caller graph for this function:

bool is_varlen_index_key ( const ChunkKey key)
inline

Definition at line 80 of file types.h.

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

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

+ Here is the caller graph for this function:

bool is_varlen_key ( const ChunkKey key)
inline

Definition at line 72 of file types.h.

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

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

+ Here is the caller graph for this function: