mBlockStore.putBlock(blockId, BlockMeta.newBuilder().setLength(length).build()); BlockInfoEntry blockInfo = BlockInfoEntry.newBuilder().setBlockId(blockId).setLength(length).build(); journalContext.append(JournalEntry.newBuilder().setBlockInfo(blockInfo).build());
subBuilder.mergeFrom(blockInfo_); blockInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(blockInfo_); blockInfo_ = subBuilder.buildPartial();
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; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { alluxio.proto.journal.Block.BlockInfoEntry parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (alluxio.proto.journal.Block.BlockInfoEntry) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
@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 alluxio.proto.journal.Block.BlockInfoEntry buildPartial() { alluxio.proto.journal.Block.BlockInfoEntry result = new alluxio.proto.journal.Block.BlockInfoEntry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.blockId_ = blockId_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.length_ = length_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * <code>optional .alluxio.proto.journal.BlockInfoEntry block_info = 4;</code> */ public Builder setBlockInfo( alluxio.proto.journal.Block.BlockInfoEntry.Builder builderForValue) { if (blockInfoBuilder_ == null) { blockInfo_ = builderForValue.build(); onChanged(); } else { blockInfoBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000010; return this; } /**
public Builder clone() { return create().mergeFrom(buildPartial()); }
private static Builder create() { return new Builder(); }
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(alluxio.proto.journal.Block.BlockInfoEntry prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public alluxio.proto.journal.Block.BlockInfoEntry build() { alluxio.proto.journal.Block.BlockInfoEntry result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
public Builder mergeFrom(alluxio.proto.journal.Block.BlockInfoEntry other) { if (other == alluxio.proto.journal.Block.BlockInfoEntry.getDefaultInstance()) return this; if (other.hasBlockId()) { setBlockId(other.getBlockId()); } if (other.hasLength()) { setLength(other.getLength()); } this.mergeUnknownFields(other.getUnknownFields()); return 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 mergeFrom(com.google.protobuf.Message other) { if (other instanceof alluxio.proto.journal.Block.BlockInfoEntry) { return mergeFrom((alluxio.proto.journal.Block.BlockInfoEntry)other); } else { super.mergeFrom(other); return this; } }
/** * <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; } /**