use of org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class DumpStore method main.
public static void main(String... args) throws Exception {
if (args == null || args.length == 0) {
System.err.println("SYNTAX: [file[:id[,id]*]]+");
return;
}
try (DefaultFileSystemAbstraction fs = new DefaultFileSystemAbstraction();
PageCache pageCache = createPageCache(fs)) {
final DefaultIdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory(fs);
Function<File, StoreFactory> createStoreFactory = file -> new StoreFactory(file.getParentFile(), Config.defaults(), idGeneratorFactory, pageCache, fs, logProvider());
for (String arg : args) {
dumpFile(createStoreFactory, arg);
}
}
}
use of org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class RsdrMain method openStore.
private static StoreFactory openStore(FileSystemAbstraction fileSystem, File storeDir, Config config, PageCache pageCache) {
IdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory(fileSystem);
NullLogProvider logProvider = NullLogProvider.getInstance();
return new StoreFactory(storeDir, config, idGeneratorFactory, pageCache, fileSystem, logProvider);
}
use of org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory 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.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class PropertyPhysicalToLogicalConverterTest method before.
@Before
public void before() throws Exception {
File storeDir = new File("dir");
fs.get().mkdirs(storeDir);
StoreFactory storeFactory = new StoreFactory(storeDir, Config.empty(), new DefaultIdGeneratorFactory(fs.get()), pageCacheRule.getPageCache(fs.get()), fs.get(), NullLogProvider.getInstance());
neoStores = storeFactory.openAllNeoStores(true);
store = neoStores.getPropertyStore();
converter = new PropertyPhysicalToLogicalConverter(store);
}
use of org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class CommonAbstractStoreTest method shouldDeleteOnCloseIfOpenOptionsSaysSo.
@Test
public void shouldDeleteOnCloseIfOpenOptionsSaysSo() throws Exception {
// GIVEN
File file = dir.file("store").getAbsoluteFile();
File idFile = new File(file.getParentFile(), StoreFileType.ID.augment(file.getName()));
FileSystemAbstraction fs = fileSystemRule.get();
PageCache pageCache = pageCacheRule.getPageCache(fs, Config.empty());
TheStore store = new TheStore(file, config, idType, new DefaultIdGeneratorFactory(fs), pageCache, NullLogProvider.getInstance(), recordFormat, DELETE_ON_CLOSE);
store.initialise(true);
store.makeStoreOk();
assertTrue(fs.fileExists(file));
assertTrue(fs.fileExists(idFile));
// WHEN
store.close();
// THEN
assertFalse(fs.fileExists(file));
assertFalse(fs.fileExists(idFile));
}
Aggregations