Search in sources :

Example 1 with MembersEncoder

use of io.zeebe.clustering.management.InvitationRequestEncoder.MembersEncoder in project zeebe by zeebe-io.

the class InvitationRequest method write.

@Override
public void write(final MutableDirectBuffer buffer, int offset) {
    headerEncoder.wrap(buffer, offset).blockLength(bodyEncoder.sbeBlockLength()).templateId(bodyEncoder.sbeTemplateId()).schemaId(bodyEncoder.sbeSchemaId()).version(bodyEncoder.sbeSchemaVersion());
    offset += headerEncoder.encodedLength();
    final int size = members.size();
    final MembersEncoder encoder = bodyEncoder.wrap(buffer, offset).partitionId(partitionId).term(term).membersCount(size);
    for (int i = 0; i < size; i++) {
        final SocketAddress member = members.get(i);
        encoder.next().port(member.port()).putHost(member.getHostBuffer(), 0, member.hostLength());
    }
    bodyEncoder.putTopicName(topicName, 0, topicName.capacity());
}
Also used : MembersEncoder(io.zeebe.clustering.management.InvitationRequestEncoder.MembersEncoder) SocketAddress(io.zeebe.transport.SocketAddress)

Aggregations

MembersEncoder (io.zeebe.clustering.management.InvitationRequestEncoder.MembersEncoder)1 SocketAddress (io.zeebe.transport.SocketAddress)1