@Test public void initializeMetaDeleteInappropriateFile() throws Exception { File testDir = mFolder.newFolder(); newBlockFile(testDir, "block", 1); mDir = newStorageDir(testDir); assertStorageDirEmpty(testDir, mDir, TEST_DIR_CAPACITY); }
public static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException, InvalidPathException { StorageDir dir = new StorageDir(tier, dirIndex, capacityBytes, reservedBytes, dirPath, dirMedium); dir.initializeMeta(); return dir; }
StorageDir { public static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException, InvalidPathException { StorageDir dir = new StorageDir(tier, dirIndex, capacityBytes, reservedBytes, dirPath, dirMedium); dir.initializeMeta(); return dir; } }
StorageDir { public static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException, InvalidPathException { StorageDir dir = new StorageDir(tier, dirIndex, capacityBytes, reservedBytes, dirPath, dirMedium); dir.initializeMeta(); return dir; } private  StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes,
      String dirPath, String dirMedium); }
StorageDir { public static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException, InvalidPathException { StorageDir dir = new StorageDir(tier, dirIndex, capacityBytes, reservedBytes, dirPath, dirMedium); dir.initializeMeta(); return dir; } private  StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes,
      String dirPath, String dirMedium); static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes,
      long reservedBytes, String dirPath, String dirMedium); long getCapacityBytes(); long getAvailableBytes(); long getCommittedBytes(); String getDirPath(); String getDirMedium(); StorageTier getParentTier(); int getDirIndex(); List<Long> getBlockIds(); List<BlockMeta> getBlocks(); boolean hasBlockMeta(long blockId); boolean hasTempBlockMeta(long blockId); BlockMeta getBlockMeta(long blockId); TempBlockMeta getTempBlockMeta(long blockId); void addBlockMeta(BlockMeta blockMeta); void addTempBlockMeta(TempBlockMeta tempBlockMeta); void removeBlockMeta(BlockMeta blockMeta); void removeTempBlockMeta(TempBlockMeta tempBlockMeta); void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize); void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds); List<TempBlockMeta> getSessionTempBlocks(long sessionId); BlockStoreLocation toBlockStoreLocation(); long getReservedBytes(); }
StorageDir { public static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException, InvalidPathException { StorageDir dir = new StorageDir(tier, dirIndex, capacityBytes, reservedBytes, dirPath, dirMedium); dir.initializeMeta(); return dir; } private  StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes,
      String dirPath, String dirMedium); static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes,
      long reservedBytes, String dirPath, String dirMedium); long getCapacityBytes(); long getAvailableBytes(); long getCommittedBytes(); String getDirPath(); String getDirMedium(); StorageTier getParentTier(); int getDirIndex(); List<Long> getBlockIds(); List<BlockMeta> getBlocks(); boolean hasBlockMeta(long blockId); boolean hasTempBlockMeta(long blockId); BlockMeta getBlockMeta(long blockId); TempBlockMeta getTempBlockMeta(long blockId); void addBlockMeta(BlockMeta blockMeta); void addTempBlockMeta(TempBlockMeta tempBlockMeta); void removeBlockMeta(BlockMeta blockMeta); void removeTempBlockMeta(TempBlockMeta tempBlockMeta); void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize); void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds); List<TempBlockMeta> getSessionTempBlocks(long sessionId); BlockStoreLocation toBlockStoreLocation(); long getReservedBytes();  }