Ejemplo n.º 1
0
        public DIIgniteServers()
        {
            // Create a set of mocked configurations for caches the servers was want
            var mockedConfigs = new List <CacheConfiguration>
            {
                new CacheConfiguration(TRexCaches.MutableNonSpatialCacheName()),
                new CacheConfiguration(TRexCaches.SpatialSubGridDirectoryCacheName(StorageMutability.Mutable)),
                new CacheConfiguration(TRexCaches.SpatialSubGridDirectoryCacheName(StorageMutability.Immutable)),
                new CacheConfiguration(TRexCaches.SpatialSubGridSegmentCacheName(StorageMutability.Mutable)),
                new CacheConfiguration(TRexCaches.SpatialSubGridSegmentCacheName(StorageMutability.Immutable)),
                new CacheConfiguration(TRexCaches.ImmutableNonSpatialCacheName()),
                new CacheConfiguration(TRexCaches.SiteModelMetadataCacheName()),
                new CacheConfiguration(TRexCaches.DesignTopologyExistenceMapsCacheName()),
                new CacheConfiguration(TRexCaches.TAGFileBufferQueueCacheName()),
                new CacheConfiguration(TRexCaches.SegmentRetirementQueueCacheName()),
                new CacheConfiguration(TRexCaches.SiteModelChangeBufferQueueCacheName()),
                new CacheConfiguration(TRexCaches.ProductionDataExistenceMapCacheName(StorageMutability.Mutable)),
                new CacheConfiguration(TRexCaches.ProductionDataExistenceMapCacheName(StorageMutability.Mutable))
            };

            var igniteConfiguration = new IgniteConfiguration
            {
                CacheConfiguration = mockedConfigs
            };

            // Get the mocked Ignite instance and add the configuration to it
            IgniteMock.Immutable.mockIgnite.Setup(x => x.GetConfiguration()).Returns(igniteConfiguration);
            IgniteMock.Mutable.mockIgnite.Setup(x => x.GetConfiguration()).Returns(igniteConfiguration);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a site model meta data manager instance oriented to the TRex grid that is the primary grid
        /// referenced by the DI'd SiteModels instance
        /// </summary>
        public SiteModelMetadataManager(StorageMutability mutability)
        {
            // Obtain the ignite reference for the primary grid orientation of SiteModels
            var ignite = DIContext.Obtain <ITRexGridFactory>()?.Grid(mutability);

            metaDataCache = ignite?.GetOrCreateCache <Guid, ISiteModelMetadata>(ConfigureCache());

            if (metaDataCache == null)
            {
                throw new TRexException($"Failed to get or create Ignite cache {TRexCaches.SiteModelMetadataCacheName()}, ignite reference is {ignite}");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Configure the parameters of the existence map cache
        /// </summary>
        private CacheConfiguration ConfigureCache()
        {
            return(new CacheConfiguration
            {
                Name = TRexCaches.SiteModelMetadataCacheName(),

                // cfg.CopyOnRead = false;   Leave as default as should have no effect with 2.1+ without on heap caching enabled
                KeepBinaryInStore = true,

                // Replicate the site model metadata across nodes
                CacheMode = CacheMode.Replicated,

                Backups = 0, // No backups needed as it is a replicated cache

                DataRegionName = DataRegions.MUTABLE_NONSPATIAL_DATA_REGION
            });
        }
Ejemplo n.º 4
0
 public void NonNullNames()
 {
     TRexCaches.DesignTopologyExistenceMapsCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.ImmutableNonSpatialCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.SpatialSubGridDirectoryCacheName(StorageMutability.Immutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.SpatialSubGridDirectoryCacheName(StorageMutability.Mutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.SpatialSubGridSegmentCacheName(StorageMutability.Immutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.SpatialSubGridSegmentCacheName(StorageMutability.Mutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.MutableNonSpatialCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.SegmentRetirementQueueCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.SiteModelMetadataCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.SiteModelsCacheName(StorageMutability.Immutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.SiteModelsCacheName(StorageMutability.Mutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.TAGFileBufferQueueCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.SiteModelChangeMapsCacheName().Should().NotBeNullOrWhiteSpace();
     TRexCaches.ProductionDataExistenceMapCacheName(StorageMutability.Immutable).Should().NotBeNullOrWhiteSpace();
     TRexCaches.ProductionDataExistenceMapCacheName(StorageMutability.Mutable).Should().NotBeNullOrWhiteSpace();
 }