protected int writeCommandRequestToBuffer( final UnsafeBuffer buffer, final int partitionId, final Short protocolVersion, final ValueType type, final Intent intent) { int offset = 0; final int protocolVersionToWrite = protocolVersion != null ? protocolVersion : commandRequestEncoder.sbeSchemaVersion(); final ValueType eventTypeToWrite = type != null ? type : ValueType.NULL_VAL; headerEncoder .wrap(buffer, offset) .blockLength(commandRequestEncoder.sbeBlockLength()) .schemaId(commandRequestEncoder.sbeSchemaId()) .templateId(commandRequestEncoder.sbeTemplateId()) .version(protocolVersionToWrite); offset += headerEncoder.encodedLength(); commandRequestEncoder.wrap(buffer, offset); commandRequestEncoder .partitionId(partitionId) .valueType(eventTypeToWrite) .intent(intent.value()) .putValue(JOB_EVENT, 0, JOB_EVENT.length); return headerEncoder.encodedLength() + commandRequestEncoder.encodedLength(); }
protected int writeCommandRequestToBuffer( final UnsafeBuffer buffer, final int partitionId, final Short protocolVersion, final ValueType type, final Intent intent) { int offset = 0; final int protocolVersionToWrite = protocolVersion != null ? protocolVersion : commandRequestEncoder.sbeSchemaVersion(); final ValueType eventTypeToWrite = type != null ? type : ValueType.NULL_VAL; headerEncoder .wrap(buffer, offset) .blockLength(commandRequestEncoder.sbeBlockLength()) .schemaId(commandRequestEncoder.sbeSchemaId()) .templateId(commandRequestEncoder.sbeTemplateId()) .version(protocolVersionToWrite); offset += headerEncoder.encodedLength(); commandRequestEncoder.wrap(buffer, offset); commandRequestEncoder .partitionId(partitionId) .valueType(eventTypeToWrite) .intent(intent.value()) .putValue(JOB_EVENT, 0, JOB_EVENT.length); return headerEncoder.encodedLength() + commandRequestEncoder.encodedLength(); }