Search in sources :

Example 1 with CallerAware

use of com.hazelcast.cp.internal.CallerAware in project hazelcast by hazelcast.

the class AbstractUnsafeRaftOp method call.

@Override
public final CallStatus call() throws Exception {
    RaftService service = getService();
    if (service.isCpSubsystemEnabled()) {
        throw new IllegalStateException("CP subsystem is enabled on this member, " + "but received an UNSAFE operation! This could be due to a misconfiguration on the caller side. " + "CP subsystem configuration must be the same on all members.");
    }
    NodeEngine nodeEngine = getNodeEngine();
    if (op instanceof CallerAware) {
        ((CallerAware) op).setCaller(getCallerAddress(), getCallId());
    }
    long commitIndex = service.nextUnsafeModeCommitIndex(groupId);
    response = op.setNodeEngine(nodeEngine).run(groupId, commitIndex);
    return handleResponse(commitIndex, response);
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) RaftService(com.hazelcast.cp.internal.RaftService) CallerAware(com.hazelcast.cp.internal.CallerAware)

Aggregations

CallerAware (com.hazelcast.cp.internal.CallerAware)1 RaftService (com.hazelcast.cp.internal.RaftService)1 NodeEngine (com.hazelcast.spi.impl.NodeEngine)1