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());
}
Aggregations