internal virtual IndexPopulation AddPopulator(IndexPopulator populator, CapableIndexDescriptor capableIndexDescriptor, FlippableIndexProxy flipper, FailedIndexProxyFactory failedIndexProxyFactory, string indexUserDescription) { IndexPopulation population = CreatePopulation(populator, capableIndexDescriptor, flipper, failedIndexProxyFactory, indexUserDescription); Populations.Add(population); return(population); }
internal virtual void AddSchemaRule(SchemaRule rule) { if (rule is ConstraintRule) { ConstraintRule constraintRule = ( ConstraintRule )rule; ConstraintRuleById.put(constraintRule.Id, constraintRule); ConstraintsConflict.Add(ConstraintSemantics.readConstraint(constraintRule)); } else if (rule is StoreIndexDescriptor) { CapableIndexDescriptor index = IndexProviderMap.withCapabilities(( StoreIndexDescriptor )rule); IndexDescriptorById.put(index.Id, index); SchemaDescriptor schemaDescriptor = index.Schema(); IndexDescriptorsConflict[schemaDescriptor] = index; IndexDescriptorsByName[rule.Name] = index; foreach (int entityTokenId in schemaDescriptor.EntityTokenIds) { //JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter: ISet <CapableIndexDescriptor> forLabel = IndexDescriptorsByLabel.getIfAbsentPut(entityTokenId, HashSet <object>::new); forLabel.Add(index); } foreach (int propertyId in index.Schema().PropertyIds) { //JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter: IList <CapableIndexDescriptor> indexesForProperty = IndexByProperty.getIfAbsentPut(propertyId, List <object>::new); indexesForProperty.Add(index); } } }
internal FailedIndexProxy(CapableIndexDescriptor capableIndexDescriptor, string indexUserDescription, IndexPopulator populator, IndexPopulationFailure populationFailure, IndexCountsRemover indexCountsRemover, LogProvider logProvider) : base(capableIndexDescriptor, populationFailure) { this.Populator = populator; this._indexUserDescription = indexUserDescription; this._indexCountsRemover = indexCountsRemover; this._log = logProvider.getLog(this.GetType()); }
internal FailedPopulatingIndexProxyFactory(CapableIndexDescriptor capableIndexDescriptor, IndexPopulator populator, string indexUserDescription, IndexCountsRemover indexCountsRemover, LogProvider logProvider) { this._capableIndexDescriptor = capableIndexDescriptor; this._populator = populator; this._indexUserDescription = indexUserDescription; this._indexCountsRemover = indexCountsRemover; this._logProvider = logProvider; }
internal OnlineIndexProxy(CapableIndexDescriptor capableIndexDescriptor, IndexAccessor accessor, IndexStoreView storeView, bool forcedIdempotentMode) { Debug.Assert(accessor != null); this._indexId = capableIndexDescriptor.Id; this._capableIndexDescriptor = capableIndexDescriptor; this.Accessor = accessor; this._storeView = storeView; this._forcedIdempotentMode = forcedIdempotentMode; this._indexCountsRemover = new IndexCountsRemover(storeView, _indexId); }
internal IndexPopulation(MultipleIndexPopulator outerInstance, IndexPopulator populator, CapableIndexDescriptor capableIndexDescriptor, FlippableIndexProxy flipper, FailedIndexProxyFactory failedIndexProxyFactory, string indexUserDescription) { this._outerInstance = outerInstance; this.Populator = populator; this.CapableIndexDescriptor = capableIndexDescriptor; this.IndexId = capableIndexDescriptor.Id; this.Flipper = flipper; this.FailedIndexProxyFactory = failedIndexProxyFactory; this.IndexUserDescription = indexUserDescription; this.IndexCountsRemover = new IndexCountsRemover(outerInstance.storeView, IndexId); //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: this.batchedUpdates = new java.util.ArrayList<>(BATCH_SIZE); this.BatchedUpdates = new List <IndexEntryUpdate <object> >(outerInstance.BatchSize); }
internal virtual void RemoveSchemaRule(long id) { if (ConstraintRuleById.containsKey(id)) { ConstraintRule rule = ConstraintRuleById.remove(id); ConstraintsConflict.remove(rule.ConstraintDescriptor); } else if (IndexDescriptorById.containsKey(id)) { CapableIndexDescriptor index = IndexDescriptorById.remove(id); SchemaDescriptor schema = index.Schema(); IndexDescriptorsConflict.Remove(schema); IndexDescriptorsByName.Remove(index.Name, index); foreach (int entityTokenId in Schema.EntityTokenIds) { ISet <CapableIndexDescriptor> forLabel = IndexDescriptorsByLabel.get(entityTokenId); /* Previously, a bug made it possible to create fulltext indexes with repeated labels or relationship types * which would cause us to try and remove the same entity token twice which could cause a NPE if the 'forLabel' * set would be empty after the first removal such that the set would be completely removed from 'indexDescriptorsByLabel'. * Fixed as of 3.5.10 */ if (forLabel != null) { forLabel.remove(index); if (forLabel.Count == 0) { IndexDescriptorsByLabel.remove(entityTokenId); } } } foreach (int propertyId in index.Schema().PropertyIds) { IList <CapableIndexDescriptor> forProperty = IndexByProperty.get(propertyId); forProperty.Remove(index); if (forProperty.Count == 0) { IndexByProperty.remove(propertyId); } } } }
private IndexPopulation CreatePopulation(IndexPopulator populator, CapableIndexDescriptor capableIndexDescriptor, FlippableIndexProxy flipper, FailedIndexProxyFactory failedIndexProxyFactory, string indexUserDescription) { return(new IndexPopulation(this, populator, capableIndexDescriptor, flipper, failedIndexProxyFactory, indexUserDescription)); }
/// <summary> /// Adds an <seealso cref="IndexPopulator"/> to be populated in this store scan. All participating populators must /// be added before calling <seealso cref="run()"/>. </summary> /// <param name="populator"> <seealso cref="IndexPopulator"/> to participate. </param> /// <param name="capableIndexDescriptor"> <seealso cref="CapableIndexDescriptor"/> meta information about index. </param> /// <param name="indexUserDescription"> user description of this index. </param> /// <param name="flipper"> <seealso cref="FlippableIndexProxy"/> to call after a successful population. </param> /// <param name="failedIndexProxyFactory"> <seealso cref="FailedIndexProxyFactory"/> to use after an unsuccessful population. </param> internal virtual MultipleIndexPopulator.IndexPopulation AddPopulator(IndexPopulator populator, CapableIndexDescriptor capableIndexDescriptor, string indexUserDescription, FlippableIndexProxy flipper, FailedIndexProxyFactory failedIndexProxyFactory) { Debug.Assert(_storeScan == null, "Population have already started, too late to add populators at this point"); return(this._multiPopulator.addPopulator(populator, capableIndexDescriptor, flipper, failedIndexProxyFactory, indexUserDescription)); }
internal RecoveringIndexProxy(CapableIndexDescriptor capableIndexDescriptor) : base(capableIndexDescriptor, null) { }
internal PopulatingIndexProxy(CapableIndexDescriptor capableIndexDescriptor, IndexPopulationJob job, MultipleIndexPopulator.IndexPopulation indexPopulation) { this._capableIndexDescriptor = capableIndexDescriptor; this._job = job; this._indexPopulation = indexPopulation; }
internal AbstractSwallowingIndexProxy(CapableIndexDescriptor capableIndexDescriptor, IndexPopulationFailure populationFailure) { this._capableIndexDescriptor = capableIndexDescriptor; this._populationFailure = populationFailure; }
internal TestIndexProxy(IndexMapTest outerInstance, CapableIndexDescriptor descriptor) { this._outerInstance = outerInstance; this.DescriptorConflict = descriptor; }