Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: IndexProxy createPopulatingIndexProxy(final org.neo4j.storageengine.api.schema.StoreIndexDescriptor descriptor, final boolean flipToTentative, final IndexingService.Monitor monitor, final IndexPopulationJob populationJob)
        internal virtual IndexProxy CreatePopulatingIndexProxy(StoreIndexDescriptor descriptor, bool flipToTentative, IndexingService.Monitor monitor, IndexPopulationJob populationJob)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final FlippableIndexProxy flipper = new FlippableIndexProxy();
            FlippableIndexProxy flipper = new FlippableIndexProxy();

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String indexUserDescription = indexUserDescription(descriptor);
            string                 indexUserDescription   = indexUserDescription(descriptor);
            IndexPopulator         populator              = PopulatorFromProvider(descriptor, _samplingConfig, populationJob.BufferFactory());
            CapableIndexDescriptor capableIndexDescriptor = _providerMap.withCapabilities(descriptor);

            FailedIndexProxyFactory failureDelegateFactory = new FailedPopulatingIndexProxyFactory(capableIndexDescriptor, populator, indexUserDescription, new IndexCountsRemover(_storeView, descriptor.Id), _logProvider);

            MultipleIndexPopulator.IndexPopulation indexPopulation = populationJob.AddPopulator(populator, capableIndexDescriptor, indexUserDescription, flipper, failureDelegateFactory);
            PopulatingIndexProxy populatingIndex = new PopulatingIndexProxy(capableIndexDescriptor, populationJob, indexPopulation);

            flipper.FlipTo(populatingIndex);

            // Prepare for flipping to online mode
            flipper.FlipTarget = () =>
            {
                monitor.PopulationCompleteOn(descriptor);
                IndexAccessor    accessor    = OnlineAccessorFromProvider(descriptor, _samplingConfig);
                OnlineIndexProxy onlineProxy = new OnlineIndexProxy(capableIndexDescriptor, accessor, _storeView, true);
                if (flipToTentative)
                {
                    return(new TentativeConstraintIndexProxy(flipper, onlineProxy));
                }
                return(onlineProxy);
            };

            return(new ContractCheckingIndexProxy(flipper, false));
        }
Esempio n. 2
0
            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);
                    }
                }
            }