
io.aeron.cluster.codecs.mark.MarkFileHeaderDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aeron-all Show documentation
Show all versions of aeron-all Show documentation
Efficient reliable UDP unicast, UDP multicast, and IPC transport protocol.
/* Generated SBE (Simple Binary Encoding) message codec. */
package io.aeron.cluster.codecs.mark;
import org.agrona.MutableDirectBuffer;
import org.agrona.DirectBuffer;
/**
* Header of Consensus Module and Container Mark file.
*/
@SuppressWarnings("all")
public final class MarkFileHeaderDecoder
{
public static final int BLOCK_LENGTH = 128;
public static final int TEMPLATE_ID = 200;
public static final int SCHEMA_ID = 110;
public static final int SCHEMA_VERSION = 1;
public static final String SEMANTIC_VERSION = "5.4";
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
private final MarkFileHeaderDecoder parentMessage = this;
private DirectBuffer buffer;
private int offset;
private int limit;
int actingBlockLength;
int actingVersion;
public int sbeBlockLength()
{
return BLOCK_LENGTH;
}
public int sbeTemplateId()
{
return TEMPLATE_ID;
}
public int sbeSchemaId()
{
return SCHEMA_ID;
}
public int sbeSchemaVersion()
{
return SCHEMA_VERSION;
}
public String sbeSemanticType()
{
return "";
}
public DirectBuffer buffer()
{
return buffer;
}
public int offset()
{
return offset;
}
public MarkFileHeaderDecoder wrap(
final DirectBuffer buffer,
final int offset,
final int actingBlockLength,
final int actingVersion)
{
if (buffer != this.buffer)
{
this.buffer = buffer;
}
this.offset = offset;
this.actingBlockLength = actingBlockLength;
this.actingVersion = actingVersion;
limit(offset + actingBlockLength);
return this;
}
public MarkFileHeaderDecoder wrapAndApplyHeader(
final DirectBuffer buffer,
final int offset,
final MessageHeaderDecoder headerDecoder)
{
headerDecoder.wrap(buffer, offset);
final int templateId = headerDecoder.templateId();
if (TEMPLATE_ID != templateId)
{
throw new IllegalStateException("Invalid TEMPLATE_ID: " + templateId);
}
return wrap(
buffer,
offset + MessageHeaderDecoder.ENCODED_LENGTH,
headerDecoder.blockLength(),
headerDecoder.version());
}
public MarkFileHeaderDecoder sbeRewind()
{
return wrap(buffer, offset, actingBlockLength, actingVersion);
}
public int sbeDecodedLength()
{
final int currentLimit = limit();
sbeSkip();
final int decodedLength = encodedLength();
limit(currentLimit);
return decodedLength;
}
public int actingVersion()
{
return actingVersion;
}
public int encodedLength()
{
return limit - offset;
}
public int limit()
{
return limit;
}
public void limit(final int limit)
{
this.limit = limit;
}
public static int versionId()
{
return 1;
}
public static int versionSinceVersion()
{
return 0;
}
public static int versionEncodingOffset()
{
return 0;
}
public static int versionEncodingLength()
{
return 4;
}
public static String versionMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int versionNullValue()
{
return -2147483648;
}
public static int versionMinValue()
{
return -2147483647;
}
public static int versionMaxValue()
{
return 2147483647;
}
public int version()
{
return buffer.getInt(offset + 0, BYTE_ORDER);
}
public static int componentTypeId()
{
return 2;
}
public static int componentTypeSinceVersion()
{
return 0;
}
public static int componentTypeEncodingOffset()
{
return 4;
}
public static int componentTypeEncodingLength()
{
return 4;
}
public static String componentTypeMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public int componentTypeRaw()
{
return buffer.getInt(offset + 4, BYTE_ORDER);
}
public ClusterComponentType componentType()
{
return ClusterComponentType.get(buffer.getInt(offset + 4, BYTE_ORDER));
}
public static int activityTimestampId()
{
return 3;
}
public static int activityTimestampSinceVersion()
{
return 0;
}
public static int activityTimestampEncodingOffset()
{
return 8;
}
public static int activityTimestampEncodingLength()
{
return 8;
}
public static String activityTimestampMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long activityTimestampNullValue()
{
return -9223372036854775808L;
}
public static long activityTimestampMinValue()
{
return -9223372036854775807L;
}
public static long activityTimestampMaxValue()
{
return 9223372036854775807L;
}
public long activityTimestamp()
{
return buffer.getLong(offset + 8, BYTE_ORDER);
}
public static int startTimestampId()
{
return 4;
}
public static int startTimestampSinceVersion()
{
return 0;
}
public static int startTimestampEncodingOffset()
{
return 16;
}
public static int startTimestampEncodingLength()
{
return 8;
}
public static String startTimestampMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long startTimestampNullValue()
{
return -9223372036854775808L;
}
public static long startTimestampMinValue()
{
return -9223372036854775807L;
}
public static long startTimestampMaxValue()
{
return 9223372036854775807L;
}
public long startTimestamp()
{
return buffer.getLong(offset + 16, BYTE_ORDER);
}
public static int pidId()
{
return 5;
}
public static int pidSinceVersion()
{
return 0;
}
public static int pidEncodingOffset()
{
return 24;
}
public static int pidEncodingLength()
{
return 8;
}
public static String pidMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long pidNullValue()
{
return -9223372036854775808L;
}
public static long pidMinValue()
{
return -9223372036854775807L;
}
public static long pidMaxValue()
{
return 9223372036854775807L;
}
public long pid()
{
return buffer.getLong(offset + 24, BYTE_ORDER);
}
public static int candidateTermIdId()
{
return 6;
}
public static int candidateTermIdSinceVersion()
{
return 0;
}
public static int candidateTermIdEncodingOffset()
{
return 32;
}
public static int candidateTermIdEncodingLength()
{
return 8;
}
public static String candidateTermIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long candidateTermIdNullValue()
{
return -9223372036854775808L;
}
public static long candidateTermIdMinValue()
{
return -9223372036854775807L;
}
public static long candidateTermIdMaxValue()
{
return 9223372036854775807L;
}
public long candidateTermId()
{
return buffer.getLong(offset + 32, BYTE_ORDER);
}
public static int archiveStreamIdId()
{
return 7;
}
public static int archiveStreamIdSinceVersion()
{
return 0;
}
public static int archiveStreamIdEncodingOffset()
{
return 40;
}
public static int archiveStreamIdEncodingLength()
{
return 4;
}
public static String archiveStreamIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int archiveStreamIdNullValue()
{
return -2147483648;
}
public static int archiveStreamIdMinValue()
{
return -2147483647;
}
public static int archiveStreamIdMaxValue()
{
return 2147483647;
}
public int archiveStreamId()
{
return buffer.getInt(offset + 40, BYTE_ORDER);
}
public static int serviceStreamIdId()
{
return 8;
}
public static int serviceStreamIdSinceVersion()
{
return 0;
}
public static int serviceStreamIdEncodingOffset()
{
return 44;
}
public static int serviceStreamIdEncodingLength()
{
return 4;
}
public static String serviceStreamIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int serviceStreamIdNullValue()
{
return -2147483648;
}
public static int serviceStreamIdMinValue()
{
return -2147483647;
}
public static int serviceStreamIdMaxValue()
{
return 2147483647;
}
public int serviceStreamId()
{
return buffer.getInt(offset + 44, BYTE_ORDER);
}
public static int consensusModuleStreamIdId()
{
return 9;
}
public static int consensusModuleStreamIdSinceVersion()
{
return 0;
}
public static int consensusModuleStreamIdEncodingOffset()
{
return 48;
}
public static int consensusModuleStreamIdEncodingLength()
{
return 4;
}
public static String consensusModuleStreamIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int consensusModuleStreamIdNullValue()
{
return -2147483648;
}
public static int consensusModuleStreamIdMinValue()
{
return -2147483647;
}
public static int consensusModuleStreamIdMaxValue()
{
return 2147483647;
}
public int consensusModuleStreamId()
{
return buffer.getInt(offset + 48, BYTE_ORDER);
}
public static int ingressStreamIdId()
{
return 10;
}
public static int ingressStreamIdSinceVersion()
{
return 0;
}
public static int ingressStreamIdEncodingOffset()
{
return 52;
}
public static int ingressStreamIdEncodingLength()
{
return 4;
}
public static String ingressStreamIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int ingressStreamIdNullValue()
{
return -2147483648;
}
public static int ingressStreamIdMinValue()
{
return -2147483647;
}
public static int ingressStreamIdMaxValue()
{
return 2147483647;
}
public int ingressStreamId()
{
return buffer.getInt(offset + 52, BYTE_ORDER);
}
public static int memberIdId()
{
return 11;
}
public static int memberIdSinceVersion()
{
return 0;
}
public static int memberIdEncodingOffset()
{
return 56;
}
public static int memberIdEncodingLength()
{
return 4;
}
public static String memberIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int memberIdNullValue()
{
return -2147483648;
}
public static int memberIdMinValue()
{
return -2147483647;
}
public static int memberIdMaxValue()
{
return 2147483647;
}
public int memberId()
{
return buffer.getInt(offset + 56, BYTE_ORDER);
}
public static int serviceIdId()
{
return 12;
}
public static int serviceIdSinceVersion()
{
return 0;
}
public static int serviceIdEncodingOffset()
{
return 60;
}
public static int serviceIdEncodingLength()
{
return 4;
}
public static String serviceIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int serviceIdNullValue()
{
return -2147483648;
}
public static int serviceIdMinValue()
{
return -2147483647;
}
public static int serviceIdMaxValue()
{
return 2147483647;
}
public int serviceId()
{
return buffer.getInt(offset + 60, BYTE_ORDER);
}
public static int headerLengthId()
{
return 13;
}
public static int headerLengthSinceVersion()
{
return 0;
}
public static int headerLengthEncodingOffset()
{
return 64;
}
public static int headerLengthEncodingLength()
{
return 4;
}
public static String headerLengthMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int headerLengthNullValue()
{
return -2147483648;
}
public static int headerLengthMinValue()
{
return -2147483647;
}
public static int headerLengthMaxValue()
{
return 2147483647;
}
public int headerLength()
{
return buffer.getInt(offset + 64, BYTE_ORDER);
}
public static int errorBufferLengthId()
{
return 14;
}
public static int errorBufferLengthSinceVersion()
{
return 0;
}
public static int errorBufferLengthEncodingOffset()
{
return 68;
}
public static int errorBufferLengthEncodingLength()
{
return 4;
}
public static String errorBufferLengthMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int errorBufferLengthNullValue()
{
return -2147483648;
}
public static int errorBufferLengthMinValue()
{
return -2147483647;
}
public static int errorBufferLengthMaxValue()
{
return 2147483647;
}
public int errorBufferLength()
{
return buffer.getInt(offset + 68, BYTE_ORDER);
}
public static int clusterIdId()
{
return 15;
}
public static int clusterIdSinceVersion()
{
return 0;
}
public static int clusterIdEncodingOffset()
{
return 72;
}
public static int clusterIdEncodingLength()
{
return 4;
}
public static String clusterIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int clusterIdNullValue()
{
return -2147483648;
}
public static int clusterIdMinValue()
{
return -2147483647;
}
public static int clusterIdMaxValue()
{
return 2147483647;
}
public int clusterId()
{
return buffer.getInt(offset + 72, BYTE_ORDER);
}
public static int aeronDirectoryId()
{
return 16;
}
public static int aeronDirectorySinceVersion()
{
return 0;
}
public static String aeronDirectoryCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String aeronDirectoryMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int aeronDirectoryHeaderLength()
{
return 4;
}
public int aeronDirectoryLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipAeronDirectory()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
return dataLength;
}
public int getAeronDirectory(final MutableDirectBuffer dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public int getAeronDirectory(final byte[] dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public void wrapAeronDirectory(final DirectBuffer wrapBuffer)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
}
public String aeronDirectory()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
if (0 == dataLength)
{
return "";
}
final byte[] tmp = new byte[dataLength];
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
}
public int getAeronDirectory(final Appendable appendable)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);
return dataLength;
}
public static int controlChannelId()
{
return 17;
}
public static int controlChannelSinceVersion()
{
return 0;
}
public static String controlChannelCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String controlChannelMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int controlChannelHeaderLength()
{
return 4;
}
public int controlChannelLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipControlChannel()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
return dataLength;
}
public int getControlChannel(final MutableDirectBuffer dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public int getControlChannel(final byte[] dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public void wrapControlChannel(final DirectBuffer wrapBuffer)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
}
public String controlChannel()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
if (0 == dataLength)
{
return "";
}
final byte[] tmp = new byte[dataLength];
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
}
public int getControlChannel(final Appendable appendable)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);
return dataLength;
}
public static int ingressChannelId()
{
return 18;
}
public static int ingressChannelSinceVersion()
{
return 0;
}
public static String ingressChannelCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String ingressChannelMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int ingressChannelHeaderLength()
{
return 4;
}
public int ingressChannelLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipIngressChannel()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
return dataLength;
}
public int getIngressChannel(final MutableDirectBuffer dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public int getIngressChannel(final byte[] dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public void wrapIngressChannel(final DirectBuffer wrapBuffer)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
}
public String ingressChannel()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
if (0 == dataLength)
{
return "";
}
final byte[] tmp = new byte[dataLength];
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
}
public int getIngressChannel(final Appendable appendable)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);
return dataLength;
}
public static int serviceNameId()
{
return 19;
}
public static int serviceNameSinceVersion()
{
return 0;
}
public static String serviceNameCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String serviceNameMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int serviceNameHeaderLength()
{
return 4;
}
public int serviceNameLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipServiceName()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
return dataLength;
}
public int getServiceName(final MutableDirectBuffer dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public int getServiceName(final byte[] dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public void wrapServiceName(final DirectBuffer wrapBuffer)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
}
public String serviceName()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
if (0 == dataLength)
{
return "";
}
final byte[] tmp = new byte[dataLength];
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
}
public int getServiceName(final Appendable appendable)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);
return dataLength;
}
public static int authenticatorId()
{
return 20;
}
public static int authenticatorSinceVersion()
{
return 0;
}
public static String authenticatorCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String authenticatorMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int authenticatorHeaderLength()
{
return 4;
}
public int authenticatorLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipAuthenticator()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
return dataLength;
}
public int getAuthenticator(final MutableDirectBuffer dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public int getAuthenticator(final byte[] dst, final int dstOffset, final int length)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public void wrapAuthenticator(final DirectBuffer wrapBuffer)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
}
public String authenticator()
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
if (0 == dataLength)
{
return "";
}
final byte[] tmp = new byte[dataLength];
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
}
public int getAuthenticator(final Appendable appendable)
{
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);
return dataLength;
}
public static int servicesClusterDirId()
{
return 21;
}
public static int servicesClusterDirSinceVersion()
{
return 1;
}
public static String servicesClusterDirCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String servicesClusterDirMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int servicesClusterDirHeaderLength()
{
return 4;
}
public int servicesClusterDirLength()
{
if (parentMessage.actingVersion < 1)
{
return 0;
}
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipServicesClusterDir()
{
if (parentMessage.actingVersion < 1)
{
return 0;
}
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
return dataLength;
}
public int getServicesClusterDir(final MutableDirectBuffer dst, final int dstOffset, final int length)
{
if (parentMessage.actingVersion < 1)
{
return 0;
}
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public int getServicesClusterDir(final byte[] dst, final int dstOffset, final int length)
{
if (parentMessage.actingVersion < 1)
{
return 0;
}
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int bytesCopied = Math.min(length, dataLength);
parentMessage.limit(limit + headerLength + dataLength);
buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);
return bytesCopied;
}
public void wrapServicesClusterDir(final DirectBuffer wrapBuffer)
{
if (parentMessage.actingVersion < 1)
{
wrapBuffer.wrap(buffer, offset, 0);
return;
}
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
}
public String servicesClusterDir()
{
if (parentMessage.actingVersion < 1)
{
return "";
}
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
parentMessage.limit(limit + headerLength + dataLength);
if (0 == dataLength)
{
return "";
}
final byte[] tmp = new byte[dataLength];
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
}
public int getServicesClusterDir(final Appendable appendable)
{
if (parentMessage.actingVersion < 1)
{
return 0;
}
final int headerLength = 4;
final int limit = parentMessage.limit();
final int dataLength = (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
final int dataOffset = limit + headerLength;
parentMessage.limit(dataOffset + dataLength);
buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);
return dataLength;
}
public String toString()
{
if (null == buffer)
{
return "";
}
final MarkFileHeaderDecoder decoder = new MarkFileHeaderDecoder();
decoder.wrap(buffer, offset, actingBlockLength, actingVersion);
return decoder.appendTo(new StringBuilder()).toString();
}
public StringBuilder appendTo(final StringBuilder builder)
{
if (null == buffer)
{
return builder;
}
final int originalLimit = limit();
limit(offset + actingBlockLength);
builder.append("[MarkFileHeader](sbeTemplateId=");
builder.append(TEMPLATE_ID);
builder.append("|sbeSchemaId=");
builder.append(SCHEMA_ID);
builder.append("|sbeSchemaVersion=");
if (parentMessage.actingVersion != SCHEMA_VERSION)
{
builder.append(parentMessage.actingVersion);
builder.append('/');
}
builder.append(SCHEMA_VERSION);
builder.append("|sbeBlockLength=");
if (actingBlockLength != BLOCK_LENGTH)
{
builder.append(actingBlockLength);
builder.append('/');
}
builder.append(BLOCK_LENGTH);
builder.append("):");
builder.append("version=");
builder.append(this.version());
builder.append('|');
builder.append("componentType=");
builder.append(this.componentType());
builder.append('|');
builder.append("activityTimestamp=");
builder.append(this.activityTimestamp());
builder.append('|');
builder.append("startTimestamp=");
builder.append(this.startTimestamp());
builder.append('|');
builder.append("pid=");
builder.append(this.pid());
builder.append('|');
builder.append("candidateTermId=");
builder.append(this.candidateTermId());
builder.append('|');
builder.append("archiveStreamId=");
builder.append(this.archiveStreamId());
builder.append('|');
builder.append("serviceStreamId=");
builder.append(this.serviceStreamId());
builder.append('|');
builder.append("consensusModuleStreamId=");
builder.append(this.consensusModuleStreamId());
builder.append('|');
builder.append("ingressStreamId=");
builder.append(this.ingressStreamId());
builder.append('|');
builder.append("memberId=");
builder.append(this.memberId());
builder.append('|');
builder.append("serviceId=");
builder.append(this.serviceId());
builder.append('|');
builder.append("headerLength=");
builder.append(this.headerLength());
builder.append('|');
builder.append("errorBufferLength=");
builder.append(this.errorBufferLength());
builder.append('|');
builder.append("clusterId=");
builder.append(this.clusterId());
builder.append('|');
builder.append("aeronDirectory=");
builder.append('\'');
getAeronDirectory(builder);
builder.append('\'');
builder.append('|');
builder.append("controlChannel=");
builder.append('\'');
getControlChannel(builder);
builder.append('\'');
builder.append('|');
builder.append("ingressChannel=");
builder.append('\'');
getIngressChannel(builder);
builder.append('\'');
builder.append('|');
builder.append("serviceName=");
builder.append('\'');
getServiceName(builder);
builder.append('\'');
builder.append('|');
builder.append("authenticator=");
builder.append('\'');
getAuthenticator(builder);
builder.append('\'');
builder.append('|');
builder.append("servicesClusterDir=");
builder.append('\'');
getServicesClusterDir(builder);
builder.append('\'');
limit(originalLimit);
return builder;
}
public MarkFileHeaderDecoder sbeSkip()
{
sbeRewind();
skipAeronDirectory();
skipControlChannel();
skipIngressChannel();
skipServiceName();
skipAuthenticator();
skipServicesClusterDir();
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy