private LabelScanStore getLabelScanStore( FileSystemAbstraction fileSystemAbstraction, DatabaseLayout databaseLayout, FullStoreChangeStream fullStoreChangeStream, boolean readOnly, Monitors monitors ) { PageCache pageCache = pageCacheRule.getPageCache( fileSystemAbstraction ); return new NativeLabelScanStore( pageCache, databaseLayout, fileSystemAbstraction, fullStoreChangeStream, readOnly, monitors, RecoveryCleanupWorkCollector.immediate() ); }
private NativeLabelScanStore buildLabelIndex() throws IOException { NativeLabelScanStore labelIndex = new NativeLabelScanStore( pageCache, databaseLayout, fileSystem, new FullLabelStream( storeIndexStoreView ), false, monitors, RecoveryCleanupWorkCollector.immediate() ); if ( labelsTouched ) { labelIndex.drop(); } // Rebuild will happen as part of this call if it was dropped life.add( labelIndex ); return labelIndex; }
private NativeLabelScanStore getNativeLabelScanStore( DatabaseLayout migrationDirectoryStructure, ProgressReporter progressReporter, NeoStores neoStores ) { NeoStoreIndexStoreView neoStoreIndexStoreView = new NeoStoreIndexStoreView( NO_LOCK_SERVICE, neoStores ); return new NativeLabelScanStore( pageCache, migrationDirectoryStructure, fileSystem, new MonitoredFullLabelStream( neoStoreIndexStoreView, progressReporter ), false, new Monitors(), RecoveryCleanupWorkCollector.immediate() ); }
private void instantiateKernelExtensions() { life = new LifeSupport(); life.start(); labelScanStore = new NativeLabelScanStore( pageCache, databaseLayout, fileSystem, FullStoreChangeStream.EMPTY, false, new Monitors(), RecoveryCleanupWorkCollector.immediate() ); life.add( labelScanStore ); }
private NativeLabelScanStore getNativeLabelScanStore( DatabaseLayout databaseLayout, boolean readOnly ) { return new NativeLabelScanStore( pageCache, databaseLayout, fileSystem, FullStoreChangeStream.EMPTY, readOnly, new Monitors(), RecoveryCleanupWorkCollector.ignore() ); }
private LabelScanStore startLabelScanStore( PageCache pageCache, IndexStoreView indexStoreView, Monitors monitors ) { NativeLabelScanStore labelScanStore = new NativeLabelScanStore( pageCache, directory.databaseLayout(), fileSystem, new FullLabelStream( indexStoreView ), false, monitors, RecoveryCleanupWorkCollector.immediate() ); try { labelScanStore.init(); labelScanStore.start(); } catch ( IOException e ) { throw new UncheckedIOException( e ); } return labelScanStore; }
private LabelScanStore getLabelScanStore() { DefaultFileSystemAbstraction fs = fileSystemRule.get(); return new NativeLabelScanStore( pageCacheRule.getPageCache( fs ), localTestDirectory.databaseLayout(), fs, FullStoreChangeStream.EMPTY, true, new Monitors(), RecoveryCleanupWorkCollector.immediate() ); }
@Before public void before() { PageCache pageCache = pageCacheRule.getPageCache( fileSystem ); store = life.add( new NativeLabelScanStore( pageCache, directory.databaseLayout(), fileSystem, FullStoreChangeStream.EMPTY, false, new Monitors(), RecoveryCleanupWorkCollector.immediate(), // a bit of random pageSize Math.min( pageCache.pageSize(), 256 << random.nextInt( 5 ) ) ) ); }
try nativeLabelScanStore = new NativeLabelScanStore( pageCache, testDirectory.databaseLayout(), fileSystemRule.get(), changeStream, false, new Monitors(), immediate() ); nativeLabelScanStore.init();
private void createDirtyIndex( PageCache pageCache ) throws IOException { NativeLabelScanStore nativeLabelScanStore = null; try { nativeLabelScanStore = new NativeLabelScanStore( pageCache, testDirectory.databaseLayout(), fileSystemRule.get(), THROWING_STREAM, false, new Monitors(), immediate() ); nativeLabelScanStore.init(); nativeLabelScanStore.start(); } catch ( IllegalArgumentException e ) { if ( nativeLabelScanStore != null ) { nativeLabelScanStore.shutdown(); } } }
@Test public void labelScanStoreIsDirtyWhenIndexIsNotClean() throws IOException { PageCache pageCache = pageCacheRule.getPageCache( fileSystemRule.get() ); createDirtyIndex( pageCache ); Monitors monitors = new Monitors(); RecordingMonitor monitor = new RecordingMonitor(); monitors.addMonitorListener( monitor ); NativeLabelScanStore nativeLabelScanStore = new NativeLabelScanStore( pageCache, testDirectory.databaseLayout(), fileSystemRule.get(), EMPTY, true, monitors, ignore() ); nativeLabelScanStore.init(); nativeLabelScanStore.start(); assertTrue( nativeLabelScanStore.isDirty() ); nativeLabelScanStore.shutdown(); }
@Test public void doNotRebuildIfOpenedInReadOnlyModeAndIndexIsNotClean() throws IOException { PageCache pageCache = pageCacheRule.getPageCache( fileSystemRule.get() ); createDirtyIndex( pageCache ); Monitors monitors = new Monitors(); RecordingMonitor monitor = new RecordingMonitor(); monitors.addMonitorListener( monitor ); NativeLabelScanStore nativeLabelScanStore = new NativeLabelScanStore( pageCache, testDirectory.databaseLayout(), fileSystemRule.get(), EMPTY, true, monitors, ignore() ); nativeLabelScanStore.init(); nativeLabelScanStore.start(); assertTrue( monitor.notValid ); assertFalse( monitor.rebuilt ); assertFalse( monitor.rebuilding ); nativeLabelScanStore.shutdown(); }
@Test public void mustBeDirtyIfFailedDuringRebuild() throws Exception { // given PageCache pageCache = pageCacheRule.getPageCache( fileSystemRule.get() ); createDirtyIndex( pageCache ); // when RecordingMonitor monitor = new RecordingMonitor(); Monitors monitors = new Monitors(); monitors.addMonitorListener( monitor ); NativeLabelScanStore nativeLabelScanStore = new NativeLabelScanStore( pageCache, testDirectory.databaseLayout(), fileSystemRule.get(), EMPTY, false, monitors, immediate() ); nativeLabelScanStore.init(); nativeLabelScanStore.start(); // then assertTrue( monitor.notValid ); assertTrue( monitor.rebuilding ); assertTrue( monitor.rebuilt ); nativeLabelScanStore.shutdown(); }
new NativeLabelScanStore( pageCache, databaseLayout, fileSystem, FullStoreChangeStream.EMPTY, true, monitors, RecoveryCleanupWorkCollector.ignore() ); life.add( labelScanStore );
private NativeLabelScanStore buildLabelIndex() throws IOException { NativeLabelScanStore labelIndex = new NativeLabelScanStore( pageCache, databaseLayout, fileSystem, new FullLabelStream( storeIndexStoreView ), false, monitors, RecoveryCleanupWorkCollector.immediate() ); if ( labelsTouched ) { labelIndex.drop(); } // Rebuild will happen as part of this call if it was dropped life.add( labelIndex ); return labelIndex; }
private void instantiateKernelExtensions() { life = new LifeSupport(); life.start(); labelScanStore = new NativeLabelScanStore( pageCache, databaseLayout, fileSystem, FullStoreChangeStream.EMPTY, false, new Monitors(), RecoveryCleanupWorkCollector.immediate() ); life.add( labelScanStore ); }
private NativeLabelScanStore getNativeLabelScanStore( DatabaseLayout migrationDirectoryStructure, ProgressReporter progressReporter, NeoStores neoStores ) { NeoStoreIndexStoreView neoStoreIndexStoreView = new NeoStoreIndexStoreView( NO_LOCK_SERVICE, neoStores ); return new NativeLabelScanStore( pageCache, migrationDirectoryStructure, fileSystem, new MonitoredFullLabelStream( neoStoreIndexStoreView, progressReporter ), false, new Monitors(), RecoveryCleanupWorkCollector.immediate() ); }