@Override public void streamToJournalCheckpoint(JournalOutputStream outputStream) throws IOException { outputStream.writeEntry(mBlockContainerIdGenerator.toJournalEntry()); for (MasterBlockInfo blockInfo : mBlocks.values()) { BlockInfoEntry blockInfoEntry = BlockInfoEntry.newBuilder() .setBlockId(blockInfo.getBlockId()) .setLength(blockInfo.getLength()) .build(); outputStream.writeEntry(JournalEntry.newBuilder().setBlockInfo(blockInfoEntry).build()); } }
@Override public synchronized void streamToJournalCheckpoint(JournalOutputStream outputStream) throws IOException { for (Map.Entry<Long, List<PartitionInfo>> entry : mCompleteStoreToPartitions.entrySet()) { long fileId = entry.getKey(); List<PartitionInfo> partitions = entry.getValue(); outputStream.writeEntry(newCreateStoreEntry(fileId)); for (PartitionInfo info : partitions) { outputStream.writeEntry(newCompletePartitionEntry(fileId, info)); } outputStream.writeEntry(newCompleteStoreEntry(fileId)); } for (Map.Entry<Long, List<PartitionInfo>> entry : mIncompleteStoreToPartitions.entrySet()) { long fileId = entry.getKey(); List<PartitionInfo> partitions = entry.getValue(); outputStream.writeEntry(newCreateStoreEntry(fileId)); for (PartitionInfo info : partitions) { outputStream.writeEntry(newCompletePartitionEntry(fileId, info)); } } }