Search in sources :

Example 1 with StreamEvent

use of com.navercorp.pinpoint.collector.cluster.route.StreamEvent in project pinpoint by naver.

the class ClusterPointRouter method handleStreamRouteCreate.

private StreamCode handleStreamRouteCreate(TCommandTransfer request, StreamCreatePacket packet, ServerStreamChannelContext streamChannelContext) {
    byte[] payload = ((TCommandTransfer) request).getPayload();
    TBase<?, ?> command = deserialize(payload);
    if (command == null) {
        return StreamCode.TYPE_UNKNOWN;
    }
    TCommandTransferResponse response = streamRouteHandler.onRoute(new StreamEvent((TCommandTransfer) request, streamChannelContext, command));
    TRouteResult routeResult = response.getRouteResult();
    if (routeResult != TRouteResult.OK) {
        logger.warn("handleStreamRouteCreate failed. command:{}, routeResult:{}", command, routeResult);
        return convertToStreamCode(routeResult);
    }
    return StreamCode.OK;
}
Also used : TCommandTransfer(com.navercorp.pinpoint.thrift.dto.command.TCommandTransfer) TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse) StreamEvent(com.navercorp.pinpoint.collector.cluster.route.StreamEvent) TRouteResult(com.navercorp.pinpoint.thrift.dto.command.TRouteResult)

Aggregations

StreamEvent (com.navercorp.pinpoint.collector.cluster.route.StreamEvent)1 TCommandTransfer (com.navercorp.pinpoint.thrift.dto.command.TCommandTransfer)1 TCommandTransferResponse (com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)1 TRouteResult (com.navercorp.pinpoint.thrift.dto.command.TRouteResult)1