Search in sources :

Example 16 with JsonMapperProvider

use of com.netflix.conductor.common.utils.JsonMapperProvider 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)

Example 17 with JsonMapperProvider

use of com.netflix.conductor.common.utils.JsonMapperProvider in project conductor by Netflix.

the class TestElasticSearchDAOV6 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();
    ElasticSearchTransportClientProvider transportClientProvider = new ElasticSearchTransportClientProvider(configuration);
    elasticSearchClient = transportClientProvider.get();
    elasticSearchClient.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().get();
    ObjectMapper objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchDAOV6(elasticSearchClient, configuration, objectMapper);
}
Also used : ElasticSearchTransportClientProvider(com.netflix.conductor.elasticsearch.ElasticSearchTransportClientProvider) EmbeddedElasticSearchV6(com.netflix.conductor.elasticsearch.es6.EmbeddedElasticSearchV6) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider)

Example 18 with JsonMapperProvider

use of com.netflix.conductor.common.utils.JsonMapperProvider in project conductor by Netflix.

the class TestElasticSearchRestDAOV6 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 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) BeforeClass(org.junit.BeforeClass)

Example 19 with JsonMapperProvider

use of com.netflix.conductor.common.utils.JsonMapperProvider in project conductor by Netflix.

the class TestElasticSearchDAOV6 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 EmbeddedElasticSearchV6(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 ElasticSearchDAOV6(elasticSearchClient, configuration, objectMapper);
}
Also used : ElasticSearchTransportClientProvider(com.netflix.conductor.elasticsearch.ElasticSearchTransportClientProvider) EmbeddedElasticSearchV6(com.netflix.conductor.elasticsearch.es6.EmbeddedElasticSearchV6) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider) BeforeClass(org.junit.BeforeClass)

Example 20 with JsonMapperProvider

use of com.netflix.conductor.common.utils.JsonMapperProvider in project conductor by Netflix.

the class TestElasticSearchRestDAOV7 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 EmbeddedElasticSearchV7(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");
    Request request = new Request("GET", "/_cluster/health");
    request.addParameters(params);
    restClient.performRequest(request);
    objectMapper = new JsonMapperProvider().get();
    indexDAO = new ElasticSearchRestDAOV7(restClientBuilder, configuration, objectMapper);
}
Also used : EmbeddedElasticSearchV7(com.netflix.conductor.elasticsearch.es7.EmbeddedElasticSearchV7) ElasticSearchRestClientBuilderProvider(com.netflix.conductor.elasticsearch.ElasticSearchRestClientBuilderProvider) HashMap(java.util.HashMap) SystemPropertiesElasticSearchConfiguration(com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration) Request(org.elasticsearch.client.Request) RestClientBuilder(org.elasticsearch.client.RestClientBuilder) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider)

Aggregations

JsonMapperProvider (com.netflix.conductor.common.utils.JsonMapperProvider)25 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)15 SystemPropertiesElasticSearchConfiguration (com.netflix.conductor.elasticsearch.SystemPropertiesElasticSearchConfiguration)10 HashMap (java.util.HashMap)9 Test (org.junit.Test)6 ElasticSearchTransportClientProvider (com.netflix.conductor.elasticsearch.ElasticSearchTransportClientProvider)4 EmbeddedElasticSearchV5 (com.netflix.conductor.elasticsearch.es5.EmbeddedElasticSearchV5)4 Before (org.junit.Before)4 BeforeClass (org.junit.BeforeClass)4 Configuration (com.netflix.conductor.core.config.Configuration)3 TestConfiguration (com.netflix.conductor.core.execution.TestConfiguration)3 ElasticSearchRestClientBuilderProvider (com.netflix.conductor.elasticsearch.ElasticSearchRestClientBuilderProvider)3 EmbeddedElasticSearchV6 (com.netflix.conductor.elasticsearch.es6.EmbeddedElasticSearchV6)3 RestClientBuilder (org.elasticsearch.client.RestClientBuilder)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 WorkflowDef (com.netflix.conductor.common.metadata.workflow.WorkflowDef)2 QueueDAO (com.netflix.conductor.dao.QueueDAO)2 EmbeddedElasticSearchV7 (com.netflix.conductor.elasticsearch.es7.EmbeddedElasticSearchV7)2 Request (org.elasticsearch.client.Request)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1