Search in sources :

Example 1 with TCommandTransferResponse

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

the class DefaultRouteHandlerTest method testName.

@Test
public void testName() throws Exception {
    DefaultRouteHandler routeHandler = new DefaultRouteHandler(new ClusterPointRepository(), new DefaultRouteFilterChain(), new DefaultRouteFilterChain());
    CountFilter requestFilter = new CountFilter();
    routeHandler.addRequestFilter(requestFilter);
    TCommandTransferResponse response = routeHandler.onRoute(createRequestEvent());
    Assert.assertEquals(1, requestFilter.getCallCount());
    CountFilter responseFilter = new CountFilter();
    routeHandler.addResponseFilter(responseFilter);
    response = routeHandler.onRoute(createRequestEvent());
    Assert.assertEquals(2, requestFilter.getCallCount());
    Assert.assertEquals(1, responseFilter.getCallCount());
    Assert.assertEquals(TRouteResult.NOT_FOUND, response.getRouteResult());
}
Also used : ClusterPointRepository(com.navercorp.pinpoint.collector.cluster.ClusterPointRepository) TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse) Test(org.junit.Test)

Example 2 with TCommandTransferResponse

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

the class PinpointRouteResponseTest method wrapResponse.

private TCommandTransferResponse wrapResponse(TRouteResult routeResult, byte[] payload) {
    TCommandTransferResponse response = new TCommandTransferResponse();
    response.setRouteResult(routeResult);
    response.setPayload(payload);
    return response;
}
Also used : TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)

Example 3 with TCommandTransferResponse

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

the class DefaultRouteHandler method createResponse.

private TCommandTransferResponse createResponse(TRouteResult result, byte[] payload) {
    TCommandTransferResponse response = new TCommandTransferResponse();
    response.setRouteResult(result);
    response.setPayload(payload);
    return response;
}
Also used : TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)

Example 4 with TCommandTransferResponse

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

the class DefaultRouteHandler method onRoute.

@Override
public TCommandTransferResponse onRoute(RequestEvent event) {
    requestFilterChain.doEvent(event);
    TCommandTransferResponse routeResult = onRoute0(event);
    responseFilterChain.doEvent(new ResponseEvent(event, event.getRequestId(), routeResult));
    return routeResult;
}
Also used : TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)

Example 5 with TCommandTransferResponse

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

the class StreamRouteHandler method onRoute.

@Override
public TCommandTransferResponse onRoute(StreamEvent event) {
    streamCreateFilterChain.doEvent(event);
    TCommandTransferResponse routeResult = onRoute0(event);
    return routeResult;
}
Also used : TCommandTransferResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse)

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