use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class RebuildCountsTest method restart.
private void restart(FileSystemAbstraction fs) throws IOException {
if (db != null) {
db.shutdown();
}
fs.mkdirs(storeDir);
TestGraphDatabaseFactory dbFactory = new TestGraphDatabaseFactory();
db = dbFactory.setUserLogProvider(userLogProvider).setInternalLogProvider(internalLogProvider).setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).addKernelExtension(new InMemoryIndexProviderFactory(indexProvider)).newImpermanentDatabaseBuilder(storeDir).setConfig(index_background_sampling_enabled, "false").newGraphDatabase();
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class TestLogPruning method newDb.
private GraphDatabaseAPI newDb(String logPruning, int rotateEveryNTransactions) {
this.rotateEveryNTransactions = rotateEveryNTransactions;
fs = new EphemeralFileSystemAbstraction();
TestGraphDatabaseFactory gdf = new TestGraphDatabaseFactory();
gdf.setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs));
GraphDatabaseBuilder builder = gdf.newImpermanentDatabaseBuilder();
builder.setConfig(keep_logical_logs, logPruning);
this.db = (GraphDatabaseAPI) builder.newGraphDatabase();
files = new PhysicalLogFiles(new File(db.getStoreDir()), PhysicalLogFile.DEFAULT_NAME, fs);
return db;
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class CheckPointerIntegrationTest method setup.
@Before
public void setup() throws IOException {
fs = fsRule.get();
fs.deleteRecursively(storeDir);
builder = new TestGraphDatabaseFactory().setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).newImpermanentDatabaseBuilder(storeDir);
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class IndexRestartIT method before.
@Before
public void before() throws Exception {
factory = new TestGraphDatabaseFactory();
factory.setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs.get()));
factory.addKernelExtensions(Collections.singletonList(singleInstanceSchemaIndexProviderFactory("test", provider)));
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class TestReadOnlyNeo4j method createSomeData.
private DbRepresentation createSomeData() {
RelationshipType type = withName("KNOWS");
GraphDatabaseService db = new TestGraphDatabaseFactory().setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs.get())).newImpermanentDatabase(PATH);
try (Transaction tx = db.beginTx()) {
Node prevNode = db.createNode();
for (int i = 0; i < 100; i++) {
Node node = db.createNode();
Relationship rel = prevNode.createRelationshipTo(node, type);
node.setProperty("someKey" + i % 10, i % 15);
rel.setProperty("since", System.currentTimeMillis());
}
tx.success();
}
DbRepresentation result = DbRepresentation.of(db);
db.shutdown();
return result;
}
Aggregations