use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class RebuildCountsTest method restart.
private void restart(FileSystemAbstraction fs) {
if (db != null) {
managementService.shutdown();
}
managementService = new TestDatabaseManagementServiceBuilder(databaseLayout).setUserLogProvider(userLogProvider).setInternalLogProvider(internalLogProvider).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).impermanent().setConfig(index_background_sampling_enabled, false).build();
db = managementService.database(DEFAULT_DATABASE_NAME);
}
use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class ConsistencyCheckWithCorruptGBPTreeIT method dbmsAction.
/**
* Open dbms with schemaIndex as default index provider on provided file system abstraction and apply dbSetup to DEFAULT_DATABASE.
*/
private void dbmsAction(Path neo4jHome, FileSystemAbstraction fs, GraphDatabaseSettings.SchemaIndex schemaIndex, Consumer<GraphDatabaseService> dbSetup, Consumer<DatabaseManagementServiceBuilder> dbConfiguration) {
TestDatabaseManagementServiceBuilder builder = new TestDatabaseManagementServiceBuilder(neo4jHome).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs));
dbConfiguration.accept(builder);
final DatabaseManagementService dbms = builder.setConfig(GraphDatabaseSettings.default_schema_provider, schemaIndex.providerName()).build();
try {
final GraphDatabaseService db = dbms.database(DEFAULT_DATABASE_NAME);
dbSetup.accept(db);
} finally {
dbms.shutdown();
}
}
use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class TestLogPruning method newDb.
private GraphDatabaseAPI newDb(String logPruning, int rotateEveryNTransactions) {
this.rotateEveryNTransactions = rotateEveryNTransactions;
fs = new EphemeralFileSystemAbstraction();
TestDatabaseManagementServiceBuilder gdf = new TestDatabaseManagementServiceBuilder();
gdf.setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs));
DatabaseManagementServiceBuilder builder = gdf.impermanent();
builder.setConfig(keep_logical_logs, logPruning);
managementService = builder.build();
this.db = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
files = db.getDependencyResolver().resolveDependency(LogFiles.class);
return db;
}
use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class IndexStatisticsIT method startDb.
private void startDb() {
managementService = new TestDatabaseManagementServiceBuilder().setInternalLogProvider(logProvider).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).impermanent().setConfig(index_background_sampling_enabled, false).build();
db = managementService.database(DEFAULT_DATABASE_NAME);
}
use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class TestReadOnlyNeo4j method createIndex.
private void createIndex() {
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(testDirectory.homePath()).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).impermanent().build();
GraphDatabaseService db = managementService.database(DEFAULT_DATABASE_NAME);
try (Transaction tx = db.beginTx()) {
tx.schema().indexFor(Label.label("label")).on("prop").create();
tx.commit();
}
try (Transaction tx = db.beginTx()) {
tx.schema().awaitIndexesOnline(2, TimeUnit.MINUTES);
tx.commit();
}
managementService.shutdown();
}
Aggregations