org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer Java Examples

The following examples show how to use org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AsyncEchoTestServer.java    From pinpoint with Apache License 2.0 6 votes vote down vote up
@Override
public void verifyServerTraces(PluginTestVerifier verifier) throws Exception {
    final InetSocketAddress socketAddress = super.environment.getServerAddress();
    final String address = SocketAddressUtils.getAddressFirst(socketAddress);
    verifier.verifyTraceCount(2);
    Method process = TBaseAsyncProcessor.class.getDeclaredMethod("process", AsyncFrameBuffer.class);
    // RootSpan
    verifier.verifyTrace(root("THRIFT_SERVER", // ServiceType,
            "Thrift Server Invocation", // Method
            "com/navercorp/pinpoint/plugin/thrift/dto/EchoService/echo", // rpc
            HostAndPort.toHostAndPortString(address, socketAddress.getPort()), // endPoint
            address // remoteAddress
    ));
    // SpanEvent - TBaseAsyncProcessor.process
    verifier.verifyTrace(event("THRIFT_SERVER_INTERNAL", process));
}
 
Example #2
Source File: TBaseAsyncProcessorProcessInterceptor.java    From pinpoint with Apache License 2.0 6 votes vote down vote up
@Override
public void before(Object target, Object[] args) {
    if (isDebug) {
        logger.beforeInterceptor(target, args);
    }
    // process(final AsyncFrameBuffer fb)
    if (args.length != 1) {
        return;
    }
    // Set server markers
    if (args[0] instanceof AsyncFrameBuffer) {
        AsyncFrameBuffer frameBuffer = (AsyncFrameBuffer)args[0];
        attachMarkersToInputProtocol(frameBuffer.getInputProtocol(), true);
    }

}
 
Example #3
Source File: TBaseAsyncProcessorProcessInterceptor.java    From pinpoint with Apache License 2.0 6 votes vote down vote up
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (isDebug) {
        logger.afterInterceptor(target, args, result, throwable);
    }
    // Unset server markers
    if (args[0] instanceof AsyncFrameBuffer) {
        AsyncFrameBuffer frameBuffer = (AsyncFrameBuffer)args[0];
        attachMarkersToInputProtocol(frameBuffer.getInputProtocol(), false);
    }
    final Trace trace = this.traceContext.currentRawTraceObject();
    if (trace == null) {
        return;
    }
    this.traceContext.removeTraceObject();
    if (trace.canSampled()) {
        try {
            processTraceObject(trace, target, args, throwable);
        } catch (Throwable t) {
            logger.warn("Error processing trace object. Cause:{}", t.getMessage(), t);
        } finally {
            trace.close();
        }
    }
}