OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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
 

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)
 
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)
 
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 52 of file types.h.

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

Referenced by foreign_storage::CachingForeignStorageMgr::createOrRecoverDataWrapperIfNotExists(), MutableCachePersistentStorageMgr::deleteBuffersWithPrefix(), foreign_storage::ForeignStorageCache::evictThenEraseChunkUnlocked(), PersistentStorageMgr::getChunkMetadataVecForKeyPrefix(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

52  {
53  CHECK(has_table_prefix(key));
55 }
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:48
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool has_table_prefix ( const ChunkKey key)
inline

Definition at line 48 of file types.h.

Referenced by MutableCachePersistentStorageMgr::deleteBuffersWithPrefix(), get_table_key(), PersistentStorageMgr::getChunkMetadataVecForKeyPrefix(), PersistentStorageMgr::isChunkPrefixCacheable(), and PersistentStorageMgr::isForeignStorage().

48  {
49  return key.size() >= 2;
50 }

+ Here is the caller graph for this function:

bool is_column_key ( const ChunkKey key)
inline

Definition at line 57 of file types.h.

57  {
58  return key.size() == 3;
59 }
bool is_table_key ( const ChunkKey key)
inline
bool is_varlen_data_key ( const ChunkKey key)
inline

Definition at line 65 of file types.h.

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

65  {
66  return key.size() == 5 && key[4] == 1;
67 }

+ Here is the caller graph for this function:

bool is_varlen_index_key ( const ChunkKey key)
inline

Definition at line 69 of file types.h.

69  {
70  return key.size() == 5 && key[4] == 2;
71 }
bool is_varlen_key ( const ChunkKey key)
inline

Definition at line 61 of file types.h.

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

61  {
62  return key.size() == 5;
63 }

+ Here is the caller graph for this function:

std::string show_chunk ( const ChunkKey key)
inline

Definition at line 73 of file types.h.

Referenced by File_Namespace::FileMgr::createBufferUnlocked(), File_Namespace::FileMgr::deleteBuffer(), foreign_storage::ForeignStorageCache::dumpCachedChunkEntries(), foreign_storage::ForeignStorageCache::dumpCachedMetadataEntries(), File_Namespace::FileMgr::fetchBuffer(), File_Namespace::FileBuffer::FileBuffer(), File_Namespace::FileMgr::getBuffer(), File_Namespace::FileInfo::openExistingFile(), File_Namespace::FileMgr::putBuffer(), and Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats().

73  {
74  std::ostringstream tss;
75  for (auto vecIt = key.begin(); vecIt != key.end(); ++vecIt) {
76  tss << *vecIt << ",";
77  }
78  return tss.str();
79 }

+ Here is the caller graph for this function: