
io.aeron.cluster.codecs.ClusterMembersExtendedResponseDecoder 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;
import org.agrona.MutableDirectBuffer;
import org.agrona.DirectBuffer;
/**
* Cluster Members status for active and passive members.
*/
@SuppressWarnings("all")
public final class ClusterMembersExtendedResponseDecoder
{
public static final int BLOCK_LENGTH = 24;
public static final int TEMPLATE_ID = 43;
public static final int SCHEMA_ID = 111;
public static final int SCHEMA_VERSION = 12;
public static final String SEMANTIC_VERSION = "5.4";
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
private final ClusterMembersExtendedResponseDecoder 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 ClusterMembersExtendedResponseDecoder 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 ClusterMembersExtendedResponseDecoder 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 ClusterMembersExtendedResponseDecoder 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 correlationIdId()
{
return 1;
}
public static int correlationIdSinceVersion()
{
return 0;
}
public static int correlationIdEncodingOffset()
{
return 0;
}
public static int correlationIdEncodingLength()
{
return 8;
}
public static String correlationIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long correlationIdNullValue()
{
return -9223372036854775808L;
}
public static long correlationIdMinValue()
{
return -9223372036854775807L;
}
public static long correlationIdMaxValue()
{
return 9223372036854775807L;
}
public long correlationId()
{
return buffer.getLong(offset + 0, BYTE_ORDER);
}
public static int currentTimeNsId()
{
return 2;
}
public static int currentTimeNsSinceVersion()
{
return 0;
}
public static int currentTimeNsEncodingOffset()
{
return 8;
}
public static int currentTimeNsEncodingLength()
{
return 8;
}
public static String currentTimeNsMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long currentTimeNsNullValue()
{
return -9223372036854775808L;
}
public static long currentTimeNsMinValue()
{
return -9223372036854775807L;
}
public static long currentTimeNsMaxValue()
{
return 9223372036854775807L;
}
public long currentTimeNs()
{
return buffer.getLong(offset + 8, BYTE_ORDER);
}
public static int leaderMemberIdId()
{
return 3;
}
public static int leaderMemberIdSinceVersion()
{
return 0;
}
public static int leaderMemberIdEncodingOffset()
{
return 16;
}
public static int leaderMemberIdEncodingLength()
{
return 4;
}
public static String leaderMemberIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int leaderMemberIdNullValue()
{
return -2147483648;
}
public static int leaderMemberIdMinValue()
{
return -2147483647;
}
public static int leaderMemberIdMaxValue()
{
return 2147483647;
}
public int leaderMemberId()
{
return buffer.getInt(offset + 16, BYTE_ORDER);
}
public static int memberIdId()
{
return 4;
}
public static int memberIdSinceVersion()
{
return 0;
}
public static int memberIdEncodingOffset()
{
return 20;
}
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 + 20, BYTE_ORDER);
}
private final ActiveMembersDecoder activeMembers = new ActiveMembersDecoder(this);
public static long activeMembersDecoderId()
{
return 5;
}
public static int activeMembersDecoderSinceVersion()
{
return 0;
}
/**
* Members of the cluster which have voting rights.
*
* @return ActiveMembersDecoder : Members of the cluster which have voting rights.
*/
public ActiveMembersDecoder activeMembers()
{
activeMembers.wrap(buffer);
return activeMembers;
}
/**
* Members of the cluster which have voting rights.
*/
public static final class ActiveMembersDecoder
implements Iterable, java.util.Iterator
{
public static final int HEADER_SIZE = 4;
private final ClusterMembersExtendedResponseDecoder parentMessage;
private DirectBuffer buffer;
private int count;
private int index;
private int offset;
private int blockLength;
ActiveMembersDecoder(final ClusterMembersExtendedResponseDecoder parentMessage)
{
this.parentMessage = parentMessage;
}
public void wrap(final DirectBuffer buffer)
{
if (buffer != this.buffer)
{
this.buffer = buffer;
}
index = 0;
final int limit = parentMessage.limit();
parentMessage.limit(limit + HEADER_SIZE);
blockLength = (buffer.getShort(limit + 0, BYTE_ORDER) & 0xFFFF);
count = (buffer.getShort(limit + 2, BYTE_ORDER) & 0xFFFF);
}
public ActiveMembersDecoder next()
{
if (index >= count)
{
throw new java.util.NoSuchElementException();
}
offset = parentMessage.limit();
parentMessage.limit(offset + blockLength);
++index;
return this;
}
public static int countMinValue()
{
return 0;
}
public static int countMaxValue()
{
return 65534;
}
public static int sbeHeaderSize()
{
return HEADER_SIZE;
}
public static int sbeBlockLength()
{
return 28;
}
public int actingBlockLength()
{
return blockLength;
}
public int actingVersion()
{
return parentMessage.actingVersion;
}
public int count()
{
return count;
}
public java.util.Iterator iterator()
{
return this;
}
public void remove()
{
throw new UnsupportedOperationException();
}
public boolean hasNext()
{
return index < count;
}
public static int leadershipTermIdId()
{
return 6;
}
public static int leadershipTermIdSinceVersion()
{
return 0;
}
public static int leadershipTermIdEncodingOffset()
{
return 0;
}
public static int leadershipTermIdEncodingLength()
{
return 8;
}
public static String leadershipTermIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long leadershipTermIdNullValue()
{
return -9223372036854775808L;
}
public static long leadershipTermIdMinValue()
{
return -9223372036854775807L;
}
public static long leadershipTermIdMaxValue()
{
return 9223372036854775807L;
}
public long leadershipTermId()
{
return buffer.getLong(offset + 0, BYTE_ORDER);
}
public static int logPositionId()
{
return 7;
}
public static int logPositionSinceVersion()
{
return 0;
}
public static int logPositionEncodingOffset()
{
return 8;
}
public static int logPositionEncodingLength()
{
return 8;
}
public static String logPositionMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long logPositionNullValue()
{
return -9223372036854775808L;
}
public static long logPositionMinValue()
{
return -9223372036854775807L;
}
public static long logPositionMaxValue()
{
return 9223372036854775807L;
}
public long logPosition()
{
return buffer.getLong(offset + 8, BYTE_ORDER);
}
public static int timeOfLastAppendNsId()
{
return 8;
}
public static int timeOfLastAppendNsSinceVersion()
{
return 0;
}
public static int timeOfLastAppendNsEncodingOffset()
{
return 16;
}
public static int timeOfLastAppendNsEncodingLength()
{
return 8;
}
public static String timeOfLastAppendNsMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long timeOfLastAppendNsNullValue()
{
return -9223372036854775808L;
}
public static long timeOfLastAppendNsMinValue()
{
return -9223372036854775807L;
}
public static long timeOfLastAppendNsMaxValue()
{
return 9223372036854775807L;
}
public long timeOfLastAppendNs()
{
return buffer.getLong(offset + 16, BYTE_ORDER);
}
public static int memberIdId()
{
return 9;
}
public static int memberIdSinceVersion()
{
return 0;
}
public static int memberIdEncodingOffset()
{
return 24;
}
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 + 24, BYTE_ORDER);
}
public static int ingressEndpointId()
{
return 10;
}
public static int ingressEndpointSinceVersion()
{
return 0;
}
public static String ingressEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String ingressEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int ingressEndpointHeaderLength()
{
return 4;
}
public int ingressEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipIngressEndpoint()
{
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 getIngressEndpoint(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 getIngressEndpoint(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 wrapIngressEndpoint(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 ingressEndpoint()
{
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 getIngressEndpoint(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 consensusEndpointId()
{
return 11;
}
public static int consensusEndpointSinceVersion()
{
return 0;
}
public static String consensusEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String consensusEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int consensusEndpointHeaderLength()
{
return 4;
}
public int consensusEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipConsensusEndpoint()
{
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 getConsensusEndpoint(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 getConsensusEndpoint(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 wrapConsensusEndpoint(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 consensusEndpoint()
{
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 getConsensusEndpoint(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 logEndpointId()
{
return 12;
}
public static int logEndpointSinceVersion()
{
return 0;
}
public static String logEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String logEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int logEndpointHeaderLength()
{
return 4;
}
public int logEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipLogEndpoint()
{
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 getLogEndpoint(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 getLogEndpoint(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 wrapLogEndpoint(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 logEndpoint()
{
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 getLogEndpoint(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 catchupEndpointId()
{
return 13;
}
public static int catchupEndpointSinceVersion()
{
return 0;
}
public static String catchupEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String catchupEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int catchupEndpointHeaderLength()
{
return 4;
}
public int catchupEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipCatchupEndpoint()
{
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 getCatchupEndpoint(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 getCatchupEndpoint(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 wrapCatchupEndpoint(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 catchupEndpoint()
{
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 getCatchupEndpoint(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 archiveEndpointId()
{
return 14;
}
public static int archiveEndpointSinceVersion()
{
return 0;
}
public static String archiveEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String archiveEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int archiveEndpointHeaderLength()
{
return 4;
}
public int archiveEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipArchiveEndpoint()
{
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 getArchiveEndpoint(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 getArchiveEndpoint(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 wrapArchiveEndpoint(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 archiveEndpoint()
{
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 getArchiveEndpoint(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 StringBuilder appendTo(final StringBuilder builder)
{
if (null == buffer)
{
return builder;
}
builder.append('(');
builder.append("leadershipTermId=");
builder.append(this.leadershipTermId());
builder.append('|');
builder.append("logPosition=");
builder.append(this.logPosition());
builder.append('|');
builder.append("timeOfLastAppendNs=");
builder.append(this.timeOfLastAppendNs());
builder.append('|');
builder.append("memberId=");
builder.append(this.memberId());
builder.append('|');
builder.append("ingressEndpoint=");
builder.append('\'');
getIngressEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("consensusEndpoint=");
builder.append('\'');
getConsensusEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("logEndpoint=");
builder.append('\'');
getLogEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("catchupEndpoint=");
builder.append('\'');
getCatchupEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("archiveEndpoint=");
builder.append('\'');
getArchiveEndpoint(builder);
builder.append('\'');
builder.append(')');
return builder;
}
public ActiveMembersDecoder sbeSkip()
{
skipIngressEndpoint();
skipConsensusEndpoint();
skipLogEndpoint();
skipCatchupEndpoint();
skipArchiveEndpoint();
return this;
}
}
private final PassiveMembersDecoder passiveMembers = new PassiveMembersDecoder(this);
public static long passiveMembersDecoderId()
{
return 15;
}
public static int passiveMembersDecoderSinceVersion()
{
return 0;
}
/**
* Members of the cluster which do not have voting rights but could become active members.
*
* @return PassiveMembersDecoder : Members of the cluster which do not have voting rights but could become active members.
*/
public PassiveMembersDecoder passiveMembers()
{
passiveMembers.wrap(buffer);
return passiveMembers;
}
/**
* Members of the cluster which do not have voting rights but could become active members.
*/
public static final class PassiveMembersDecoder
implements Iterable, java.util.Iterator
{
public static final int HEADER_SIZE = 4;
private final ClusterMembersExtendedResponseDecoder parentMessage;
private DirectBuffer buffer;
private int count;
private int index;
private int offset;
private int blockLength;
PassiveMembersDecoder(final ClusterMembersExtendedResponseDecoder parentMessage)
{
this.parentMessage = parentMessage;
}
public void wrap(final DirectBuffer buffer)
{
if (buffer != this.buffer)
{
this.buffer = buffer;
}
index = 0;
final int limit = parentMessage.limit();
parentMessage.limit(limit + HEADER_SIZE);
blockLength = (buffer.getShort(limit + 0, BYTE_ORDER) & 0xFFFF);
count = (buffer.getShort(limit + 2, BYTE_ORDER) & 0xFFFF);
}
public PassiveMembersDecoder next()
{
if (index >= count)
{
throw new java.util.NoSuchElementException();
}
offset = parentMessage.limit();
parentMessage.limit(offset + blockLength);
++index;
return this;
}
public static int countMinValue()
{
return 0;
}
public static int countMaxValue()
{
return 65534;
}
public static int sbeHeaderSize()
{
return HEADER_SIZE;
}
public static int sbeBlockLength()
{
return 28;
}
public int actingBlockLength()
{
return blockLength;
}
public int actingVersion()
{
return parentMessage.actingVersion;
}
public int count()
{
return count;
}
public java.util.Iterator iterator()
{
return this;
}
public void remove()
{
throw new UnsupportedOperationException();
}
public boolean hasNext()
{
return index < count;
}
public static int leadershipTermIdId()
{
return 16;
}
public static int leadershipTermIdSinceVersion()
{
return 0;
}
public static int leadershipTermIdEncodingOffset()
{
return 0;
}
public static int leadershipTermIdEncodingLength()
{
return 8;
}
public static String leadershipTermIdMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long leadershipTermIdNullValue()
{
return -9223372036854775808L;
}
public static long leadershipTermIdMinValue()
{
return -9223372036854775807L;
}
public static long leadershipTermIdMaxValue()
{
return 9223372036854775807L;
}
public long leadershipTermId()
{
return buffer.getLong(offset + 0, BYTE_ORDER);
}
public static int logPositionId()
{
return 17;
}
public static int logPositionSinceVersion()
{
return 0;
}
public static int logPositionEncodingOffset()
{
return 8;
}
public static int logPositionEncodingLength()
{
return 8;
}
public static String logPositionMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long logPositionNullValue()
{
return -9223372036854775808L;
}
public static long logPositionMinValue()
{
return -9223372036854775807L;
}
public static long logPositionMaxValue()
{
return 9223372036854775807L;
}
public long logPosition()
{
return buffer.getLong(offset + 8, BYTE_ORDER);
}
public static int timeOfLastAppendNsId()
{
return 18;
}
public static int timeOfLastAppendNsSinceVersion()
{
return 0;
}
public static int timeOfLastAppendNsEncodingOffset()
{
return 16;
}
public static int timeOfLastAppendNsEncodingLength()
{
return 8;
}
public static String timeOfLastAppendNsMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static long timeOfLastAppendNsNullValue()
{
return -9223372036854775808L;
}
public static long timeOfLastAppendNsMinValue()
{
return -9223372036854775807L;
}
public static long timeOfLastAppendNsMaxValue()
{
return 9223372036854775807L;
}
public long timeOfLastAppendNs()
{
return buffer.getLong(offset + 16, BYTE_ORDER);
}
public static int memberIdId()
{
return 19;
}
public static int memberIdSinceVersion()
{
return 0;
}
public static int memberIdEncodingOffset()
{
return 24;
}
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 + 24, BYTE_ORDER);
}
public static int ingressEndpointId()
{
return 20;
}
public static int ingressEndpointSinceVersion()
{
return 0;
}
public static String ingressEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String ingressEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int ingressEndpointHeaderLength()
{
return 4;
}
public int ingressEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipIngressEndpoint()
{
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 getIngressEndpoint(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 getIngressEndpoint(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 wrapIngressEndpoint(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 ingressEndpoint()
{
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 getIngressEndpoint(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 consensusEndpointId()
{
return 21;
}
public static int consensusEndpointSinceVersion()
{
return 0;
}
public static String consensusEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String consensusEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int consensusEndpointHeaderLength()
{
return 4;
}
public int consensusEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipConsensusEndpoint()
{
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 getConsensusEndpoint(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 getConsensusEndpoint(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 wrapConsensusEndpoint(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 consensusEndpoint()
{
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 getConsensusEndpoint(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 logEndpointId()
{
return 22;
}
public static int logEndpointSinceVersion()
{
return 0;
}
public static String logEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String logEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int logEndpointHeaderLength()
{
return 4;
}
public int logEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipLogEndpoint()
{
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 getLogEndpoint(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 getLogEndpoint(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 wrapLogEndpoint(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 logEndpoint()
{
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 getLogEndpoint(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 catchupEndpointId()
{
return 23;
}
public static int catchupEndpointSinceVersion()
{
return 0;
}
public static String catchupEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String catchupEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int catchupEndpointHeaderLength()
{
return 4;
}
public int catchupEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipCatchupEndpoint()
{
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 getCatchupEndpoint(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 getCatchupEndpoint(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 wrapCatchupEndpoint(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 catchupEndpoint()
{
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 getCatchupEndpoint(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 archiveEndpointId()
{
return 24;
}
public static int archiveEndpointSinceVersion()
{
return 0;
}
public static String archiveEndpointCharacterEncoding()
{
return java.nio.charset.StandardCharsets.US_ASCII.name();
}
public static String archiveEndpointMetaAttribute(final MetaAttribute metaAttribute)
{
if (MetaAttribute.PRESENCE == metaAttribute)
{
return "required";
}
return "";
}
public static int archiveEndpointHeaderLength()
{
return 4;
}
public int archiveEndpointLength()
{
final int limit = parentMessage.limit();
return (int)(buffer.getInt(limit, BYTE_ORDER) & 0xFFFF_FFFFL);
}
public int skipArchiveEndpoint()
{
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 getArchiveEndpoint(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 getArchiveEndpoint(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 wrapArchiveEndpoint(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 archiveEndpoint()
{
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 getArchiveEndpoint(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 StringBuilder appendTo(final StringBuilder builder)
{
if (null == buffer)
{
return builder;
}
builder.append('(');
builder.append("leadershipTermId=");
builder.append(this.leadershipTermId());
builder.append('|');
builder.append("logPosition=");
builder.append(this.logPosition());
builder.append('|');
builder.append("timeOfLastAppendNs=");
builder.append(this.timeOfLastAppendNs());
builder.append('|');
builder.append("memberId=");
builder.append(this.memberId());
builder.append('|');
builder.append("ingressEndpoint=");
builder.append('\'');
getIngressEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("consensusEndpoint=");
builder.append('\'');
getConsensusEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("logEndpoint=");
builder.append('\'');
getLogEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("catchupEndpoint=");
builder.append('\'');
getCatchupEndpoint(builder);
builder.append('\'');
builder.append('|');
builder.append("archiveEndpoint=");
builder.append('\'');
getArchiveEndpoint(builder);
builder.append('\'');
builder.append(')');
return builder;
}
public PassiveMembersDecoder sbeSkip()
{
skipIngressEndpoint();
skipConsensusEndpoint();
skipLogEndpoint();
skipCatchupEndpoint();
skipArchiveEndpoint();
return this;
}
}
public String toString()
{
if (null == buffer)
{
return "";
}
final ClusterMembersExtendedResponseDecoder decoder = new ClusterMembersExtendedResponseDecoder();
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("[ClusterMembersExtendedResponse](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("correlationId=");
builder.append(this.correlationId());
builder.append('|');
builder.append("currentTimeNs=");
builder.append(this.currentTimeNs());
builder.append('|');
builder.append("leaderMemberId=");
builder.append(this.leaderMemberId());
builder.append('|');
builder.append("memberId=");
builder.append(this.memberId());
builder.append('|');
builder.append("activeMembers=[");
final int activeMembersOriginalOffset = activeMembers.offset;
final int activeMembersOriginalIndex = activeMembers.index;
final ActiveMembersDecoder activeMembers = this.activeMembers();
if (activeMembers.count() > 0)
{
while (activeMembers.hasNext())
{
activeMembers.next().appendTo(builder);
builder.append(',');
}
builder.setLength(builder.length() - 1);
}
activeMembers.offset = activeMembersOriginalOffset;
activeMembers.index = activeMembersOriginalIndex;
builder.append(']');
builder.append('|');
builder.append("passiveMembers=[");
final int passiveMembersOriginalOffset = passiveMembers.offset;
final int passiveMembersOriginalIndex = passiveMembers.index;
final PassiveMembersDecoder passiveMembers = this.passiveMembers();
if (passiveMembers.count() > 0)
{
while (passiveMembers.hasNext())
{
passiveMembers.next().appendTo(builder);
builder.append(',');
}
builder.setLength(builder.length() - 1);
}
passiveMembers.offset = passiveMembersOriginalOffset;
passiveMembers.index = passiveMembersOriginalIndex;
builder.append(']');
limit(originalLimit);
return builder;
}
public ClusterMembersExtendedResponseDecoder sbeSkip()
{
sbeRewind();
ActiveMembersDecoder activeMembers = this.activeMembers();
if (activeMembers.count() > 0)
{
while (activeMembers.hasNext())
{
activeMembers.next();
activeMembers.sbeSkip();
}
}
PassiveMembersDecoder passiveMembers = this.passiveMembers();
if (passiveMembers.count() > 0)
{
while (passiveMembers.hasNext())
{
passiveMembers.next();
passiveMembers.sbeSkip();
}
}
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy