Search in sources :

Example 6 with UncloseableDelegatingFileSystemAbstraction

use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.

the class TestReadOnlyNeo4j method createSomeData.

private DbRepresentation createSomeData() {
    RelationshipType type = withName("KNOWS");
    DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(testDirectory.homePath()).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).impermanent().build();
    GraphDatabaseService db = managementService.database(DEFAULT_DATABASE_NAME);
    try (Transaction tx = db.beginTx()) {
        Node prevNode = tx.createNode();
        for (int i = 0; i < 100; i++) {
            Node node = tx.createNode();
            Relationship rel = prevNode.createRelationshipTo(node, type);
            node.setProperty("someKey" + i % 10, i % 15);
            rel.setProperty("since", System.currentTimeMillis());
        }
        tx.commit();
    }
    DbRepresentation result = DbRepresentation.of(db);
    managementService.shutdown();
    return result;
}
Also used : GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) Transaction(org.neo4j.graphdb.Transaction) Node(org.neo4j.graphdb.Node) Relationship(org.neo4j.graphdb.Relationship) RelationshipType(org.neo4j.graphdb.RelationshipType) UncloseableDelegatingFileSystemAbstraction(org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) DbRepresentation(org.neo4j.test.DbRepresentation)

Example 7 with UncloseableDelegatingFileSystemAbstraction

use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.

the class IndexRestartIT method before.

@BeforeEach
void before() {
    factory = new TestDatabaseManagementServiceBuilder();
    factory.setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs));
    factory.setExtensions(Arrays.asList(singleInstanceIndexProviderFactory("test", provider), new TokenIndexProviderFactory()));
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) TokenIndexProviderFactory(org.neo4j.kernel.impl.index.schema.TokenIndexProviderFactory) UncloseableDelegatingFileSystemAbstraction(org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with UncloseableDelegatingFileSystemAbstraction

use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.

the class NeoStoresTest method createShutdownTestDatabase.

private static void createShutdownTestDatabase(FileSystemAbstraction fileSystem, Path storeDir) {
    DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(storeDir).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fileSystem)).impermanent().build();
    managementService.shutdown();
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) UncloseableDelegatingFileSystemAbstraction(org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService)

Example 9 with UncloseableDelegatingFileSystemAbstraction

use of org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.

the class RunOutOfDiskSpaceIT method setUp.

@BeforeEach
void setUp() {
    limitedFs = new LimitedFilesystemAbstraction(new UncloseableDelegatingFileSystemAbstraction(fileSystem));
    managementService = new TestDatabaseManagementServiceBuilder(databaseLayout).setFileSystem(limitedFs).build();
    database = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) UncloseableDelegatingFileSystemAbstraction(org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction) LimitedFilesystemAbstraction(org.neo4j.test.limited.LimitedFilesystemAbstraction) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

UncloseableDelegatingFileSystemAbstraction (org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction)9 TestDatabaseManagementServiceBuilder (org.neo4j.test.TestDatabaseManagementServiceBuilder)9 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)4 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)3 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Transaction (org.neo4j.graphdb.Transaction)2 DatabaseManagementServiceBuilder (org.neo4j.dbms.api.DatabaseManagementServiceBuilder)1 Node (org.neo4j.graphdb.Node)1 Relationship (org.neo4j.graphdb.Relationship)1 RelationshipType (org.neo4j.graphdb.RelationshipType)1 EphemeralFileSystemAbstraction (org.neo4j.io.fs.EphemeralFileSystemAbstraction)1 TokenIndexProviderFactory (org.neo4j.kernel.impl.index.schema.TokenIndexProviderFactory)1 LogFiles (org.neo4j.kernel.impl.transaction.log.files.LogFiles)1 DbRepresentation (org.neo4j.test.DbRepresentation)1 LimitedFilesystemAbstraction (org.neo4j.test.limited.LimitedFilesystemAbstraction)1