Search in sources :

Example 1 with LocalAwareExecutorService

use of org.apache.cassandra.concurrent.LocalAwareExecutorService in project cassandra by apache.

the class MessagingService method receive.

public void receive(MessageIn message, int id) {
    TraceState state = Tracing.instance.initializeFromMessage(message);
    if (state != null)
        state.trace("{} message received from {}", message.verb, message.from);
    // message sinks are a testing hook
    for (IMessageSink ms : messageSinks) if (!ms.allowIncomingMessage(message, id))
        return;
    Runnable runnable = new MessageDeliveryTask(message, id);
    LocalAwareExecutorService stage = StageManager.getStage(message.getMessageType());
    assert stage != null : "No stage for message type " + message.verb;
    stage.execute(runnable, ExecutorLocals.create(state));
}
Also used : TraceState(org.apache.cassandra.tracing.TraceState) LocalAwareExecutorService(org.apache.cassandra.concurrent.LocalAwareExecutorService)

Aggregations

LocalAwareExecutorService (org.apache.cassandra.concurrent.LocalAwareExecutorService)1 TraceState (org.apache.cassandra.tracing.TraceState)1