/** * <code>optional .alluxio.proto.journal.BlockInfoEntry block_info = 4;</code> */ public Builder mergeBlockInfo(alluxio.proto.journal.Block.BlockInfoEntry value) { if (blockInfoBuilder_ == null) { if (((bitField0_ & 0x00000040) == 0x00000040) && blockInfo_ != null && blockInfo_ != alluxio.proto.journal.Block.BlockInfoEntry.getDefaultInstance()) { blockInfo_ = alluxio.proto.journal.Block.BlockInfoEntry.newBuilder(blockInfo_).mergeFrom(value).buildPartial(); } else { blockInfo_ = value; } onChanged(); } else { blockInfoBuilder_.mergeFrom(value); } bitField0_ |= 0x00000040; return this; } /**
mBlockStore.putBlock(blockId, BlockMeta.newBuilder().setLength(length).build()); BlockInfoEntry blockInfo = BlockInfoEntry.newBuilder().setBlockId(blockId).setLength(length).build(); journalContext.append(JournalEntry.newBuilder().setBlockInfo(blockInfo).build());
@Override public void commitBlockInUFS(long blockId, long length) throws UnavailableException { LOG.debug("Commit block in ufs. blockId: {}, length: {}", blockId, length); try (JournalContext journalContext = createJournalContext(); LockResource lr = lockBlock(blockId)) { if (mBlockStore.getBlock(blockId).isPresent()) { // Block metadata already exists, so do not need to create a new one. return; } mBlockStore.putBlock(blockId, BlockMeta.newBuilder().setLength(length).build()); BlockInfoEntry blockInfo = BlockInfoEntry.newBuilder().setBlockId(blockId).setLength(length).build(); journalContext.append(JournalEntry.newBuilder().setBlockInfo(blockInfo).build()); } }
BlockInfoEntry.newBuilder().setBlockId(blockId).setLength(length).build(); journalContext.append(JournalEntry.newBuilder().setBlockInfo(blockInfo).build());
/** * <code>optional .alluxio.proto.journal.BlockInfoEntry block_info = 4;</code> */ public Builder mergeBlockInfo(alluxio.proto.journal.Block.BlockInfoEntry value) { if (blockInfoBuilder_ == null) { if (((bitField0_ & 0x00000010) == 0x00000010) && blockInfo_ != alluxio.proto.journal.Block.BlockInfoEntry.getDefaultInstance()) { blockInfo_ = alluxio.proto.journal.Block.BlockInfoEntry.newBuilder(blockInfo_).mergeFrom(value).buildPartial(); } else { blockInfo_ = value; } onChanged(); } else { blockInfoBuilder_.mergeFrom(value); } bitField0_ |= 0x00000010; return this; } /**
@Override public void commitBlockInUFS(long blockId, long length) throws UnavailableException { LOG.debug("Commit block in ufs. blockId: {}, length: {}", blockId, length); if (mBlocks.get(blockId) != null) { // Block metadata already exists, so do not need to create a new one. return; } // The block has not been committed previously, so add the metadata to commit the block. MasterBlockInfo block = new MasterBlockInfo(blockId, length); try (JournalContext journalContext = createJournalContext()) { synchronized (block) { if (mBlocks.putIfAbsent(blockId, block) == null) { // Successfully added the new block metadata. Append a journal entry for the new metadata. BlockInfoEntry blockInfo = BlockInfoEntry.newBuilder().setBlockId(blockId).setLength(length).build(); journalContext.append(JournalEntry.newBuilder().setBlockInfo(blockInfo).build()); } } } }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(alluxio.proto.journal.Block.BlockInfoEntry prototype) {
public Builder toBuilder() { return newBuilder(this); }
public static Builder newBuilder(alluxio.proto.journal.Block.BlockInfoEntry prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
@Override public JournalEntry next() { if (!hasNext()) { throw new NoSuchElementException(); } MasterBlockInfo info = it.next(); BlockInfoEntry blockInfoEntry = BlockInfoEntry.newBuilder().setBlockId(info.getBlockId()) .setLength(info.getLength()).build(); return JournalEntry.newBuilder().setBlockInfo(blockInfoEntry).build(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {