*/
protected void handleRead(SelectionKey key) {
FrameBuffer buffer = (FrameBuffer) key.attachment();
ThriftTracer readTracer = ThriftTracer.NOTHING;
if (buffer.context_ != null) {
ServerContext context = buffer.context_;
if (context instanceof ThriftTrace) {
ThriftTrace thriftTrace = (ThriftTrace) context;
readTracer = thriftTrace.getTracer("thrift - handle read");
}
}
readTracer.start();
try {
if (!buffer.read()) {
cleanupSelectionKey(key);
return;
}
} finally {
readTracer.end();
}
// if the buffer's frame read is complete, invoke the method.
if (buffer.isFrameFullyRead()) {
ThriftTracer processTracer = ThriftTracer.NOTHING;
if (buffer.context_ != null) {
ServerContext context = buffer.context_;
if (context instanceof ThriftTrace) {
ThriftTrace thriftTrace = (ThriftTrace) context;
processTracer = thriftTrace.getTracer("thrift - handle request");
}
}