/** * @param request block request in proto */ BlockWriteRequest(alluxio.grpc.WriteRequest request) { super(request); mTier = request.getCommand().getTier(); if (request.getCommand().hasCreateUfsBlockOptions()) { mCreateUfsBlockOptions = request.getCommand().getCreateUfsBlockOptions(); } else { mCreateUfsBlockOptions = null; } }
@Override protected void handleCommand(WriteRequestCommand command, BlockWriteRequestContext context) throws Exception { if (command.hasCreateUfsBlockOptions() && command.getOffset() == 0 && command.getCreateUfsBlockOptions().hasBytesInBlockStore()) { long ufsFallbackInitBytes = command.getCreateUfsBlockOptions().getBytesInBlockStore(); context.setPos(context.getPos() + ufsFallbackInitBytes); initUfsFallback(context); } }
hash = (53 * hash) + getCreateUfsFileOptions().hashCode(); if (hasCreateUfsBlockOptions()) { hash = (37 * hash) + CREATE_UFS_BLOCK_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getCreateUfsBlockOptions().hashCode();
.equals(other.getCreateUfsFileOptions()); result = result && (hasCreateUfsBlockOptions() == other.hasCreateUfsBlockOptions()); if (hasCreateUfsBlockOptions()) { result = result && getCreateUfsBlockOptions() .equals(other.getCreateUfsBlockOptions());
public Builder mergeFrom(alluxio.grpc.WriteRequestCommand other) { if (other == alluxio.grpc.WriteRequestCommand.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasId()) { setId(other.getId()); } if (other.hasOffset()) { setOffset(other.getOffset()); } if (other.hasTier()) { setTier(other.getTier()); } if (other.hasFlush()) { setFlush(other.getFlush()); } if (other.hasCreateUfsFileOptions()) { mergeCreateUfsFileOptions(other.getCreateUfsFileOptions()); } if (other.hasCreateUfsBlockOptions()) { mergeCreateUfsBlockOptions(other.getCreateUfsBlockOptions()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Validates the read request sent. * * @param request the request * @param offset the offset */ private void validateWriteRequest(WriteRequest request, long offset) { if (request.hasCommand()) { assertEquals(RequestType.UFS_FALLBACK_BLOCK, request.getCommand().getType()); assertEquals(BLOCK_ID, request.getCommand().getId()); assertEquals(offset, request.getCommand().getOffset()); assertTrue(request.getCommand().hasCreateUfsBlockOptions()); assertEquals(MOUNT_ID, request.getCommand().getCreateUfsBlockOptions().getMountId()); } else { assertTrue(request.hasChunk()); } } }