MCPcopy Create free account
hub / github.com/apache/cloudberry / InitializeTableSpaceCache

Function InitializeTableSpaceCache

src/backend/utils/cache/spccache.c:69–89  ·  view source on GitHub ↗

* InitializeTableSpaceCache * Initialize the tablespace cache. */

Source from the content-addressed store, hash-verified

67 * Initialize the tablespace cache.
68 */
69static void
70InitializeTableSpaceCache(void)
71{
72 HASHCTL ctl;
73
74 /* Initialize the hash table. */
75 ctl.keysize = sizeof(Oid);
76 ctl.entrysize = sizeof(TableSpaceCacheEntry);
77 TableSpaceCacheHash =
78 hash_create("TableSpace cache", 16, &ctl,
79 HASH_ELEM | HASH_BLOBS);
80
81 /* Make sure we've initialized CacheMemoryContext. */
82 if (!CacheMemoryContext)
83 CreateCacheMemoryContext();
84
85 /* Watch for invalidation events. */
86 CacheRegisterSyscacheCallback(TABLESPACEOID,
87 InvalidateTableSpaceCacheCallback,
88 (Datum) 0);
89}
90
91/*
92 * get_tablespace

Callers 1

get_tablespaceFunction · 0.85

Calls 3

hash_createFunction · 0.85
CreateCacheMemoryContextFunction · 0.85

Tested by

no test coverage detected