Search in sources :

Example 11 with TCommandTransferResponse

use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.

the class AgentEventHandler method handleResponseEvent.

public void handleResponseEvent(ResponseEvent responseEvent, long eventTimestamp) {
    if (responseEvent == null) {
        throw new NullPointerException("responseEvent may not be null");
    }
    TCommandTransferResponse response = responseEvent.getRouteResult();
    if (response.getRouteResult() != TRouteResult.OK) {
        return;
    }
    this.executor.execute(new AgentResponseEventHandlerDispatch(responseEvent, eventTimestamp));
}
Also used : TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)

Example 12 with TCommandTransferResponse

use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.

the class DefaultPinpointRouteResponse method parse.

public void parse(DeserializerFactory<HeaderTBaseDeserializer> commandDeserializerFactory) {
    if (!isParsed) {
        if (payload == null || payload.length == 0) {
            routeResult = TRouteResult.EMPTY_RESPONSE;
            return;
        }
        TBase object = deserialize(commandDeserializerFactory, payload, null);
        if (object == null) {
            routeResult = TRouteResult.NOT_SUPPORTED_RESPONSE;
        } else if (object instanceof TCommandTransferResponse) {
            TCommandTransferResponse commandResponse = (TCommandTransferResponse) object;
            TRouteResult routeResult = commandResponse.getRouteResult();
            if (routeResult == null) {
                this.routeResult = TRouteResult.UNKNOWN;
            } else {
                this.routeResult = routeResult;
            }
            response = deserialize(commandDeserializerFactory, commandResponse.getPayload(), null);
        } else {
            routeResult = TRouteResult.UNKNOWN;
            response = object;
        }
        isParsed = true;
    }
}
Also used : TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse) TRouteResult(com.navercorp.pinpoint.thrift.dto.command.TRouteResult) TBase(org.apache.thrift.TBase)

Aggregations

TCommandTransferResponse (com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)12 TCommandTransfer (com.navercorp.pinpoint.thrift.dto.command.TCommandTransfer)4 Test (org.junit.Test)3 ResponseEvent (com.navercorp.pinpoint.collector.cluster.route.ResponseEvent)2 AgentEventBo (com.navercorp.pinpoint.common.server.bo.AgentEventBo)2 TRouteResult (com.navercorp.pinpoint.thrift.dto.command.TRouteResult)2 HeaderTBaseDeserializer (com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializer)2 ClusterPointRepository (com.navercorp.pinpoint.collector.cluster.ClusterPointRepository)1 RequestEvent (com.navercorp.pinpoint.collector.cluster.route.RequestEvent)1 StreamEvent (com.navercorp.pinpoint.collector.cluster.route.StreamEvent)1 AgentEventType (com.navercorp.pinpoint.common.server.util.AgentEventType)1 TCommandEcho (com.navercorp.pinpoint.thrift.dto.command.TCommandEcho)1 TCommandThreadDumpResponse (com.navercorp.pinpoint.thrift.dto.command.TCommandThreadDumpResponse)1 TBase (org.apache.thrift.TBase)1