use of com.netflix.conductor.elasticsearch.ElasticSearchRestClientProvider 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);
}
use of com.netflix.conductor.elasticsearch.ElasticSearchRestClientProvider 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);
}
use of com.netflix.conductor.elasticsearch.ElasticSearchRestClientProvider in project conductor by Netflix.
the class ESRestClientHttpEndToEndTest method setup.
@BeforeClass
public static void setup() throws Exception {
TestEnvironment.setup();
System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9203");
System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "http://localhost:9203");
System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_INDEX_BATCH_SIZE_PROPERTY_NAME, "1");
Injector bootInjector = Guice.createInjector(new BootstrapModule());
Injector serverInjector = Guice.createInjector(bootInjector.getInstance(ModulesProvider.class).get());
search = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get().get();
search.start();
search.waitForGreenCluster();
SystemPropertiesElasticSearchConfiguration configuration = new SystemPropertiesElasticSearchConfiguration();
ElasticSearchRestClientProvider restClientProvider = new ElasticSearchRestClientProvider(configuration);
elasticSearchAdminClient = restClientProvider.get();
JettyServer server = new JettyServer(SERVER_PORT, false);
server.start();
apiRoot = String.format("http://localhost:%d/api/", SERVER_PORT);
taskClient = new TaskClient();
taskClient.setRootURI(apiRoot);
workflowClient = new WorkflowClient();
workflowClient.setRootURI(apiRoot);
metadataClient = new MetadataClient();
metadataClient.setRootURI(apiRoot);
}
Aggregations