@Override protected void encode(final ChannelHandlerContext ctx, final ByteTransferContext in, final List out) { final ByteTransferContextSetupMessage message = ByteTransferContextSetupMessage.newBuilder() .setInitiatorExecutorId(localExecutorId) .setTransferIndex(in.getContextId().getTransferIndex()) .setDataDirection(in.getContextId().getDataDirection()) .setContextDescriptor(ByteString.copyFrom(in.getContextDescriptor())) .setIsPipe(in.getContextId().isPipe()) .build(); final byte[] frameBody = message.toByteArray(); out.add(ZEROS.retain()); out.add(ctx.alloc().ioBuffer(BODY_LENGTH_LENGTH, BODY_LENGTH_LENGTH).writeInt(frameBody.length)); out.add(Unpooled.wrappedBuffer(frameBody)); } }
@Override protected void encode(final ChannelHandlerContext ctx, final ByteTransferContext in, final List out) { final ByteTransferContextSetupMessage message = ByteTransferContextSetupMessage.newBuilder() .setInitiatorExecutorId(localExecutorId) .setTransferIndex(in.getContextId().getTransferIndex()) .setDataDirection(in.getContextId().getDataDirection()) .setContextDescriptor(ByteString.copyFrom(in.getContextDescriptor())) .setIsPipe(in.getContextId().isPipe()) .build(); final byte[] frameBody = message.toByteArray(); out.add(ZEROS.retain()); out.add(ctx.alloc().ioBuffer(BODY_LENGTH_LENGTH, BODY_LENGTH_LENGTH).writeInt(frameBody.length)); out.add(Unpooled.wrappedBuffer(frameBody)); } }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.ByteTransferContextSetupMessage other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.ByteTransferContextSetupMessage.getDefaultInstance()) return this; if (other.hasInitiatorExecutorId()) { bitField0_ |= 0x00000001; initiatorExecutorId_ = other.initiatorExecutorId_; onChanged(); } if (other.hasTransferIndex()) { setTransferIndex(other.getTransferIndex()); } if (other.hasDataDirection()) { setDataDirection(other.getDataDirection()); } if (other.hasContextDescriptor()) { setContextDescriptor(other.getContextDescriptor()); } if (other.hasIsPipe()) { setIsPipe(other.getIsPipe()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.ByteTransferContextSetupMessage other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.ByteTransferContextSetupMessage.getDefaultInstance()) return this; if (other.hasInitiatorExecutorId()) { bitField0_ |= 0x00000001; initiatorExecutorId_ = other.initiatorExecutorId_; onChanged(); } if (other.hasTransferIndex()) { setTransferIndex(other.getTransferIndex()); } if (other.hasDataDirection()) { setDataDirection(other.getDataDirection()); } if (other.hasContextDescriptor()) { setContextDescriptor(other.getContextDescriptor()); } if (other.hasIsPipe()) { setIsPipe(other.getIsPipe()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }