message = SinkManager.processInboundMessage(message, id);
if (message == null)
return;
Runnable runnable = new MessageDeliveryTask(message, id, timestamp);
TracingAwareExecutorService stage = StageManager.getStage(message.getMessageType());
assert stage != null : "No stage for message type " + message.verb;
if (message.verb == Verb.REQUEST_RESPONSE && PBSPredictor.instance().isLoggingEnabled())
{
IMessageCallback cb = MessagingService.instance().getRegisteredCallback(id).callback;
if (cb instanceof AbstractWriteResponseHandler)
{
PBSPredictor.instance().logWriteResponse(id, timestamp);
}
else if (cb instanceof ReadCallback)
{
PBSPredictor.instance().logReadResponse(id, timestamp);
}
}
stage.execute(runnable, state);
}