use of org.elasticsearch.common.settings.Settings in project zeppelin by apache.
the class ElasticsearchInterpreterTest method populate.
@BeforeClass
public static void populate() throws IOException {
final Settings settings = Settings.settingsBuilder().put("cluster.name", ELS_CLUSTER_NAME).put("network.host", ELS_HOST).put("http.port", ELS_HTTP_PORT).put("transport.tcp.port", ELS_TRANSPORT_PORT).put("path.home", ELS_PATH).build();
elsNode = NodeBuilder.nodeBuilder().settings(settings).node();
elsClient = elsNode.client();
elsClient.admin().indices().prepareCreate("logs").addMapping("http", jsonBuilder().startObject().startObject("http").startObject("properties").startObject("content_length").field("type", "integer").endObject().endObject().endObject().endObject()).get();
for (int i = 0; i < 48; i++) {
elsClient.prepareIndex("logs", "http", "" + i).setRefresh(true).setSource(jsonBuilder().startObject().field("date", new Date()).startObject("request").field("method", METHODS[RandomUtils.nextInt(METHODS.length)]).field("url", "/zeppelin/" + UUID.randomUUID().toString()).field("headers", Arrays.asList("Accept: *.*", "Host: apache.org")).endObject().field("status", STATUS[RandomUtils.nextInt(STATUS.length)]).field("content_length", RandomUtils.nextInt(2000))).get();
}
for (int i = 1; i < 3; i++) {
elsClient.prepareIndex("logs", "http", "very/strange/id#" + i).setRefresh(true).setSource(jsonBuilder().startObject().field("date", new Date()).startObject("request").field("method", METHODS[RandomUtils.nextInt(METHODS.length)]).field("url", "/zeppelin/" + UUID.randomUUID().toString()).field("headers", Arrays.asList("Accept: *.*", "Host: apache.org")).endObject().field("status", STATUS[RandomUtils.nextInt(STATUS.length)]).field("content_length", RandomUtils.nextInt(2000))).get();
}
final Properties props = new Properties();
props.put(ElasticsearchInterpreter.ELASTICSEARCH_HOST, ELS_HOST);
props.put(ElasticsearchInterpreter.ELASTICSEARCH_CLUSTER_NAME, ELS_CLUSTER_NAME);
props.put(ElasticsearchInterpreter.ELASTICSEARCH_PORT, ELS_TRANSPORT_PORT);
props.put(ElasticsearchInterpreter.ELASTICSEARCH_CLIENT_TYPE, "transport");
transportInterpreter = new ElasticsearchInterpreter(props);
transportInterpreter.open();
props.put(ElasticsearchInterpreter.ELASTICSEARCH_PORT, ELS_HTTP_PORT);
props.put(ElasticsearchInterpreter.ELASTICSEARCH_CLIENT_TYPE, "http");
httpInterpreter = new ElasticsearchInterpreter(props);
httpInterpreter.open();
}
use of org.elasticsearch.common.settings.Settings in project crate by crate.
the class SrvDiscoveryIntegrationTest method testClusterSrvDiscovery.
@Test
public void testClusterSrvDiscovery() throws Exception {
Settings localSettings = settingsBuilder().put("node.mode", "network").put("discovery.type", "srv").put(SrvUnicastHostsProvider.DISCOVERY_SRV_QUERY, "_test._srv.crate.internal.").build();
internalCluster().startNode(localSettings);
internalCluster().startNode(localSettings);
internalCluster().startNode(localSettings);
internalCluster().ensureAtLeastNumDataNodes(3);
internalCluster().ensureAtMostNumDataNodes(3);
assertEquals(3, internalCluster().size());
internalCluster().stopCurrentMasterNode();
internalCluster().ensureAtLeastNumDataNodes(2);
internalCluster().ensureAtMostNumDataNodes(2);
assertEquals(2, internalCluster().size());
internalCluster().stopRandomNonMasterNode();
internalCluster().ensureAtLeastNumDataNodes(1);
internalCluster().ensureAtMostNumDataNodes(1);
assertEquals(1, internalCluster().size());
}
use of org.elasticsearch.common.settings.Settings in project crate by crate.
the class ClusterIdServiceTest method testClusterIdTransient.
@Test
public void testClusterIdTransient() throws Exception {
Settings localSettings = settingsBuilder().put("discovery.type", "local").build();
String node_0 = internalCluster().startNode(localSettings);
ClusterIdService clusterIdService = internalCluster().getInstance(ClusterIdService.class, node_0);
String clusterId = clusterIdService.clusterId().get().value().toString();
internalCluster().stopRandomDataNode();
node_0 = internalCluster().startNode(localSettings);
clusterIdService = internalCluster().getInstance(ClusterIdService.class, node_0);
String clusterId2 = clusterIdService.clusterId().get().value().toString();
assertNotNull(clusterId2);
assertNotSame(clusterId, clusterId2);
}
use of org.elasticsearch.common.settings.Settings in project crate by crate.
the class ClusterIdServiceTest method testClusterIdGeneration.
@Test
public void testClusterIdGeneration() throws Exception {
Settings localSettings = settingsBuilder().put("discovery.type", "local").build();
String node_0 = internalCluster().startNode(localSettings);
ClusterIdService clusterIdService = internalCluster().getInstance(ClusterIdService.class, node_0);
assertNotNull(clusterIdService.clusterId().get());
}
use of org.elasticsearch.common.settings.Settings in project crate by crate.
the class ObjectTemplateMappingBWCTest method loadLegacy.
@Before
public void loadLegacy() throws IOException {
Path zippedIndexDir = getDataPath("/indices/bwc/bwc-object_template_mapping-0.54.9.zip");
Settings nodeSettings = prepareBackwardsDataDir(zippedIndexDir);
internalCluster().startNode(nodeSettings);
ensureYellow();
}
Aggregations