Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testSchemaIndexMatchIndexingService() throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestSchemaIndexMatchIndexingService()
        {
            using (Transaction transaction = _database.beginTx())
            {
                _database.schema().constraintFor(Label.label(CLOTHES_LABEL)).assertPropertyIsUnique(PROPERTY_NAME).create();
                _database.schema().indexFor(Label.label(WEATHER_LABEL)).on(PROPERTY_NAME).create();

                transaction.Success();
            }

            using (Transaction ignored = _database.beginTx())
            {
                _database.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
            }

            IndexingService indexingService = GetIndexingService(_database);
            int             clothedLabelId  = GetLabelId(CLOTHES_LABEL);
            int             weatherLabelId  = GetLabelId(WEATHER_LABEL);
            int             propertyId      = GetPropertyKeyId(PROPERTY_NAME);

            IndexProxy clothesIndex = indexingService.getIndexProxy(forLabel(clothedLabelId, propertyId));
            IndexProxy weatherIndex = indexingService.getIndexProxy(forLabel(weatherLabelId, propertyId));

            assertEquals(InternalIndexState.ONLINE, clothesIndex.State);
            assertEquals(InternalIndexState.ONLINE, weatherIndex.State);
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void awaitOnline(org.neo4j.kernel.impl.api.index.IndexProxy index) throws InterruptedException
        private void AwaitOnline(IndexProxy index)
        {
            while (index.State == InternalIndexState.POPULATING)
            {
                Thread.Sleep(10);
            }
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReleaseLabelLockWhileAwaitingIndexPopulation() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReleaseLabelLockWhileAwaitingIndexPopulation()
        {
            // given
            StubKernel      kernel          = new StubKernel(this);
            IndexingService indexingService = mock(typeof(IndexingService));

            NodePropertyAccessor nodePropertyAccessor = mock(typeof(NodePropertyAccessor));

            when(_schemaRead.indexGetCommittedId(_indexReference)).thenReturn(INDEX_ID);
            IndexProxy indexProxy = mock(typeof(IndexProxy));

            when(indexingService.getIndexProxy(anyLong())).thenReturn(indexProxy);
            when(indexingService.getIndexProxy(_descriptor)).thenReturn(indexProxy);

            when(_schemaRead.index(LABEL_ID, PROPERTY_KEY_ID)).thenReturn(IndexReference.NO_INDEX);

            ConstraintIndexCreator creator = new ConstraintIndexCreator(() => kernel, indexingService, nodePropertyAccessor, _logProvider);

            // when
            KernelTransactionImplementation transaction = CreateTransaction();

            creator.CreateUniquenessConstraintIndex(transaction, _descriptor, DefaultProvider);

            // then
            verify(transaction.StatementLocks().pessimistic()).releaseExclusive(ResourceTypes.LABEL, _descriptor.LabelId);

            verify(transaction.StatementLocks().pessimistic()).acquireExclusive(transaction.LockTracer(), ResourceTypes.LABEL, _descriptor.LabelId);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReuseExistingOrphanedConstraintIndex() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReuseExistingOrphanedConstraintIndex()
        {
            // given
            IndexingService indexingService = mock(typeof(IndexingService));
            StubKernel      kernel          = new StubKernel(this);

            long orphanedConstraintIndexId = 111;

            when(_schemaRead.indexGetCommittedId(_indexReference)).thenReturn(orphanedConstraintIndexId);
            IndexProxy indexProxy = mock(typeof(IndexProxy));

            when(indexingService.GetIndexProxy(orphanedConstraintIndexId)).thenReturn(indexProxy);
            NodePropertyAccessor nodePropertyAccessor = mock(typeof(NodePropertyAccessor));

            when(_schemaRead.index(_descriptor)).thenReturn(_indexReference);
            when(_schemaRead.indexGetOwningUniquenessConstraintId(_indexReference)).thenReturn(null);                     // which means it has no owner
            ConstraintIndexCreator creator = new ConstraintIndexCreator(() => kernel, indexingService, nodePropertyAccessor, _logProvider);

            // when
            KernelTransactionImplementation transaction = CreateTransaction();
            long indexId = creator.CreateUniquenessConstraintIndex(transaction, _descriptor, DefaultProvider);

            // then
            assertEquals(orphanedConstraintIndexId, indexId);
            assertEquals("There should have been no need to acquire a statement to create the constraint index", 0, kernel.Transactions.Count);
            verify(_schemaRead).indexGetCommittedId(_indexReference);
            verify(_schemaRead).index(_descriptor);
            verify(_schemaRead).indexGetOwningUniquenessConstraintId(_indexReference);
            verifyNoMoreInteractions(_schemaRead);
            verify(indexProxy).awaitStoreScanCompleted(anyLong(), any());
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.internal.kernel.api.IndexReference getOrCreateUniquenessConstraintIndex(org.neo4j.internal.kernel.api.SchemaRead schemaRead, org.neo4j.internal.kernel.api.TokenRead tokenRead, org.neo4j.internal.kernel.api.schema.SchemaDescriptor schema, String provider) throws org.neo4j.internal.kernel.api.exceptions.schema.SchemaKernelException, org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        private IndexReference GetOrCreateUniquenessConstraintIndex(SchemaRead schemaRead, TokenRead tokenRead, SchemaDescriptor schema, string provider)
        {
            IndexReference descriptor = schemaRead.Index(schema);

            if (descriptor != IndexReference.NO_INDEX)
            {
                if (descriptor.Unique)
                {
                    // OK so we found a matching constraint index. We check whether or not it has an owner
                    // because this may have been a left-over constraint index from a previously failed
                    // constraint creation, due to crash or similar, hence the missing owner.
                    if (schemaRead.IndexGetOwningUniquenessConstraintId(descriptor) == null)
                    {
                        return(descriptor);
                    }
                    throw new AlreadyConstrainedException(ConstraintDescriptorFactory.uniqueForSchema(schema), SchemaKernelException.OperationContext.CONSTRAINT_CREATION, new SilentTokenNameLookup(tokenRead));
                }
                // There's already an index for this schema descriptor, which isn't of the type we're after.
                throw new AlreadyIndexedException(schema, CONSTRAINT_CREATION);
            }
            IndexDescriptor indexDescriptor = CreateConstraintIndex(schema, provider);
            IndexProxy      indexProxy      = _indexingService.getIndexProxy(indexDescriptor.Schema());

            return(indexProxy.Descriptor);
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustDiscoverRelationshipInStoreMissingFromIndex() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustDiscoverRelationshipInStoreMissingFromIndex()
        {
            GraphDatabaseService db = CreateDatabase();

            using (Transaction tx = Db.beginTx())
            {
                Db.execute(format(RELATIONSHIP_CREATE, "rels", array("REL"), array("prop"))).close();
                tx.Success();
            }
            StoreIndexDescriptor indexDescriptor;
            long relId;

            using (Transaction tx = Db.beginTx())
            {
                Db.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
                indexDescriptor = GetIndexDescriptor(first(Db.schema().Indexes));
                Node         node = Db.createNode();
                Relationship rel  = node.CreateRelationshipTo(node, RelationshipType.withName("REL"));
                rel.SetProperty("prop", "value");
                relId = rel.Id;
                tx.Success();
            }
            IndexingService indexes    = GetIndexingService(db);
            IndexProxy      indexProxy = indexes.GetIndexProxy(indexDescriptor.Schema());

            using (IndexUpdater updater = indexProxy.NewUpdater(IndexUpdateMode.ONLINE))
            {
                updater.Process(IndexEntryUpdate.remove(relId, indexDescriptor, Values.stringValue("value")));
            }

            Db.shutdown();

            ConsistencyCheckService.Result result = CheckConsistency();
            assertFalse(result.Successful);
        }
Beispiel #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void before()
        public virtual void Before()
        {
            _indexMap = new IndexMap();

            _indexProxy1            = mock(typeof(IndexProxy));
            _schemaIndexDescriptor1 = forSchema(forLabel(2, 3), PROVIDER_DESCRIPTOR).withId(0).withoutCapabilities();
            _indexUpdater1          = mock(typeof(IndexUpdater));
            when(_indexProxy1.Descriptor).thenReturn(_schemaIndexDescriptor1);
            when(_indexProxy1.newUpdater(any(typeof(IndexUpdateMode)))).thenReturn(_indexUpdater1);

            _indexProxy2            = mock(typeof(IndexProxy));
            _schemaIndexDescriptor2 = forSchema(forLabel(5, 6), PROVIDER_DESCRIPTOR).withId(1).withoutCapabilities();
            IndexUpdater indexUpdater2 = mock(typeof(IndexUpdater));

            when(_indexProxy2.Descriptor).thenReturn(_schemaIndexDescriptor2);
            when(_indexProxy2.newUpdater(any(typeof(IndexUpdateMode)))).thenReturn(indexUpdater2);

            _indexProxy3            = mock(typeof(IndexProxy));
            _schemaIndexDescriptor3 = forSchema(forLabel(5, 7, 8), PROVIDER_DESCRIPTOR).withId(2).withoutCapabilities();
            IndexUpdater indexUpdater3 = mock(typeof(IndexUpdater));

            when(_indexProxy3.Descriptor).thenReturn(_schemaIndexDescriptor3);
            when(_indexProxy3.newUpdater(any(typeof(IndexUpdateMode)))).thenReturn(indexUpdater3);

            _updaterMap = new IndexUpdaterMap(_indexMap, IndexUpdateMode.Online);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCreateConstraintIndexForSpecifiedProvider() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCreateConstraintIndexForSpecifiedProvider()
        {
            // given
            IndexingService indexingService = mock(typeof(IndexingService));
            StubKernel      kernel          = new StubKernel(this);

            when(_schemaRead.indexGetCommittedId(_indexReference)).thenReturn(INDEX_ID);
            IndexProxy indexProxy = mock(typeof(IndexProxy));

            when(indexingService.GetIndexProxy(INDEX_ID)).thenReturn(indexProxy);
            when(indexingService.getIndexProxy(_descriptor)).thenReturn(indexProxy);
            NodePropertyAccessor    nodePropertyAccessor = mock(typeof(NodePropertyAccessor));
            ConstraintIndexCreator  creator            = new ConstraintIndexCreator(() => kernel, indexingService, nodePropertyAccessor, _logProvider);
            IndexProviderDescriptor providerDescriptor = new IndexProviderDescriptor("Groovy", "1.2");

            // when
            KernelTransactionImplementation transaction = CreateTransaction();

            creator.CreateUniquenessConstraintIndex(transaction, _descriptor, providerDescriptor.Name());

            // then
            assertEquals(1, kernel.Transactions.Count);
            KernelTransactionImplementation transactionInstance = kernel.Transactions[0];

            verify(transactionInstance).indexUniqueCreate(eq(_descriptor), eq(providerDescriptor.Name()));
            verify(_schemaRead).index(_descriptor);
            verify(_schemaRead).indexGetCommittedId(any());
            verifyNoMoreInteractions(_schemaRead);
        }
Beispiel #9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void flip(java.util.concurrent.Callable<bool> actionDuringFlip, FailedIndexProxyFactory failureDelegate) throws org.neo4j.kernel.api.exceptions.index.FlipFailedKernelException
        public virtual void Flip(Callable <bool> actionDuringFlip, FailedIndexProxyFactory failureDelegate)
        {
            @lock.writeLock().@lock();
            try
            {
                AssertOpen();
                try
                {
                    if (actionDuringFlip.call())
                    {
                        this.@delegate = _flipTarget.create();
                        if (_started)
                        {
                            [email protected]();
                        }
                    }
                }
                catch (Exception e)
                {
                    this.@delegate = failureDelegate.Create(e);
                    throw new ExceptionDuringFlipKernelException(e);
                }
            }
            finally
            {
                @lock.writeLock().unlock();
            }
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = IllegalStateException.class) public void shouldNotDropWhileCreating() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotDropWhileCreating()
        {
            // GIVEN
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.test.DoubleLatch latch = new org.neo4j.test.DoubleLatch();
            DoubleLatch latch = new DoubleLatch();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final IndexProxy inner = new IndexProxyAdapter()
            IndexProxy inner = new IndexProxyAdapterAnonymousInnerClass2(this, latch);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final IndexProxy outer = newContractCheckingIndexProxy(inner);
            IndexProxy outer = NewContractCheckingIndexProxy(inner);

            // WHEN
            RunInSeparateThread(outer.start);

            try
            {
                latch.WaitForAllToStart();
                outer.Drop();
            }
            finally
            {
                latch.Finish();
            }
        }
Beispiel #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void failForceIndexesWhenOneOfTheIndexesIsBroken() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void FailForceIndexesWhenOneOfTheIndexesIsBroken()
        {
            string constraintLabelPrefix    = "ConstraintLabel";
            string constraintPropertyPrefix = "ConstraintProperty";
            string indexLabelPrefix         = "Label";
            string indexPropertyPrefix      = "Property";

            for (int i = 0; i < 10; i++)
            {
                using (Transaction transaction = _database.beginTx())
                {
                    _database.schema().constraintFor(Label.label(constraintLabelPrefix + i)).assertPropertyIsUnique(constraintPropertyPrefix + i).create();
                    _database.schema().indexFor(Label.label(indexLabelPrefix + i)).on(indexPropertyPrefix + i).create();
                    transaction.Success();
                }
            }

            using (Transaction ignored = _database.beginTx())
            {
                _database.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
            }

            IndexingService indexingService = GetIndexingService(_database);

            int indexLabel7    = GetLabelId(indexLabelPrefix + 7);
            int indexProperty7 = GetPropertyKeyId(indexPropertyPrefix + 7);

            IndexProxy index = indexingService.GetIndexProxy(TestIndexDescriptorFactory.forLabel(indexLabel7, indexProperty7).schema());

            index.Drop();

            ExpectedException.expect(typeof(UnderlyingStorageException));
            ExpectedException.expectMessage("Unable to force");
            indexingService.ForceAll(Org.Neo4j.Io.pagecache.IOLimiter_Fields.Unlimited);
        }
Beispiel #12
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void waitIndexOnline(IndexProxy indexProxy) throws InterruptedException
        private void WaitIndexOnline(IndexProxy indexProxy)
        {
            while (InternalIndexState.ONLINE != indexProxy.State)
            {
                Thread.Sleep(10);
            }
        }
Beispiel #13
0
 private ThreadStart PutIndexProxy(IndexMapReference @ref, IndexProxy proxy)
 {
     return(() => @ref.modify(indexMap =>
     {
         indexMap.putIndexProxy(proxy);
         return indexMap;
     }));
 }
        public override IndexSamplingJob Create(long indexId, IndexProxy indexProxy)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String indexUserDescription = indexProxy.getDescriptor().userDescription(nameLookup);
            string indexUserDescription = indexProxy.Descriptor.userDescription(_nameLookup);

            return(new OnlineIndexSamplingJob(indexId, indexProxy, _storeView, indexUserDescription, _logProvider));
        }
 internal OnlineIndexSamplingJob(long indexId, IndexProxy indexProxy, IndexStoreView storeView, string indexUserDescription, LogProvider logProvider)
 {
     this._indexId              = indexId;
     this._indexProxy           = indexProxy;
     this._storeView            = storeView;
     this._log                  = logProvider.getLog(this.GetType());
     this._indexUserDescription = indexUserDescription;
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = IllegalStateException.class) public void shouldNotForceBeforeCreate() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotForceBeforeCreate()
        {
            // GIVEN
            IndexProxy inner = mockIndexProxy();
            IndexProxy outer = NewContractCheckingIndexProxy(inner);

            // WHEN
            outer.Force(Org.Neo4j.Io.pagecache.IOLimiter_Fields.Unlimited);
        }
Beispiel #17
0
        public void PutIndexProxy(IndexProxy indexProxy)
        {
            StoreIndexDescriptor descriptor = indexProxy.Descriptor;
            SchemaDescriptor     schema     = descriptor.Schema();

            _indexesById.put(descriptor.Id, indexProxy);
            _indexesByDescriptor[schema] = indexProxy;
            _indexIdsByDescriptor.put(schema, descriptor.Id);
            AddDescriptorToLookups(schema);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = IllegalStateException.class) public void shouldNotDropAfterClose() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotDropAfterClose()
        {
            // GIVEN
            IndexProxy inner = mockIndexProxy();
            IndexProxy outer = NewContractCheckingIndexProxy(inner);

            // WHEN
            outer.Close();
            outer.Drop();
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = IllegalStateException.class) public void shouldNotCreateIndexTwice() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotCreateIndexTwice()
        {
            // GIVEN
            IndexProxy inner = mockIndexProxy();
            IndexProxy outer = NewContractCheckingIndexProxy(inner);

            // WHEN
            outer.Start();
            outer.Start();
        }
Beispiel #20
0
        public virtual void ValidateBeforeCommit(SchemaDescriptor index, Value[] tuple)
        {
            IndexProxy proxy = _indexMap.getIndexProxy(index);

            if (proxy != null)
            {
                // Do this null-check since from the outside there's a best-effort matching going on between updates and actual indexes backing those.
                proxy.ValidateBeforeCommit(tuple);
            }
        }
Beispiel #21
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public IndexProxy getIndexProxy(long indexId) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        public virtual IndexProxy GetIndexProxy(long indexId)
        {
            IndexProxy proxy = _indexMap.getIndexProxy(indexId);

            if (proxy == null)
            {
                throw new IndexNotFoundKernelException("No index for index id " + indexId + " exists.");
            }
            return(proxy);
        }
Beispiel #22
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public long getIndexId(org.neo4j.internal.kernel.api.schema.SchemaDescriptor descriptor) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        public virtual long GetIndexId(SchemaDescriptor descriptor)
        {
            IndexProxy proxy = _indexMap.getIndexProxy(descriptor);

            if (proxy == null)
            {
                throw new IndexNotFoundKernelException("No index for " + descriptor + " exists.");
            }
            return(_indexMap.getIndexId(descriptor));
        }
Beispiel #23
0
 private IndexProxy[] MockedIndexProxies(int @base, int count)
 {
     IndexProxy[] existing = new IndexProxy[count];
     for (int i = 0; i < count; i++)
     {
         existing[i] = mock(typeof(IndexProxy));
         when(existing[i].Descriptor).thenReturn(forSchema(forLabel(@base + i, 1), PROVIDER_DESCRIPTOR).withId(i).withoutCapabilities());
     }
     return(existing);
 }
Beispiel #24
0
        private IndexSamplingJob CreateSamplingJob(IndexMap indexMap, long indexId)
        {
            IndexProxy proxy = indexMap.GetIndexProxy(indexId);

            if (proxy == null || proxy.State != InternalIndexState.ONLINE)
            {
                return(null);
            }
            return(_jobFactory.create(indexId, proxy));
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void waitIndexOnline(org.neo4j.kernel.impl.api.index.IndexingService indexService, int propertyId, int labelId) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException, org.neo4j.kernel.api.exceptions.index.IndexPopulationFailedKernelException, InterruptedException, org.neo4j.kernel.api.exceptions.index.IndexActivationFailedKernelException
        private void WaitIndexOnline(IndexingService indexService, int propertyId, int labelId)
        {
            IndexProxy indexProxy = indexService.getIndexProxy(SchemaDescriptorFactory.forLabel(labelId, propertyId));

            indexProxy.AwaitStoreScanCompleted(0, TimeUnit.MILLISECONDS);
            while (indexProxy.State != InternalIndexState.ONLINE)
            {
                Thread.Sleep(10);
            }
            indexProxy.Activate();
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDropAfterCreate() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldDropAfterCreate()
        {
            // GIVEN
            IndexProxy inner = mockIndexProxy();
            IndexProxy outer = NewContractCheckingIndexProxy(inner);

            // WHEN
            outer.Start();

            // PASS
            outer.Drop();
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = IllegalStateException.class) public void shouldNotUpdateBeforeCreate() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotUpdateBeforeCreate()
        {
            // GIVEN
            IndexProxy inner = mockIndexProxy();
            IndexProxy outer = NewContractCheckingIndexProxy(inner);

            // WHEN
            using (IndexUpdater updater = outer.NewUpdater(IndexUpdateMode.Online))
            {
                updater.Process(null);
            }
        }
Beispiel #28
0
 public TypeValuesReportSetup(IndexProxy proxy, ClrtDisplayableType typeInfo)
 {
     Debug.Assert(typeInfo.HasAddresses);
     _indexProxy = proxy;
     _typeInfo   = typeInfo;
     _selection  = new HashSet <ClrtDisplayableType>(new ClrtDisplayableIdComparer());
     InitializeComponent();
     TypeValueReportTopTextBox.Text = typeInfo.GetDescription();
     UpdateTypeValueSetupGrid(typeInfo, null);
     TypeValueReportSelectedList.Items.Add("SELECTED VALUES " + Constants.DownwardsBlackArrow);
     TypeValueReportFilterList.Items.Add("FILTERS " + Constants.DownwardsBlackArrow);
 }
Beispiel #29
0
 internal virtual void FlipTo(IndexProxy targetDelegate)
 {
     @lock.writeLock().@lock();
     try
     {
         this.@delegate = targetDelegate;
     }
     finally
     {
         @lock.writeLock().unlock();
     }
 }
            internal Worker(IndexWorkSyncTransactionApplicationStressIT outerInstance, int id, AtomicBoolean end, RecordStorageEngine storageEngine, int batchSize, IndexProxy index)
            {
                this._outerInstance = outerInstance;
                this.Id             = id;
                this.End            = end;
                this.StorageEngine  = storageEngine;
                this.BatchSize      = batchSize;
                this.Index          = index;
                NeoStores neoStores = this.StorageEngine.testAccessNeoStores();

                this.NodeIds = neoStores.NodeStore;
                this.CommandCreationContext = storageEngine.AllocateCommandCreationContext();
            }