Search in sources :

Example 1 with ProcessException

use of com.hazelcast.simulator.protocol.exception.ProcessException in project hazelcast-simulator by hazelcast.

the class CoordinatorOperationProcessor method process.

@Override
public void process(SimulatorOperation op, SimulatorAddress source, Promise promise) throws Exception {
    if (op instanceof FailureOperation) {
        failureCollector.notify((FailureOperation) op);
    } else if (op instanceof PerformanceStatsOperation) {
        performanceStatsCollector.update(source, ((PerformanceStatsOperation) op).getPerformanceStats());
    } else if (op instanceof LogOperation) {
        LogOperation logOperation = (LogOperation) op;
        LOGGER.log(logOperation.getLevel(), logOperation.getMessage());
    } else {
        throw new ProcessException("Unknown operation:" + op);
    }
    promise.answer("ok");
}
Also used : ProcessException(com.hazelcast.simulator.protocol.exception.ProcessException) LogOperation(com.hazelcast.simulator.protocol.operation.LogOperation) PerformanceStatsOperation(com.hazelcast.simulator.worker.operations.PerformanceStatsOperation) FailureOperation(com.hazelcast.simulator.coordinator.operations.FailureOperation)

Aggregations

FailureOperation (com.hazelcast.simulator.coordinator.operations.FailureOperation)1 ProcessException (com.hazelcast.simulator.protocol.exception.ProcessException)1 LogOperation (com.hazelcast.simulator.protocol.operation.LogOperation)1 PerformanceStatsOperation (com.hazelcast.simulator.worker.operations.PerformanceStatsOperation)1