Search in sources :

Example 1 with CommandConsumerStatsResponse

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

the class Commands method newConsumerStatsResponse.

public static ByteBuf newConsumerStatsResponse(ServerError serverError, String errMsg, long requestId) {
    CommandConsumerStatsResponse.Builder commandConsumerStatsResponseBuilder = CommandConsumerStatsResponse.newBuilder();
    commandConsumerStatsResponseBuilder.setRequestId(requestId);
    commandConsumerStatsResponseBuilder.setErrorMessage(errMsg);
    commandConsumerStatsResponseBuilder.setErrorCode(serverError);
    CommandConsumerStatsResponse commandConsumerStatsResponse = commandConsumerStatsResponseBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.CONSUMER_STATS_RESPONSE).setConsumerStatsResponse(commandConsumerStatsResponseBuilder));
    commandConsumerStatsResponse.recycle();
    commandConsumerStatsResponseBuilder.recycle();
    return res;
}
Also used : CommandConsumerStatsResponse(com.yahoo.pulsar.common.api.proto.PulsarApi.CommandConsumerStatsResponse) UnpooledHeapByteBuf(io.netty.buffer.UnpooledHeapByteBuf) RecyclableDuplicateByteBuf(io.netty.buffer.RecyclableDuplicateByteBuf) ByteBuf(io.netty.buffer.ByteBuf)

Example 2 with CommandConsumerStatsResponse

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

the class Commands method newConsumerStatsResponse.

public static ByteBuf newConsumerStatsResponse(CommandConsumerStatsResponse.Builder builder) {
    CommandConsumerStatsResponse commandConsumerStatsResponse = builder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.CONSUMER_STATS_RESPONSE).setConsumerStatsResponse(builder));
    commandConsumerStatsResponse.recycle();
    builder.recycle();
    return res;
}
Also used : CommandConsumerStatsResponse(com.yahoo.pulsar.common.api.proto.PulsarApi.CommandConsumerStatsResponse) UnpooledHeapByteBuf(io.netty.buffer.UnpooledHeapByteBuf) RecyclableDuplicateByteBuf(io.netty.buffer.RecyclableDuplicateByteBuf) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

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