本文整理汇总了Java中org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer类的典型用法代码示例。如果您正苦于以下问题:Java AsyncFrameBuffer类的具体用法?Java AsyncFrameBuffer怎么用?Java AsyncFrameBuffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AsyncFrameBuffer类属于org.apache.thrift.server.AbstractNonblockingServer包,在下文中一共展示了AsyncFrameBuffer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyServerTraces
import org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer; //导入依赖的package包/类
@Override
public void verifyServerTraces(PluginTestVerifier verifier) throws Exception {
final InetSocketAddress actualServerAddress = super.environment.getServerAddress();
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
actualServerAddress.getHostName() + ":" + actualServerAddress.getPort(), // endPoint
actualServerAddress.getHostName() // remoteAddress
));
// SpanEvent - TBaseAsyncProcessor.process
verifier.verifyTrace(event("THRIFT_SERVER_INTERNAL", process));
verifier.verifyTraceCount(0);
}
示例2: before
import org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer; //导入依赖的package包/类
@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);
}
}
示例3: after
import org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer; //导入依赖的package包/类
@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();
}
}
}
示例4: getResultHandler
import org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer; //导入依赖的package包/类
public AsyncMethodCallback<Void> getResultHandler(
final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
}
public void onError(Exception e) {
}
};
}