use of org.neo4j.io.layout.DatabaseFile in project neo4j by neo4j.
the class StoreMigratorFileOperation method fileOperation.
/**
* Performs a file operation on a database's store files from one directory
* to another. Remember that in the case of {@link FileOperation#MOVE moving files}, the way that's done is to
* just rename files (the standard way of moving with JDK6) from and to must be on the same disk partition.
*
* @param fromLayout directory that hosts the database files.
* @param toLayout directory to receive the database files.
* @throws IOException if any of the operations fail for any reason.
*/
static void fileOperation(FileOperation operation, FileSystemAbstraction fs, DatabaseLayout fromLayout, DatabaseLayout toLayout, Iterable<DatabaseFile> databaseFiles, boolean allowSkipNonExistentFiles, boolean includeIdFile, ExistingTargetStrategy existingTargetStrategy) throws IOException {
for (DatabaseFile databaseStore : databaseFiles) {
Path[] files = includeIdFile ? fromLayout.allFiles(databaseStore).toArray(Path[]::new) : new Path[] { fromLayout.file(databaseStore) };
perform(operation, fs, fromLayout, toLayout, allowSkipNonExistentFiles, existingTargetStrategy, files);
}
}
use of org.neo4j.io.layout.DatabaseFile 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