Search in sources :

Example 1 with SystemPropertiesElasticSearchConfiguration

use of com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration in project conductor by Netflix.

the class TestElasticSearchRestDAOV5 method startElasticSearchWithBatchSize.

private void startElasticSearchWithBatchSize(int i) throws Exception {
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_INDEX_BATCH_SIZE_PROPERTY_NAME, String.valueOf(i));
    configuration = new SystemPropertiesElasticSearchConfiguration();
    String host = configuration.getEmbeddedHost();
    int port = configuration.getEmbeddedPort();
    String clusterName = configuration.getEmbeddedClusterName();
    embeddedElasticSearch = new EmbeddedElasticSearchV5(clusterName, host, port);
    embeddedElasticSearch.start();
    ElasticSearchRestClientProvider restClientProvider = new ElasticSearchRestClientProvider(configuration);
    restClient = restClientProvider.get();
    elasticSearchClient = new RestHighLevelClient(restClient);
    Map<String, String> params = new HashMap<>();
    params.put("wait_for_status", "yellow");
    params.put("timeout", "30s");
    restClient.performRequest("GET", "/_cluster/health", params);
    objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchRestDAOV5(restClient, configuration, objectMapper);
}
Also used : EmbeddedElasticSearchV5(com.netflix.conductor.elasticsearch.es5.EmbeddedElasticSearchV5) HashMap(java.util.HashMap) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) RestHighLevelClient(org.elasticsearch.client.RestHighLevelClient) ElasticSearchRestClientProvider(com.netflix.conductor.elasticsearch.ElasticSearchRestClientProvider) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider)

Example 2 with SystemPropertiesElasticSearchConfiguration

use of com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration in project conductor by Netflix.

the class TestElasticSearchDAOV5 method startElasticSearchWithBatchSize.

private void startElasticSearchWithBatchSize(int i) throws Exception {
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_INDEX_BATCH_SIZE_PROPERTY_NAME, String.valueOf(i));
    configuration = new SystemPropertiesElasticSearchConfiguration();
    String host = configuration.getEmbeddedHost();
    int port = configuration.getEmbeddedPort();
    String clusterName = configuration.getEmbeddedClusterName();
    embeddedElasticSearch = new EmbeddedElasticSearchV5(clusterName, host, port);
    embeddedElasticSearch.start();
    ElasticSearchTransportClientProvider transportClientProvider = new ElasticSearchTransportClientProvider(configuration);
    elasticSearchClient = transportClientProvider.get();
    elasticSearchClient.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().get();
    ObjectMapper objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchDAOV5(elasticSearchClient, configuration, objectMapper);
}
Also used : ElasticSearchTransportClientProvider(com.netflix.conductor.elasticsearch.ElasticSearchTransportClientProvider) EmbeddedElasticSearchV5(com.netflix.conductor.elasticsearch.es5.EmbeddedElasticSearchV5) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider)

Example 3 with SystemPropertiesElasticSearchConfiguration

use of com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration in project conductor by Netflix.

the class TestElasticSearchDAOV5 method startServer.

@BeforeClass
public static void startServer() throws Exception {
    System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9203");
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "localhost:9303");
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_INDEX_BATCH_SIZE_PROPERTY_NAME, "1");
    configuration = new SystemPropertiesElasticSearchConfiguration();
    String host = configuration.getEmbeddedHost();
    int port = configuration.getEmbeddedPort();
    String clusterName = configuration.getEmbeddedClusterName();
    embeddedElasticSearch = new EmbeddedElasticSearchV5(clusterName, host, port);
    embeddedElasticSearch.start();
    ElasticSearchTransportClientProvider transportClientProvider = new ElasticSearchTransportClientProvider(configuration);
    elasticSearchClient = transportClientProvider.get();
    elasticSearchClient.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().get();
    ObjectMapper objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchDAOV5(elasticSearchClient, configuration, objectMapper);
}
Also used : ElasticSearchTransportClientProvider(com.netflix.conductor.elasticsearch.ElasticSearchTransportClientProvider) EmbeddedElasticSearchV5(com.netflix.conductor.elasticsearch.es5.EmbeddedElasticSearchV5) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider) BeforeClass(org.junit.BeforeClass)

Example 4 with SystemPropertiesElasticSearchConfiguration

use of com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration in project conductor by Netflix.

the class TestElasticSearchRestDAOV6 method startElasticSearchWithBatchSize.

private void startElasticSearchWithBatchSize(int i) throws Exception {
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_INDEX_BATCH_SIZE_PROPERTY_NAME, String.valueOf(i));
    configuration = new SystemPropertiesElasticSearchConfiguration();
    String host = configuration.getEmbeddedHost();
    int port = configuration.getEmbeddedPort();
    String clusterName = configuration.getEmbeddedClusterName();
    embeddedElasticSearch = new EmbeddedElasticSearchV6(clusterName, host, port);
    embeddedElasticSearch.start();
    ElasticSearchRestClientBuilderProvider restClientProvider = new ElasticSearchRestClientBuilderProvider(configuration);
    RestClientBuilder restClientBuilder = restClientProvider.get();
    restClient = restClientBuilder.build();
    Map<String, String> params = new HashMap<>();
    params.put("wait_for_status", "yellow");
    params.put("timeout", "30s");
    restClient.performRequest("GET", "/_cluster/health", params);
    objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchRestDAOV6(restClientBuilder, configuration, objectMapper);
}
Also used : EmbeddedElasticSearchV6(com.netflix.conductor.elasticsearch.es6.EmbeddedElasticSearchV6) ElasticSearchRestClientBuilderProvider(com.netflix.conductor.elasticsearch.ElasticSearchRestClientBuilderProvider) HashMap(java.util.HashMap) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) RestClientBuilder(org.elasticsearch.client.RestClientBuilder) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider)

Example 5 with SystemPropertiesElasticSearchConfiguration

use of com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration in project conductor by Netflix.

the class TestElasticSearchRestDAOV5 method startServer.

@BeforeClass
public static void startServer() throws Exception {
    System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9204");
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "http://localhost:9204");
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_INDEX_BATCH_SIZE_PROPERTY_NAME, "1");
    configuration = new SystemPropertiesElasticSearchConfiguration();
    String host = configuration.getEmbeddedHost();
    int port = configuration.getEmbeddedPort();
    String clusterName = configuration.getEmbeddedClusterName();
    embeddedElasticSearch = new EmbeddedElasticSearchV5(clusterName, host, port);
    embeddedElasticSearch.start();
    ElasticSearchRestClientProvider restClientProvider = new ElasticSearchRestClientProvider(configuration);
    restClient = restClientProvider.get();
    elasticSearchClient = new RestHighLevelClient(restClient);
    Map<String, String> params = new HashMap<>();
    params.put("wait_for_status", "yellow");
    params.put("timeout", "30s");
    restClient.performRequest("GET", "/_cluster/health", params);
    objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchRestDAOV5(restClient, configuration, objectMapper);
}
Also used : EmbeddedElasticSearchV5(com.netflix.conductor.elasticsearch.es5.EmbeddedElasticSearchV5) HashMap(java.util.HashMap) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) RestHighLevelClient(org.elasticsearch.client.RestHighLevelClient) ElasticSearchRestClientProvider(com.netflix.conductor.elasticsearch.ElasticSearchRestClientProvider) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider) BeforeClass(org.junit.BeforeClass)

Aggregations

SystemPropertiesElasticSearchConfiguration (com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration)11 JsonMapperProvider (com.netflix.conductor.common.utils.JsonMapperProvider)10 HashMap (java.util.HashMap)6 BeforeClass (org.junit.BeforeClass)6 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 ElasticSearchRestClientBuilderProvider (com.netflix.conductor.elasticsearch.ElasticSearchRestClientBuilderProvider)4 ElasticSearchTransportClientProvider (com.netflix.conductor.elasticsearch.ElasticSearchTransportClientProvider)4 EmbeddedElasticSearchV5 (com.netflix.conductor.elasticsearch.es5.EmbeddedElasticSearchV5)4 EmbeddedElasticSearchV6 (com.netflix.conductor.elasticsearch.es6.EmbeddedElasticSearchV6)4 RestClientBuilder (org.elasticsearch.client.RestClientBuilder)4 ElasticSearchRestClientProvider (com.netflix.conductor.elasticsearch.ElasticSearchRestClientProvider)3 EmbeddedElasticSearchV7 (com.netflix.conductor.elasticsearch.es7.EmbeddedElasticSearchV7)2 Request (org.elasticsearch.client.Request)2 RestHighLevelClient (org.elasticsearch.client.RestHighLevelClient)2 Injector (com.google.inject.Injector)1 BootstrapModule (com.netflix.conductor.bootstrap.BootstrapModule)1 MetadataClient (com.netflix.conductor.client.http.MetadataClient)1 TaskClient (com.netflix.conductor.client.http.TaskClient)1 WorkflowClient (com.netflix.conductor.client.http.WorkflowClient)1 EmbeddedElasticSearchProvider (com.netflix.conductor.elasticsearch.EmbeddedElasticSearchProvider)1