//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFailOnUnsortedLabelsFromFullStoreChangeStream() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFailOnUnsortedLabelsFromFullStoreChangeStream()
        {
            // given
            PageCache pageCache = _pageCacheRule.getPageCache(_fileSystemRule.get());
            IList <NodeLabelUpdate> existingData = new List <NodeLabelUpdate>();

            existingData.Add(NodeLabelUpdate.labelChanges(1, new long[0], new long[] { 2, 1 }));
            FullStoreChangeStream changeStream         = asStream(existingData);
            NativeLabelScanStore  nativeLabelScanStore = null;

            try
            {
                nativeLabelScanStore = new NativeLabelScanStore(pageCache, _testDirectory.databaseLayout(), _fileSystemRule.get(), changeStream, false, new Monitors(), immediate());
                nativeLabelScanStore.Init();

                // when
                nativeLabelScanStore.Start();
                fail("Expected native label scan store to fail on ");
            }
            catch (System.ArgumentException e)
            {
                // then
                assertThat(e.Message, Matchers.containsString("unsorted label"));
                assertThat(e.Message, Matchers.stringContainsInOrder(Iterables.asIterable("2", "1")));
            }
            finally
            {
                if (nativeLabelScanStore != null)
                {
                    nativeLabelScanStore.Shutdown();
                }
            }
        }
Exemplo n.º 2
0
 /*
  * Test access to be able to control page size.
  */
 internal NativeLabelScanStore(PageCache pageCache, DatabaseLayout directoryStructure, FileSystemAbstraction fs, FullStoreChangeStream fullStoreChangeStream, bool readOnly, Monitors monitors, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, int pageSize)
 {
     this._pageCache                    = pageCache;
     this._fs                           = fs;
     this._pageSize                     = pageSize;
     this._fullStoreChangeStream        = fullStoreChangeStream;
     this._directoryStructure           = directoryStructure;
     this._storeFile                    = GetLabelScanStoreFile(directoryStructure);
     this._readOnly                     = readOnly;
     this._monitors                     = monitors;
     this._monitor                      = monitors.NewMonitor(typeof(Org.Neo4j.Kernel.api.labelscan.LabelScanStore_Monitor));
     this._recoveryCleanupWorkCollector = recoveryCleanupWorkCollector;
     this._fileSystem                   = fs;
 }
Exemplo n.º 3
0
        private LabelScanStore GetLabelScanStore(FileSystemAbstraction fileSystemAbstraction, DatabaseLayout databaseLayout, FullStoreChangeStream fullStoreChangeStream, bool readOnly, Monitors monitors)
        {
            PageCache pageCache = PageCacheRule.getPageCache(fileSystemAbstraction);

            return(new NativeLabelScanStore(pageCache, databaseLayout, fileSystemAbstraction, fullStoreChangeStream, readOnly, monitors, RecoveryCleanupWorkCollector.immediate()));
        }
Exemplo n.º 4
0
        protected internal override LabelScanStore CreateLabelScanStore(FileSystemAbstraction fileSystemAbstraction, DatabaseLayout databaseLayout, FullStoreChangeStream fullStoreChangeStream, bool usePersistentStore, bool readOnly, Org.Neo4j.Kernel.api.labelscan.LabelScanStore_Monitor monitor)
        {
            Monitors monitors = new Monitors();

            monitors.AddMonitorListener(monitor);
            return(GetLabelScanStore(fileSystemAbstraction, databaseLayout, fullStoreChangeStream, readOnly, monitors));
        }
Exemplo n.º 5
0
 public NativeLabelScanStore(PageCache pageCache, DatabaseLayout directoryStructure, FileSystemAbstraction fs, FullStoreChangeStream fullStoreChangeStream, bool readOnly, Monitors monitors, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector) : this(pageCache, directoryStructure, fs, fullStoreChangeStream, readOnly, monitors, recoveryCleanupWorkCollector, 0)
 {
 }
Exemplo n.º 6
0
 protected internal abstract LabelScanStore CreateLabelScanStore(FileSystemAbstraction fileSystemAbstraction, DatabaseLayout databaseLayout, FullStoreChangeStream fullStoreChangeStream, bool usePersistentStore, bool readOnly, Org.Neo4j.Kernel.api.labelscan.LabelScanStore_Monitor monitor);