public FileSystemAbstraction fileSystem() { return fs.get(); }
public FileSystemAbstraction fileSystem() { return fs.get(); }
private File directory( File parent, String name ) throws IOException { File dir = new File( parent, name ); fs.mkdirs( dir ); return dir; }
private void scrambleIndexFilesAndRestart( List<NodeLabelUpdate> data, boolean usePersistentStore, boolean readOnly ) throws IOException { shutdown(); corruptIndex( fileSystemRule.get(), testDirectory.databaseLayout() ); start( data, usePersistentStore, readOnly ); }
private void killDb() throws Exception { if ( db != null ) { fs.snapshot( () -> { db.shutdown(); db = null; } ); } }
private void truncateBytesFromLastLogFile( long bytesToTrim ) throws IOException { File highestLogFile = logFiles.getHighestLogFile(); long fileSize = fileSystemRule.getFileSize( highestLogFile ); if ( bytesToTrim > fileSize ) { fileSystemRule.deleteFile( highestLogFile ); } else { fileSystemRule.truncate( highestLogFile, fileSize - bytesToTrim ); } }
@Before public void doBefore() { fs = fsRule.get(); }
private File copyTransactionLogs() throws IOException { File restoreDbStore = directory.storeDir( "restore-db" ); File restoreDbStoreDir = directory.databaseDir( restoreDbStore ); move( fileSystemRule.get(), this.directory.databaseDir(), restoreDbStoreDir ); return restoreDbStoreDir; }
private void crashAndRestart() throws Exception { fsRule.snapshot( db::shutdown ); db = newDb(); }
@Before public void doBefore() { fs = fsRule.get(); }
private void killDb() throws Exception { if ( db != null ) { fs.snapshot( () -> { db.shutdown(); db = null; } ); } }
@Before public void doBefore() { fs = fsRule.get(); }
@SuppressWarnings( "deprecation" ) private void crashAndRestart() throws Exception { final GraphDatabaseService db1 = db; FileSystemAbstraction uncleanFs = fsRule.snapshot( db1::shutdown ); db = (GraphDatabaseAPI) databaseFactory( uncleanFs ).newImpermanentDatabase(); } }
private PageCache createPageCache() { return pageCacheRule.getPageCache( fs.get() ); }
private void crashAndRestart() throws Exception { final GraphDatabaseService db1 = db; FileSystemAbstraction uncleanFs = fsRule.snapshot( db1::shutdown ); db = databaseFactory( uncleanFs ).newImpermanentDatabase(); }
private FileSystemAbstraction crash() { return fsRule.get().snapshot(); }
private StoreChannel getStoreChannel() throws IOException { return fs.get().open( new File( "id.file" ), OpenMode.READ_WRITE ); } }
void createEmpty( Map<String,byte[]> headers ) throws IOException { createEmptyStore( fs.get(), getStoreFile(), 16, 16, headers( headers ) ); }
private GraphDatabaseService newDb() { return new TestGraphDatabaseFactory() .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fsRule.get() ) ) .newImpermanentDatabase(); }