Пример #1
0
 public IndexPopulationJob(MultipleIndexPopulator multiPopulator, IndexingService.Monitor monitor, bool verifyBeforeFlipping)
 {
     this._multiPopulator          = multiPopulator;
     this._monitor                 = monitor;
     this._verifyBeforeFlipping    = verifyBeforeFlipping;
     this._memoryAllocationTracker = new ThreadSafePeakMemoryAllocationTracker(GlobalMemoryTracker.INSTANCE);
     this._bufferFactory           = new ByteBufferFactory(() => new UnsafeDirectByteBufferAllocator(_memoryAllocationTracker), parseBlockSize());
 }
Пример #2
0
        private IndexPopulationJob NewIndexPopulationJob(FailedIndexProxyFactory failureDelegateFactory, IndexPopulator populator, FlippableIndexProxy flipper, IndexStoreView storeView, LogProvider logProvider, EntityType type, IndexDescriptor descriptor)
        {
            long indexId = 0;

            flipper.FlipTarget = mock(typeof(IndexProxyFactory));

            MultipleIndexPopulator multiPopulator = new MultipleIndexPopulator(storeView, logProvider, type, _stateHolder);
            IndexPopulationJob     job            = new IndexPopulationJob(multiPopulator, NO_MONITOR, false);

            job.AddPopulator(populator, descriptor.WithId(indexId).withoutCapabilities(), format(":%s(%s)", _first.name(), _name), flipper, failureDelegateFactory);
            return(job);
        }
Пример #3
0
            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);
            }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void updateForHigherNodeIgnoredWhenUsingFullNodeStoreScan() throws org.neo4j.kernel.api.exceptions.index.IndexPopulationFailedKernelException, java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UpdateForHigherNodeIgnoredWhenUsingFullNodeStoreScan()
        {
            NeoStores neoStores = Mockito.mock(typeof(NeoStores));
            NodeStore nodeStore = mock(typeof(NodeStore));

            when(neoStores.NodeStore).thenReturn(nodeStore);

            ProcessListenableNeoStoreIndexView storeView      = new ProcessListenableNeoStoreIndexView(this, LockService.NO_LOCK_SERVICE, neoStores);
            MultipleIndexPopulator             indexPopulator = new MultipleIndexPopulator(storeView, _logProvider, EntityType.NODE, mock(typeof(SchemaState)));

            storeView.ProcessListener = new NodeUpdateProcessListener(indexPopulator);

            IndexPopulator populator    = CreateIndexPopulator();
            IndexUpdater   indexUpdater = mock(typeof(IndexUpdater));

            AddPopulator(indexPopulator, populator, 1, TestIndexDescriptorFactory.forLabel(1, 1));

            indexPopulator.Create();
            StoreScan <IndexPopulationFailedKernelException> storeScan = indexPopulator.IndexAllEntities();

            storeScan.Run();

            Mockito.verify(indexUpdater, never()).process(any(typeof(IndexEntryUpdate)));
        }
Пример #5
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);
        }
Пример #6
0
 internal NodeUpdateProcessListener(MultipleIndexPopulator indexPopulator)
 {
     this.IndexPopulator = indexPopulator;
     this.Index          = SchemaDescriptorFactory.forLabel(1, 1);
 }
Пример #7
0
 private MultipleIndexPopulator.IndexPopulation AddPopulator(MultipleIndexPopulator multipleIndexPopulator, StoreIndexDescriptor descriptor, IndexPopulator indexPopulator, FlippableIndexProxy flippableIndexProxy, FailedIndexProxyFactory failedIndexProxyFactory)
 {
     return(multipleIndexPopulator.AddPopulator(indexPopulator, descriptor.WithoutCapabilities(), flippableIndexProxy, failedIndexProxyFactory, "userIndexDescription"));
 }
Пример #8
0
 private MultipleIndexPopulator.IndexPopulation AddPopulator(MultipleIndexPopulator multipleIndexPopulator, IndexPopulator indexPopulator, long indexId, IndexDescriptor descriptor)
 {
     return(AddPopulator(multipleIndexPopulator, descriptor.WithId(indexId), indexPopulator, mock(typeof(FlippableIndexProxy)), mock(typeof(FailedIndexProxyFactory))));
 }
Пример #9
0
 private IndexPopulation AddPopulator(MultipleIndexPopulator multipleIndexPopulator, IndexPopulator indexPopulator, int id, FlippableIndexProxy flippableIndexProxy, FailedIndexProxyFactory failedIndexProxyFactory)
 {
     return(AddPopulator(multipleIndexPopulator, TestIndexDescriptorFactory.forLabel(id, id).withId(id), indexPopulator, flippableIndexProxy, failedIndexProxyFactory));
 }
Пример #10
0
 public EntityPopulationVisitor(MultipleIndexPopulator outerInstance)
 {
     this._outerInstance = outerInstance;
 }
Пример #11
0
 internal MultipleIndexUpdater(MultipleIndexPopulator multipleIndexPopulator, IDictionary <SchemaDescriptor, Pair <IndexPopulation, IndexUpdater> > populationsWithUpdaters, LogProvider logProvider)
 {
     this.MultipleIndexPopulator  = multipleIndexPopulator;
     this.PopulationsWithUpdaters = populationsWithUpdaters;
     this.Log = logProvider.getLog(this.GetType());
 }
Пример #12
0
 public DelegatingStoreScanAnonymousInnerClass(MultipleIndexPopulator outerInstance, Org.Neo4j.Kernel.Impl.Api.index.StoreScan <IndexPopulationFailedKernelException> storeScan) : base(storeScan)
 {
     this.outerInstance = outerInstance;
 }