Examples of NumberOfReplicas


Examples of io.crate.core.NumberOfReplicas

                          Object[] parameters,
                          Expression expression) {
            Preconditions.checkArgument(!(expression instanceof ArrayLiteral),
                    String.format("array literal not allowed for \"%s\"", ES_TO_CRATE_SETTINGS_MAP.get(TableParameterInfo.NUMBER_OF_REPLICAS)));

            NumberOfReplicas numberOfReplicas;
            try {
                Integer numReplicas = ExpressionToNumberVisitor.convert(expression, parameters).intValue();
                numberOfReplicas = new NumberOfReplicas(numReplicas);
            } catch (IllegalArgumentException e) {
                String numReplicas = ExpressionToObjectVisitor.convert(expression, parameters).toString();
                numberOfReplicas = new NumberOfReplicas(numReplicas);
            }

            // in case the number_of_replicas is changing from auto_expand to a fixed number -> disable auto expand
            settingsBuilder.put(TableParameterInfo.AUTO_EXPAND_REPLICAS, false);
            settingsBuilder.put(numberOfReplicas.esSettingKey(), numberOfReplicas.esSettingValue());
        }
View Full Code Here

Examples of io.crate.core.NumberOfReplicas

            GenericProperties genericProperties,
            Object[] parameters) {
        Map<String,Expression> properties = genericProperties.properties();
        Expression number_of_replicas = properties.remove("number_of_replicas");

        NumberOfReplicas numberOfReplicas = null;
        if (number_of_replicas != null) {
            try {
                Integer numReplicas = ExpressionToNumberVisitor.convert(number_of_replicas, parameters).intValue();
                numberOfReplicas = new NumberOfReplicas(numReplicas);
            } catch (IllegalArgumentException e) {
                String numReplicas = ExpressionToObjectVisitor.convert(number_of_replicas, parameters).toString();
                numberOfReplicas = new NumberOfReplicas(numReplicas);
            }
        }

        if (properties.size() > 0) {
            throw new IllegalArgumentException(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.