use of org.neo4j.kernel.impl.store.StoreFactory in project neo4j by neo4j.
the class CoreBootstrapper method bootstrap.
public CoreSnapshot bootstrap(Set<MemberId> members) throws IOException {
StoreFactory factory = new StoreFactory(storeDir, config, new DefaultIdGeneratorFactory(fs), pageCache, fs, logProvider);
NeoStores neoStores = factory.openAllNeoStores(true);
neoStores.close();
CoreSnapshot coreSnapshot = new CoreSnapshot(FIRST_INDEX, FIRST_TERM);
coreSnapshot.add(CoreStateType.ID_ALLOCATION, deriveIdAllocationState(storeDir));
coreSnapshot.add(CoreStateType.LOCK_TOKEN, new ReplicatedLockTokenState());
coreSnapshot.add(CoreStateType.RAFT_CORE_STATE, new RaftCoreState(new MembershipEntry(FIRST_INDEX, members)));
coreSnapshot.add(CoreStateType.SESSION_TRACKER, new GlobalSessionTrackerState());
appendNullTransactionLogEntryToSetRaftIndexToMinusOne();
return coreSnapshot;
}
use of org.neo4j.kernel.impl.store.StoreFactory in project neo4j by neo4j.
the class StoreMigratorFrom20IT method shouldMigrate.
@Test
public void shouldMigrate() throws IOException, ConsistencyCheckIncompleteException {
// WHEN
StoreMigrator storeMigrator = new StoreMigrator(fs, pageCache, getConfig(), NullLogService.getInstance(), schemaIndexProvider);
SchemaIndexMigrator indexMigrator = new SchemaIndexMigrator(fs, schemaIndexProvider, labelScanStoreProvider);
upgrader(indexMigrator, storeMigrator).migrateIfNeeded(find20FormatStoreDirectory(storeDir.directory()));
// THEN
assertEquals(2, monitor.progresses().size());
assertTrue(monitor.isStarted());
assertTrue(monitor.isFinished());
GraphDatabaseService database = new EnterpriseGraphDatabaseFactory().newEmbeddedDatabaseBuilder(storeDir.absolutePath()).newGraphDatabase();
try {
verifyDatabaseContents(database);
} finally {
// CLEANUP
database.shutdown();
}
LogProvider logProvider = NullLogProvider.getInstance();
StoreFactory storeFactory = new StoreFactory(storeDir.directory(), pageCache, fs, logProvider);
try (NeoStores neoStores = storeFactory.openAllNeoStores(true)) {
verifyNeoStore(neoStores);
}
assertConsistentStore(storeDir.directory());
}
use of org.neo4j.kernel.impl.store.StoreFactory in project neo4j by neo4j.
the class NodeLabelsFieldTest method startUp.
@Before
public void startUp() {
File storeDir = new File("dir");
fs.get().mkdirs(storeDir);
Config config = Config.embeddedDefaults(stringMap(GraphDatabaseSettings.label_block_size.name(), "60"));
StoreFactory storeFactory = new StoreFactory(storeDir, config, new DefaultIdGeneratorFactory(fs.get()), pageCacheRule.getPageCache(fs.get()), fs.get(), NullLogProvider.getInstance());
neoStores = storeFactory.openAllNeoStores(true);
nodeStore = neoStores.getNodeStore();
}
use of org.neo4j.kernel.impl.store.StoreFactory in project neo4j by neo4j.
the class ApplyRecoveredTransactionsTest method before.
@Before
public void before() {
FileSystemAbstraction fs = fsr.get();
File storeDir = new File("dir");
StoreFactory storeFactory = new StoreFactory(storeDir, Config.empty(), new DefaultIdGeneratorFactory(fs), pageCacheRule.getPageCache(fs), fs, NullLogProvider.getInstance());
neoStores = storeFactory.openAllNeoStores(true);
}
use of org.neo4j.kernel.impl.store.StoreFactory in project neo4j by neo4j.
the class NodeCommandTest method before.
@Before
public void before() throws Exception {
File dir = new File("dir");
fs.get().mkdirs(dir);
@SuppressWarnings("deprecation") StoreFactory storeFactory = new StoreFactory(dir, Config.empty(), new DefaultIdGeneratorFactory(fs.get()), pageCacheRule.getPageCache(fs.get()), fs.get(), NullLogProvider.getInstance());
neoStores = storeFactory.openAllNeoStores(true);
nodeStore = neoStores.getNodeStore();
}
Aggregations