Ejemplo 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));
        }
Ejemplo n.º 2
0
        internal virtual PopulationProgress GetPopulationProgress(MultipleIndexPopulator.IndexPopulation indexPopulation)
        {
            if (_storeScan == null)
            {
                // indexing hasn't begun yet
                return(Org.Neo4j.Storageengine.Api.schema.PopulationProgress_Fields.None);
            }
            PopulationProgress storeScanProgress = _storeScan.Progress;

            return(indexPopulation.Progress(storeScanProgress));
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustFlipToFailedIfFailureToApplyLastBatchWhileFlipping() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustFlipToFailedIfFailureToApplyLastBatchWhileFlipping()
        {
            // given
            NullLogProvider logProvider = NullLogProvider.Instance;
            IndexStoreView  storeView   = EmptyIndexStoreViewThatProcessUpdates();

            Org.Neo4j.Kernel.Api.Index.IndexPopulator_Adapter populator = EmptyPopulatorWithThrowingUpdater();
            FailedIndexProxy    failedProxy = FailedIndexProxy(storeView, populator);
            OnlineIndexProxy    onlineProxy = OnlineIndexProxy(storeView);
            FlippableIndexProxy flipper     = new FlippableIndexProxy();

            flipper.FlipTarget = () => onlineProxy;
            MultipleIndexPopulator multipleIndexPopulator = new MultipleIndexPopulator(storeView, logProvider, EntityType.NODE, mock(typeof(SchemaState)));

            MultipleIndexPopulator.IndexPopulation indexPopulation = multipleIndexPopulator.AddPopulator(populator, DummyMeta(), flipper, t => failedProxy, "userDescription");
            multipleIndexPopulator.QueueUpdate(SomeUpdate());
            multipleIndexPopulator.IndexAllEntities().run();

            // when
            indexPopulation.Flip(false);

            // then
            assertSame("flipper should have flipped to failing proxy", flipper.State, InternalIndexState.FAILED);
        }
Ejemplo n.º 4
0
 internal virtual void DropPopulation(MultipleIndexPopulator.IndexPopulation population)
 {
     _multiPopulator.dropIndexPopulation(population);
 }
Ejemplo n.º 5
0
 internal virtual void CancelPopulation(MultipleIndexPopulator.IndexPopulation population)
 {
     _multiPopulator.cancelIndexPopulation(population);
 }
Ejemplo n.º 6
0
 internal PopulatingIndexProxy(CapableIndexDescriptor capableIndexDescriptor, IndexPopulationJob job, MultipleIndexPopulator.IndexPopulation indexPopulation)
 {
     this._capableIndexDescriptor = capableIndexDescriptor;
     this._job             = job;
     this._indexPopulation = indexPopulation;
 }