Search in sources :

Example 1 with CommandFlow

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

the class Commands method newFlow.

public static ByteBuf newFlow(long consumerId, int messagePermits) {
    CommandFlow.Builder flowBuilder = CommandFlow.newBuilder();
    flowBuilder.setConsumerId(consumerId);
    flowBuilder.setMessagePermits(messagePermits);
    CommandFlow flow = flowBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.FLOW).setFlow(flowBuilder));
    flow.recycle();
    flowBuilder.recycle();
    return res;
}
Also used : CommandFlow(com.yahoo.pulsar.common.api.proto.PulsarApi.CommandFlow) UnpooledHeapByteBuf(io.netty.buffer.UnpooledHeapByteBuf) RecyclableDuplicateByteBuf(io.netty.buffer.RecyclableDuplicateByteBuf) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

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