ensure BSFiles use blocks that are aligned to 512 Byte offsets

This commit is contained in:
2018-10-14 09:00:26 +02:00
parent a2520c0238
commit bd88c63aff
3 changed files with 26 additions and 3 deletions

View File

@@ -66,6 +66,7 @@ public class DataStore implements AutoCloseable {
listingFilePath = storageBasePath.resolve("listing.csv");
diskStorageFilePath = storageBasePath.resolve("data.bs");
diskStorage = new DiskStorage(diskStorageFilePath);
diskStorage.ensureAlignmentForNewBlocks(BSFile.BLOCK_SIZE);
initListingFileIfNotExists();
init(diskStorage);
listingFile = new RandomAccessFile(listingFilePath.toFile(), "rw");