Search in sources :

Example 1 with CommandSend

use of com.yahoo.pulsar.common.api.proto.PulsarApi.CommandSend in project pulsar by yahoo.

the class Commands method newSend.

public static ByteBuf newSend(long producerId, long sequenceId, int numMessages, ChecksumType checksumType, MessageMetadata messageData, ByteBuf payload) {
    CommandSend.Builder sendBuilder = CommandSend.newBuilder();
    sendBuilder.setProducerId(producerId);
    sendBuilder.setSequenceId(sequenceId);
    if (numMessages > 1) {
        sendBuilder.setNumMessages(numMessages);
    }
    CommandSend send = sendBuilder.build();
    ByteBuf res = serializeCommandSendWithSize(BaseCommand.newBuilder().setType(Type.SEND).setSend(send), checksumType, messageData, payload);
    send.recycle();
    sendBuilder.recycle();
    return res;
}
Also used : CommandSend(com.yahoo.pulsar.common.api.proto.PulsarApi.CommandSend) UnpooledHeapByteBuf(io.netty.buffer.UnpooledHeapByteBuf) RecyclableDuplicateByteBuf(io.netty.buffer.RecyclableDuplicateByteBuf) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

CommandSend (com.yahoo.pulsar.common.api.proto.PulsarApi.CommandSend)1 ByteBuf (io.netty.buffer.ByteBuf)1 RecyclableDuplicateByteBuf (io.netty.buffer.RecyclableDuplicateByteBuf)1 UnpooledHeapByteBuf (io.netty.buffer.UnpooledHeapByteBuf)1