@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasBlockId()) { hash = (37 * hash) + BLOCK_ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getBlockId()); } if (hasLength()) { hash = (37 * hash) + LENGTH_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getLength()); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof alluxio.proto.journal.Block.BlockInfoEntry)) { return super.equals(obj); } alluxio.proto.journal.Block.BlockInfoEntry other = (alluxio.proto.journal.Block.BlockInfoEntry) obj; boolean result = true; result = result && (hasBlockId() == other.hasBlockId()); if (hasBlockId()) { result = result && (getBlockId() == other.getBlockId()); } result = result && (hasLength() == other.hasLength()); if (hasLength()) { result = result && (getLength() == other.getLength()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@Override public void processJournalEntry(JournalEntry entry) throws IOException { // TODO(gene): A better way to process entries besides a huge switch? if (entry.hasBlockContainerIdGenerator()) { mJournaledNextContainerId = (entry.getBlockContainerIdGenerator()).getNextContainerId(); mBlockContainerIdGenerator.setNextContainerId((mJournaledNextContainerId)); } else if (entry.hasDeleteBlock()) { mBlockStore.removeBlock(entry.getDeleteBlock().getBlockId()); } else if (entry.hasBlockInfo()) { BlockInfoEntry blockInfoEntry = entry.getBlockInfo(); long length = blockInfoEntry.getLength(); Optional<BlockMeta> block = mBlockStore.getBlock(blockInfoEntry.getBlockId()); if (block.isPresent()) { long oldLen = block.get().getLength(); if (oldLen != Constants.UNKNOWN_SIZE) { LOG.warn("Attempting to update block length ({}) to a different length ({}).", oldLen, length); return; } } mBlockStore.putBlock(blockInfoEntry.getBlockId(), BlockMeta.newBuilder().setLength(blockInfoEntry.getLength()).build()); } else { throw new IOException(ExceptionMessage.UNEXPECTED_JOURNAL_ENTRY.getMessage(entry)); } }
@Override public void processJournalEntry(JournalEntry entry) throws IOException { // TODO(gene): A better way to process entries besides a huge switch? if (entry.hasBlockContainerIdGenerator()) { mJournaledNextContainerId = (entry.getBlockContainerIdGenerator()).getNextContainerId(); mBlockContainerIdGenerator.setNextContainerId((mJournaledNextContainerId)); } else if (entry.hasDeleteBlock()) { mBlocks.remove(entry.getDeleteBlock().getBlockId()); } else if (entry.hasBlockInfo()) { BlockInfoEntry blockInfoEntry = entry.getBlockInfo(); if (mBlocks.containsKey(blockInfoEntry.getBlockId())) { // Update the existing block info. MasterBlockInfo blockInfo = mBlocks.get(blockInfoEntry.getBlockId()); blockInfo.updateLength(blockInfoEntry.getLength()); } else { mBlocks.put(blockInfoEntry.getBlockId(), new MasterBlockInfo(blockInfoEntry.getBlockId(), blockInfoEntry.getLength())); } } else { throw new IOException(ExceptionMessage.UNEXPECTED_JOURNAL_ENTRY.getMessage(entry)); } }
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; }
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.unknownFields); onChanged(); return this; }