Search in sources :

Example 1 with HazelcastProperty

use of com.hazelcast.spi.properties.HazelcastProperty in project hazelcast by hazelcast.

the class QueryOptimizerFactory method newOptimizer.

/**
 * Creates new QueryOptimizer. The exact implementation depends on {@link HazelcastProperties}.
 */
public static QueryOptimizer newOptimizer(HazelcastProperties properties) {
    HazelcastProperty property = ClusterProperty.QUERY_OPTIMIZER_TYPE;
    String string = properties.getString(property);
    Type type;
    try {
        type = Type.valueOf(string);
    } catch (IllegalArgumentException e) {
        throw onInvalidOptimizerType(string);
    }
    switch(type) {
        case RULES:
            return new RuleBasedQueryOptimizer();
        default:
            return new EmptyOptimizer();
    }
}
Also used : HazelcastProperty(com.hazelcast.spi.properties.HazelcastProperty)

Aggregations

HazelcastProperty (com.hazelcast.spi.properties.HazelcastProperty)1