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

Function init_ts_config_cache

src/backend/utils/cache/ts_cache.c:361–379  ·  view source on GitHub ↗

* Initialize config cache and prepare callbacks. This is split out of * lookup_ts_config_cache because we need to activate the callback before * caching TSCurrentConfigCache, too. */

Source from the content-addressed store, hash-verified

359 * caching TSCurrentConfigCache, too.
360 */
361static void
362init_ts_config_cache(void)
363{
364 HASHCTL ctl;
365
366 ctl.keysize = sizeof(Oid);
367 ctl.entrysize = sizeof(TSConfigCacheEntry);
368 TSConfigCacheHash = hash_create("Tsearch configuration cache", 16,
369 &ctl, HASH_ELEM | HASH_BLOBS);
370 /* Flush cache on pg_ts_config and pg_ts_config_map changes */
371 CacheRegisterSyscacheCallback(TSCONFIGOID, InvalidateTSCacheCallBack,
372 PointerGetDatum(TSConfigCacheHash));
373 CacheRegisterSyscacheCallback(TSCONFIGMAP, InvalidateTSCacheCallBack,
374 PointerGetDatum(TSConfigCacheHash));
375
376 /* Also make sure CacheMemoryContext exists */
377 if (!CacheMemoryContext)
378 CreateCacheMemoryContext();
379}
380
381/*
382 * Fetch configuration cache entry

Callers 2

lookup_ts_config_cacheFunction · 0.85
getTSCurrentConfigFunction · 0.85

Calls 3

hash_createFunction · 0.85
CreateCacheMemoryContextFunction · 0.85

Tested by

no test coverage detected