Search in sources :

Example 1 with NamedOperation

use of com.hazelcast.spi.NamedOperation in project hazelcast by hazelcast.

the class QuorumServiceImpl method findQuorum.

/**
     * Returns a {@link QuorumImpl} for the given operation. The operation should be named and the operation service should
     * be a {@link QuorumAwareService}. This service will then return the quorum configured under the name returned by the
     * operation service.
     *
     * @param op the operation for which the Quorum should be returned
     * @return the quorum
     */
private QuorumImpl findQuorum(Operation op) {
    if (!isNamedOperation(op) || !isQuorumAware(op)) {
        return null;
    }
    QuorumAwareService service = op.getService();
    String name = ((NamedOperation) op).getName();
    String quorumName = service.getQuorumName(name);
    if (quorumName == null) {
        return null;
    }
    return quorums.get(quorumName);
}
Also used : QuorumAwareService(com.hazelcast.spi.QuorumAwareService) NamedOperation(com.hazelcast.spi.NamedOperation)

Aggregations

NamedOperation (com.hazelcast.spi.NamedOperation)1 QuorumAwareService (com.hazelcast.spi.QuorumAwareService)1