Exemplo n.º 1
0
        /// <summary>
        /// Create the caches that
        /// </summary>
        private void InstantiateRebuildSiteModelCacheReferences()
        {
            mutableTRexGrid.GetOrCreateCache <INonSpatialAffinityKey, IRebuildSiteModelMetaData>(new CacheConfiguration
            {
                Name = TRexCaches.SiteModelRebuilderMetaDataCacheName(),
                KeepBinaryInStore = true,
                CacheMode         = CacheMode.Partitioned,
                AffinityFunction  = new MutableNonSpatialAffinityFunction(),
                Backups           = 0,
                DataRegionName    = DataRegions.MUTABLE_NONSPATIAL_DATA_REGION
            });

            mutableTRexGrid.GetOrCreateCache <INonSpatialAffinityKey, ISerialisedByteArrayWrapper>(new CacheConfiguration
            {
                Name = TRexCaches.SiteModelRebuilderFileKeyCollectionsCacheName(),
                KeepBinaryInStore = true,
                CacheMode         = CacheMode.Partitioned,
                AffinityFunction  = new MutableNonSpatialAffinityFunction(),
                Backups           = 0,
                DataRegionName    = DataRegions.MUTABLE_NONSPATIAL_DATA_REGION
            });
        }
Exemplo n.º 2
0
        private static IStorageProxyCacheCommit CacheFactory(RebuildSiteModelCacheType cacheType)
        {
            return(cacheType switch
            {
                RebuildSiteModelCacheType.Metadata =>
                new StorageProxyCache <INonSpatialAffinityKey, IRebuildSiteModelMetaData>(DIContext.Obtain <ITRexGridFactory>().Grid(StorageMutability.Mutable)?
                                                                                          .GetCache <INonSpatialAffinityKey, IRebuildSiteModelMetaData>(TRexCaches.SiteModelRebuilderMetaDataCacheName())),

                RebuildSiteModelCacheType.KeyCollections =>
                new StorageProxyCache <INonSpatialAffinityKey, ISerialisedByteArrayWrapper>(DIContext.Obtain <ITRexGridFactory>().Grid(StorageMutability.Mutable)?
                                                                                            .GetCache <INonSpatialAffinityKey, ISerialisedByteArrayWrapper>(TRexCaches.SiteModelRebuilderFileKeyCollectionsCacheName())),

                _ => throw new TRexException($"Unknown rebuild site model cache type: {cacheType}")
            });