Class GlobalMetadataCache
Metadata cache with domain isolation.
Combines scheme caching and CLR type registry (former AutomaticTypeRegistry).
Instance is bound to specific domain, static data is shared.
Each domain (typically one per database connection) has isolated cache.
public class GlobalMetadataCache
Inheritance
Properties
IsClrTypeRegistryInitialized
Check if CLR type registry is initialized for this domain.
public bool IsClrTypeRegistryInitialized { get; }
Methods
CacheTypesById(IEnumerable<RedbTypeInfo>)
Bulk cache types by ID.
public void CacheTypesById(IEnumerable<RedbTypeInfo> types)
GetAllDomains()
Get list of all registered domains.
public static IReadOnlyCollection<string> GetAllDomains()
GetClrTypeStatistics()
Get CLR type registry statistics.
public (int SchemeNames, int SchemeIds) GetClrTypeStatistics()
Initialize(RedbServiceConfiguration)
Initialize cache settings from configuration.
public void Initialize(RedbServiceConfiguration configuration)
InitializeClrTypeRegistryAsync(ISchemeSyncProvider, ILogger?)
Initialize CLR type registry by scanning assemblies with RedbSchemeAttribute.
public Task InitializeClrTypeRegistryAsync(ISchemeSyncProvider schemeProvider, ILogger? logger = null)
RegisterClrType(string, long, Type)
Register CLR type mapping manually.
public void RegisterClrType(string schemeName, long schemeId, Type type)
ResetAllStatistics()
Reset statistics for all domains (static utility).
public static void ResetAllStatistics()
Constructors
GlobalMetadataCache(RedbServiceConfiguration)
Creates cache instance with domain from configuration.
GlobalMetadataCache(string?)
Creates cache instance bound to specific domain.