Esempio n. 1
0
        public ManagedIndex(AzureBackingStore backingStore, IRegisteredIndexer registeredIndexer)
        {
            this.backingStore = backingStore;
            this.registeredIndexer = registeredIndexer;

            indexCompiled = new EventWaitHandle(false, EventResetMode.ManualReset);
            tableName = safeTableName(registeredIndexer.IndexName);
        }
        protected override void WithContext()
        {
            CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist(AzureBackingStore.ConcreteTypeTableName);
            CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist("idxStashEngineStashTypeHierarchy");
            CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist("rdxStashEngineStashTypeHierarchy");

            Subject = new AzureBackingStore(CloudStorageAccount.DevelopmentStorageAccount, new NoConcurrencyProtection());
            Registry = new Registry(Subject);
            var typeHierarchyIndexer = new RegisteredIndexer<Type, string>(new StashTypeHierarchy(), Registry);
            Registry.RegisteredIndexers.Add(typeHierarchyIndexer);

            Subject.EnsureIndex(typeHierarchyIndexer);
        }