Search in sources :

Example 1 with CommandSeek

use of org.apache.pulsar.common.api.proto.PulsarApi.CommandSeek in project incubator-pulsar by apache.

the class Commands method newSeek.

public static ByteBuf newSeek(long consumerId, long requestId, long ledgerId, long entryId) {
    CommandSeek.Builder seekBuilder = CommandSeek.newBuilder();
    seekBuilder.setConsumerId(consumerId);
    seekBuilder.setRequestId(requestId);
    MessageIdData.Builder messageIdBuilder = MessageIdData.newBuilder();
    messageIdBuilder.setLedgerId(ledgerId);
    messageIdBuilder.setEntryId(entryId);
    MessageIdData messageId = messageIdBuilder.build();
    seekBuilder.setMessageId(messageId);
    CommandSeek seek = seekBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.SEEK).setSeek(seek));
    messageId.recycle();
    messageIdBuilder.recycle();
    seekBuilder.recycle();
    seek.recycle();
    return res;
}
Also used : CommandSeek(org.apache.pulsar.common.api.proto.PulsarApi.CommandSeek) MessageIdData(org.apache.pulsar.common.api.proto.PulsarApi.MessageIdData) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 CommandSeek (org.apache.pulsar.common.api.proto.PulsarApi.CommandSeek)1 MessageIdData (org.apache.pulsar.common.api.proto.PulsarApi.MessageIdData)1