Search in sources :

Example 1 with CommandConsumerStatsResponse

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

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(org.apache.pulsar.common.api.proto.PulsarApi.CommandConsumerStatsResponse) ByteBuf(io.netty.buffer.ByteBuf)

Example 2 with CommandConsumerStatsResponse

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

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(org.apache.pulsar.common.api.proto.PulsarApi.CommandConsumerStatsResponse) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)2 CommandConsumerStatsResponse (org.apache.pulsar.common.api.proto.PulsarApi.CommandConsumerStatsResponse)2