|
| CatCacheBase () |
|
void | InitializeFromExistingData () |
| Initializes the catalog cache from the existing data. More...
|
|
void | InitializeFromInitData (const std::string &init_datafile) |
| Creates the catalog from an init data file and initializes the catalog cache. More...
|
|
constexpr bool | IsInitialized () const |
| Returns if the catalog cache has been initialized. More...
|
|
std::shared_ptr< const SysTable_Table > | FindTable (Oid tabid) |
|
Oid | FindTableByName (absl::string_view tabname) |
|
std::shared_ptr< const TableDesc > | FindTableDesc (Oid tabid) |
|
std::shared_ptr< const SysTable_Type > | FindType (Oid typid) |
|
std::string | GetTypeName (Oid typid) |
| Returns the type name of the specified type if it exists. More...
|
|
std::shared_ptr< const SysTable_Function > | FindFunction (Oid funcid) |
|
Oid | FindFunctionByName (absl::string_view funcname) |
|
std::shared_ptr< const SysTable_FunctionArgs > | FindFunctionArgs (Oid funcid, int16_t funcargid) |
|
std::shared_ptr< const SysTable_Index > | FindIndex (Oid idxid) |
|
Oid | FindIndexByName (absl::string_view idxname) |
|
std::vector< Oid > | FindAllIndexesOfTable (Oid idxtabid) |
|
std::shared_ptr< const IndexDesc > | FindIndexDesc (Oid idxid) |
|
Oid | FindOperator (OpType optype, Oid oparg0typid, Oid oparg1typid) |
| Returns the operator function id of the one with the specific operand types and operator type. More...
|
|
Oid | FindCast (Oid castoprtypid, Oid castrettypid, bool must_be_implicit) |
| Returns the cast function id of the one with the specific operand type and return type. More...
|
|
std::shared_ptr< const SysTable_Aggregation > | FindAggregation (Oid aggid) |
| Returns the aggregation systable struct for the aggregation with ID aggid . More...
|
|
Oid | FindAggregationByNameAndOprType (absl::string_view aggname, Oid aggoprtypid) |
| Returns the aggregation ID for the aggregation with the given name and aggregation operand type. More...
|
|
Oid | FindAggregationByTidAndOprType (AggType aggtyp, Oid aggoprtypid) |
| Returns the aggregation ID for the aggregation with the given type and operand type. More...
|
|
CCLookupTableEntry * | SearchForCatalogEntryByOid (Oid systabid, Oid idxid_hint, FieldId oid_colid, Oid oid) |
| Searches for the systable entry with ID recid in the given systable systabid . More...
|
|
CCLookupTableEntry * | SearchForCatalogEntryByName (Oid systabid, Oid idxid_hint, FieldId name_colid, absl::string_view name) |
| Searches for the systable entry with its name column at name_colid equals to name . More...
|
|
Oid | AddTable (absl::string_view tabname, std::vector< Oid > coltypid, std::vector< uint64_t > coltypparam, std::vector< std::string > field_names, std::vector< bool > colisnullable, std::vector< bool > colisarray, FileId tabfid) |
| Adds a table into the catalog. More...
|
|
Oid | AddIndex (absl::string_view idxname, Oid idxtabid, IdxType idxtyp, bool idxunique, std::vector< FieldId > idxcoltabcolids, FileId idxfid, std::vector< Oid > idxcolltfuncids, std::vector< Oid > idxcoleqfuncids) |
| Adds an index into the catalog. More...
|
|
|
void | CreateDBMeta () |
| Creates and initializes the database meta file. More...
|
|
absl::flat_hash_map< Oid, FileId > | LoadInitFile (const std::string &init_datafile, BootstrapCatCache *catcache) |
| Loads the init catalog file and writes them into the catalog files. More...
|
|
void | FinishInitCatalog (const absl::flat_hash_map< Oid, FileId > &tabid2fid, BootstrapCatCache *catcache) |
| Finishes the initialization of the catalog and updates the DB meta file if necessary. More...
|
|
void | LoadMinCache (BootstrapCatCache *catcache) |
| Loads the minimum set of the required catalog entries for initializing the cache. More...
|
|
void | CheckIndexes (bool init) |
| Checks if any of the catalog indexes need to be initialized and/or rebuilt. More...
|
|
void | BuildIndex (bool init, Oid idxid) |
|
Oid | AllocateOid () |
| Allocates an object ID. More...
|
|
template<bool no_cache> |
std::conditional< no_cache, std::unique_ptr< CCLookupTableEntry >, CCLookupTableEntry * >::type | GetOrCreateCachedEntry (Oid systabid, RecordId recid, const Schema *schema, const char *buf) |
| Returns the catalog entry in the systable by its table id and record id. More...
|
|
void | InsertCatalogEntries (Oid systabid, const std::vector< std::vector< Datum >> &data) |
| Inserts the new catalog entries in data into the systable systabid and also update all its indexes. More...
|
|
|
template<class T > |
std::vector< Datum > | GetDatumVector (const T &systable_struct) |
|
static std::shared_ptr< void > | CreateSysTableStruct (Oid tabid, const std::vector< Datum > &data) |
| Creates a SysTable_xxx struct for a row stored in a record payout in the specified table. More...
|
|
template<class T > |
static T * | CreateSysTableStruct (const std::vector< Datum > &data) |
| Creates a SysTable_xxx struct from a vector of data by invoking its Create() function. More...
|
|
template<class T > |
static T * | CopySysTableStruct (const T *s) |
|
template<class T , class ... Args> |
static T * | ConstructSysTableStruct (Args &&...args) |
| Constructs a SysTable_xxx struct from c++ values by invoking its constructor. More...
|
|
template<class CatCacheCls>
class taco::CatCacheBase< CatCacheCls >
CatCacheBase implements the common routines and public interfaces for accessing and modifying the system catalog files.
Internally it maintains a few caches of the catalog entries so all other components should always access the catalog files through the global catalog cache ‘g_catcache’.
It depends on its subclass CatCacheCls
to provide a fe functions for catalog file accesses. Currently we have two implementations: ‘VolatileCatCache’ which provides file accesses to virtual in-memory files, and ‘PersistentCatCache’ which provides file accsess to the regular files managed by the file manager. See these two classes for a list of required file access functions.
template<class CatCacheCls >
Checks if any of the catalog indexes need to be initialized and/or rebuilt.
If init
is true, it will go over all the entries in the Index systable; update them; initialize and load the new indexes.
Its behavior is also affected by g_test_no_index
and g_test_catcache_use_volatiletree
. See documents for those two global variables for details.
template<class CatCacheCls >
Returns the aggregation ID for the aggregation with the given name and aggregation operand type.
If there is no aggregation exactly match the name and operand type specified, this function will also search for an aggregation with the specified name but works on any operand types (one notable example is COUNT which only has a single implementation that works on all types).
Returns InvalidOid if no aggregation is found with the given name and may be applied to the specified operand type.
template<class CatCacheCls >
Returns the aggregation ID for the aggregation with the given type and operand type.
If there is no aggregation exactly match the aggregation type and operand type specified, this function will also search for an aggregation with the specified name but works on any types (one notable example is COUNT which only has a single implementation that works on all types).
Note that aggtyp
must not be AGGTYPE_OTHER, in which case the caller should use FindAggregationByNameAndOprType
instead. On the other hand, any aggregation that may be returned here can also be uniquely found by FindAggregationByNameAndOprType
. The only difference is that this is fast path where we can avoid case-insensitive string comparison here for those hard-coded aggregations.
Returns InvalidOid if no aggregation may be uniquely identified with the given aggregation type and operand type, or aggtyp == AGGTYPE_OTHER even if there is only one such aggregation.
template<class CatCacheCls >
Returns the cast function id of the one with the specific operand type and return type.
The third argument must_be_implicit
indicates whether the returned cast function must be implicit cast or not. If it is set to true
and the found cast function is not an implicit cast, this function returns InvalidOid instead. If it is set to false
, the returned cast function may be implicit or explicit.
It returns InvalidOid if there is no cast function from the operand type to the return type.