Search in sources :

Example 1 with AbstractClient

use of org.elasticsearch.client.support.AbstractClient in project elasticsearch-jdbc by jprante.

the class NodeTestUtils method closeNodes.

private void closeNodes() throws IOException {
    logger.info("closing all clients");
    for (AbstractClient client : clients.values()) {
        client.close();
    }
    clients.clear();
    logger.info("closing all nodes");
    for (Node node : nodes.values()) {
        if (node != null) {
            node.close();
        }
    }
    nodes.clear();
    logger.info("all nodes closed");
}
Also used : AbstractClient(org.elasticsearch.client.support.AbstractClient) Node(org.elasticsearch.node.Node) MockNode(org.elasticsearch.node.MockNode)

Example 2 with AbstractClient

use of org.elasticsearch.client.support.AbstractClient in project elasticsearch-jdbc by jprante.

the class NodeTestUtils method buildNode.

private Node buildNode(String id) throws IOException {
    Settings nodeSettings = settingsBuilder().put(getNodeSettings()).put("name", id).build();
    logger.info("settings={}", nodeSettings.getAsMap());
    Node node = new MockNode(nodeSettings);
    AbstractClient client = (AbstractClient) node.client();
    nodes.put(id, node);
    clients.put(id, client);
    logger.info("clients={}", clients);
    return node;
}
Also used : AbstractClient(org.elasticsearch.client.support.AbstractClient) Node(org.elasticsearch.node.Node) MockNode(org.elasticsearch.node.MockNode) MockNode(org.elasticsearch.node.MockNode) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

AbstractClient (org.elasticsearch.client.support.AbstractClient)2 MockNode (org.elasticsearch.node.MockNode)2 Node (org.elasticsearch.node.Node)2 Settings (org.elasticsearch.common.settings.Settings)1