use of org.neo4j.kernel.impl.store.StoreType in project neo4j by neo4j.
the class DirectRecordStoreMigrator method migrate.
public void migrate(DatabaseLayout fromDirectoryStructure, RecordFormats fromFormat, DatabaseLayout toDirectoryStructure, RecordFormats toFormat, ProgressReporter progressReporter, StoreType[] types, StoreType... additionalTypesToOpen) throws IOException {
StoreType[] storesToOpen = ArrayUtil.concat(types, additionalTypesToOpen);
progressReporter.start(storesToOpen.length);
try (NeoStores fromStores = new StoreFactory(fromDirectoryStructure, config, new ScanOnOpenReadOnlyIdGeneratorFactory(), pageCache, fs, fromFormat, NullLogProvider.getInstance(), cacheTracer, readOnly(), immutable.empty()).openNeoStores(true, storesToOpen);
NeoStores toStores = new StoreFactory(toDirectoryStructure, withPersistedStoreHeadersAsConfigFrom(fromStores, storesToOpen), new DefaultIdGeneratorFactory(fs, immediate(), toDirectoryStructure.getDatabaseName()), pageCache, fs, toFormat, NullLogProvider.getInstance(), cacheTracer, writable(), immutable.empty()).openNeoStores(true, storesToOpen);
var cursorContext = new CursorContext(cacheTracer.createPageCursorTracer(DIRECT_STORE_MIGRATOR_TAG))) {
toStores.start(cursorContext);
for (StoreType type : types) {
// This condition will exclude counts store first and foremost.
migrate(fromStores.getRecordStore(type), toStores.getRecordStore(type), cursorContext);
progressReporter.progress(1);
}
}
}
use of org.neo4j.kernel.impl.store.StoreType in project neo4j by neo4j.
the class BatchingNeoStores method deleteStoreFiles.
private void deleteStoreFiles(DatabaseLayout databaseLayout, Predicate<StoreType> storesToKeep) {
for (StoreType type : StoreType.values()) {
if (!storesToKeep.test(type)) {
DatabaseFile databaseFile = type.getDatabaseFile();
databaseLayout.allFiles(databaseFile).forEach(uncheckedConsumer(fileSystem::deleteFile));
}
}
}
Aggregations