/** * * Get sorted fileIds of the files cached in the worker. * * @return a sorted fileId list */ private List<Integer> getSortedFileIds() { Set<Integer> fileIds = new HashSet<Integer>(); BlockStoreMeta storeMeta = mBlockDataManager.getStoreMeta(); for (List<Long> blockIds : storeMeta.getBlockList().values()) { for (long blockId : blockIds) { int fileId = BlockInfo.computeInodeId(blockId); fileIds.add(fileId); } } List<Integer> sortedFileIds = new ArrayList<Integer>(fileIds); Collections.sort(sortedFileIds); return sortedFileIds; }
/** * * Get sorted fileIds of the files cached in the worker. * * @return a sorted fileId list */ private List<Long> getSortedFileIds() { Set<Long> fileIds = new HashSet<Long>(); BlockStoreMeta storeMeta = mBlockDataManager.getStoreMeta(); for (List<Long> blockIds : storeMeta.getBlockList().values()) { for (long blockId : blockIds) { long fileId = BlockId.createBlockId(BlockId.getContainerId(blockId), BlockId.getMaxSequenceNumber()); fileIds.add(fileId); } } List<Long> sortedFileIds = new ArrayList<Long>(fileIds); Collections.sort(sortedFileIds); return sortedFileIds; }