@Override public void write(MutableDirectBuffer buffer, int offset) { headerEncoder .wrap(buffer, offset) .blockLength(bodyEncoder.sbeBlockLength()) .templateId(bodyEncoder.sbeTemplateId()) .schemaId(bodyEncoder.sbeSchemaId()) .version(bodyEncoder.sbeSchemaVersion()); offset += headerEncoder.encodedLength(); bodyEncoder .wrap(buffer, offset) .partitionId(partitionId) .key(key) .recordType(recordType) .valueType(valueType) .intent(intent.value()) .rejectionType(rejectionType) .putValue(value, 0, value.capacity()) .putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); } }
@Override public void write(MutableDirectBuffer buffer, int offset) { EnsureUtil.ensureNotNull("recordType", recordType); EnsureUtil.ensureNotNull("valueType", valueType); EnsureUtil.ensureNotNull("intent", intent); // protocol header headerEncoder .wrap(buffer, offset) .blockLength(bodyEncoder.sbeBlockLength()) .templateId(bodyEncoder.sbeTemplateId()) .schemaId(bodyEncoder.sbeSchemaId()) .version(bodyEncoder.sbeSchemaVersion()); offset += headerEncoder.encodedLength(); // protocol message bodyEncoder .wrap(buffer, offset) .recordType(recordType) .valueType(valueType) .intent(intent.value()) .partitionId(partitionId) .key(key) .rejectionType(rejectionType) .putValue(value, 0, value.length) .putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); } }
@Override public void write(MutableDirectBuffer buffer, int offset) { EnsureUtil.ensureNotNull("recordType", recordType); EnsureUtil.ensureNotNull("valueType", valueType); EnsureUtil.ensureNotNull("intent", intent); // protocol header headerEncoder .wrap(buffer, offset) .blockLength(bodyEncoder.sbeBlockLength()) .templateId(bodyEncoder.sbeTemplateId()) .schemaId(bodyEncoder.sbeSchemaId()) .version(bodyEncoder.sbeSchemaVersion()); offset += headerEncoder.encodedLength(); // protocol message bodyEncoder .wrap(buffer, offset) .recordType(recordType) .valueType(valueType) .intent(intent.value()) .partitionId(partitionId) .key(key) .rejectionType(rejectionType) .putValue(value, 0, value.length) .putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); } }
@Override public void write(final MutableDirectBuffer buffer, int offset) { // protocol header messageHeaderEncoder .wrap(buffer, offset) .blockLength(responseEncoder.sbeBlockLength()) .templateId(responseEncoder.sbeTemplateId()) .schemaId(responseEncoder.sbeSchemaId()) .version(responseEncoder.sbeSchemaVersion()); offset += messageHeaderEncoder.encodedLength(); // protocol message responseEncoder .wrap(buffer, offset) .recordType(recordType) .partitionId(partitionId) .valueType(valueType) .intent(intent) .key(key) .rejectionType(rejectionType); offset = responseEncoder.limit(); final int eventLength = valueWriter.getLength(); buffer.putShort(offset, (short) eventLength, Protocol.ENDIANNESS); offset += valueHeaderLength(); valueWriter.write(buffer, offset); offset += eventLength; responseEncoder.limit(offset); responseEncoder.putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); }
@Override public void write(final MutableDirectBuffer buffer, int offset) { // protocol header messageHeaderEncoder .wrap(buffer, offset) .blockLength(responseEncoder.sbeBlockLength()) .templateId(responseEncoder.sbeTemplateId()) .schemaId(responseEncoder.sbeSchemaId()) .version(responseEncoder.sbeSchemaVersion()); offset += messageHeaderEncoder.encodedLength(); // protocol message responseEncoder .wrap(buffer, offset) .recordType(recordType) .partitionId(partitionId) .valueType(valueType) .intent(intent) .key(key) .rejectionType(rejectionType); offset = responseEncoder.limit(); final int eventLength = valueWriter.getLength(); buffer.putShort(offset, (short) eventLength, Protocol.ENDIANNESS); offset += valueHeaderLength(); valueWriter.write(buffer, offset); offset += eventLength; responseEncoder.limit(offset); responseEncoder.putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); }