Package org.elasticsearch.common.settings

Examples of org.elasticsearch.common.settings.Settings$Builder


        } else {
            LOG.info("Joining ElasticSearch cluster " + configuration.getClusterName());
        }
        if (configuration.getIp() != null) {
            LOG.info("REMOTE ELASTICSEARCH: {}", configuration.getIp());
            Settings settings = ImmutableSettings.settingsBuilder()
                    .put("cluster.name", configuration.getClusterName())
                    .put("client.transport.ignore_cluster_name", false)
                    .put("node.client", true)
                    .put("client.transport.sniff", true)
                    .build();
View Full Code Here


     * 10 seconds = 10 * 1000 = 10000
     */
    private long BACKOFF_PERIOD = 10000;

    public ElasticsearchEmitter(KinesisConnectorConfiguration configuration) {
        Settings settings =
                ImmutableSettings.settingsBuilder()
                        .put(ELASTICSEARCH_CLUSTER_NAME_KEY, configuration.ELASTICSEARCH_CLUSTER_NAME)
                        .put(ELASTICSEARCH_CLIENT_TRANSPORT_SNIFF_KEY, configuration.ELASTICSEARCH_TRANSPORT_SNIFF)
                        .put(ELASTICSEARCH_CLIENT_TRANSPORT_IGNORE_CLUSTER_NAME_KEY,
                                configuration.ELASTICSEARCH_IGNORE_CLUSTER_NAME)
View Full Code Here

        String clusterName = config.clusterName().get() == null ? DEFAULT_CLUSTER_NAME : config.clusterName().get();
        index = config.index().get() == null ? DEFAULT_INDEX_NAME : config.index().get();
        indexNonAggregatedAssociations = config.indexNonAggregatedAssociations().get();

        String identity = hasIdentity.identity().get();
        Settings settings = ImmutableSettings.settingsBuilder().
                put( "path.work", new File( fileConfig.temporaryDirectory(), identity ).getAbsolutePath() ).
                put( "path.logs", new File( fileConfig.logDirectory(), identity ).getAbsolutePath() ).
                put( "path.data", new File( fileConfig.dataDirectory(), identity ).getAbsolutePath() ).
                put( "path.conf", new File( fileConfig.configurationDirectory(), identity ).getAbsolutePath() ).
                put( "gateway.type", "local" ).
View Full Code Here

        String clusterName = config.clusterName().get() == null ? DEFAULT_CLUSTER_NAME : config.clusterName().get();
        index = config.index().get() == null ? DEFAULT_INDEX_NAME : config.index().get();
        indexNonAggregatedAssociations = config.indexNonAggregatedAssociations().get();

        String identity = hasIdentity.identity().get();
        Settings settings = ImmutableSettings.settingsBuilder().
                put( "path.work", new File( fileConfig.temporaryDirectory(), identity ).getAbsolutePath() ).
                put( "path.logs", new File( fileConfig.logDirectory(), identity ).getAbsolutePath() ).
                put( "path.data", new File( fileConfig.dataDirectory(), identity ).getAbsolutePath() ).
                put( "path.conf", new File( fileConfig.configurationDirectory(), identity ).getAbsolutePath() ).
                put( "gateway.type", "none" ).
View Full Code Here

        boolean clusterSniff = config.clusterSniff().get();
        boolean ignoreClusterName = config.ignoreClusterName().get();
        String pingTimeout = config.pingTimeout().get() == null ? "5s" : config.pingTimeout().get();
        String samplerInterval = config.samplerInterval().get() == null ? "5s" : config.samplerInterval().get();

        Settings settings = ImmutableSettings.settingsBuilder().
                put( "cluster.name", clusterName ).
                put( "client.transport.sniff", clusterSniff ).
                put( "client.transport.ignore_cluster_name", ignoreClusterName ).
                put( "client.transport.ping_timeout", pingTimeout ).
                put( "client.transport.nodes_sampler_interval", samplerInterval ).
View Full Code Here

        return buildNode(id, settings.build());
    }

    public Node buildNode(String id, Settings settings) {
        String settingsSource = getClass().getName().replace('.', '/') + ".yml";
        Settings finalSettings = settingsBuilder()
                .loadFromClasspath(settingsSource)
                .put(defaultSettings)
                .put(settings)
                .put("name", id)
                .build();

        if (finalSettings.get("gateway.type") == null) {
            // default to non gateway
            finalSettings = settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
        }
        if (finalSettings.get("cluster.routing.schedule") != null) {
            // decrease the routing schedule so new nodes will be added quickly
            finalSettings = settingsBuilder().put(finalSettings).put("cluster.routing.schedule", "50ms").build();
        }

        Node node = nodeBuilder()
View Full Code Here

*
*/
public class SimpleScriptFacetTests extends AbstractNodesTests {

    public void beforeClass() throws Exception {
        Settings settings = ImmutableSettings.settingsBuilder().put("index.number_of_shards", numberOfShards()).put("index.number_of_replicas", 0).build();
        for (int i = 0; i < numberOfNodes(); i++) {
            startNode("node" + i, settings);
        }
    }
View Full Code Here

     */
    @Override
    public void start() {
        super.start();

        Settings settings = ImmutableSettings.settingsBuilder()
                .put("cluster.name", configurator.getClusterName())
                .put("client.transport.sniff", configurator.getClientTransportSniff())
                .build();

        client = clientFactory.create(settings);
View Full Code Here

    host = job.get(ElasticConstants.HOST);
    port = job.getInt(ElasticConstants.PORT, -1);
   
    // Prefer TransportClient
    if (host != null && port > 1) {
      Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", clusterName).build();
      client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(host, port));
    } else if (clusterName != null) {
      node = nodeBuilder().clusterName(clusterName).client(true).node();
      client = node.client();
    }
View Full Code Here

        return buildNode(id, settings.build());
    }

    public Node buildNode(String id, Settings settings) {
        String settingsSource = getClass().getName().replace('.', '/') + ".yml";
        Settings finalSettings = settingsBuilder()
                .loadFromClasspath(settingsSource)
                .put(defaultSettings)
                .put(settings)
                .put("name", id)
                .build();

        if (finalSettings.get("gateway.type") == null) {
            // default to non gateway
            finalSettings = settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
        }
        if (finalSettings.get("cluster.routing.schedule") != null) {
            // decrease the routing schedule so new nodes will be added quickly
            finalSettings = settingsBuilder().put(finalSettings).put("cluster.routing.schedule", "50ms").build();
        }

        Node node = nodeBuilder()
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.settings.Settings$Builder

Copyright © 2018 www.massapicom. 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.