@Test public void testRestClientBuilderWrongConfig() { Config esConfig = VisualizerUtility.getConfig("metric-consumer"); RestHighLevelClient restHighLevelClient = elasticSearchClient.restClientBuilder(esConfig); assertNull(restHighLevelClient); }
protected RestHighLevelClient restClientBuilder(Config elasticSearchConfig) { RestHighLevelClient client = null; try { client = new RestHighLevelClient( RestClient.builder(new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT1), elasticSearchConfig.getString(SCHEME)), new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT2), elasticSearchConfig.getString(SCHEME)))); } catch (Exception e) { log.error(e.getMessage(),e); } return client; }
ElasticSearchClient { protected RestHighLevelClient restClientBuilder(Config elasticSearchConfig) { RestHighLevelClient client = null; try { client = new RestHighLevelClient( RestClient.builder(new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT1), elasticSearchConfig.getString(SCHEME)), new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT2), elasticSearchConfig.getString(SCHEME)))); } catch (Exception e) { log.error(e.getMessage(),e); } return client; } }
ElasticSearchClient { protected RestHighLevelClient restClientBuilder(Config elasticSearchConfig) { RestHighLevelClient client = null; try { client = new RestHighLevelClient( RestClient.builder(new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT1), elasticSearchConfig.getString(SCHEME)), new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT2), elasticSearchConfig.getString(SCHEME)))); } catch (Exception e) { log.error(e.getMessage(),e); } return client; } ElasticSearchClient(); }
ElasticSearchClient { protected RestHighLevelClient restClientBuilder(Config elasticSearchConfig) { RestHighLevelClient client = null; try { client = new RestHighLevelClient( RestClient.builder(new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT1), elasticSearchConfig.getString(SCHEME)), new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT2), elasticSearchConfig.getString(SCHEME)))); } catch (Exception e) { log.error(e.getMessage(),e); } return client; } ElasticSearchClient(); BulkResponse bulk(BulkRequest bulkRequest, RequestOptions requestOptions); BulkByScrollResponse deleteByQuery(DeleteByQueryRequest deleteByQueryRequest, RequestOptions requestOptions); RestHighLevelClient getClient(); boolean close(); }
ElasticSearchClient { protected RestHighLevelClient restClientBuilder(Config elasticSearchConfig) { RestHighLevelClient client = null; try { client = new RestHighLevelClient( RestClient.builder(new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT1), elasticSearchConfig.getString(SCHEME)), new HttpHost(elasticSearchConfig.getString(HOST), elasticSearchConfig.getInt(PORT2), elasticSearchConfig.getString(SCHEME)))); } catch (Exception e) { log.error(e.getMessage(),e); } return client; } ElasticSearchClient(); BulkResponse bulk(BulkRequest bulkRequest, RequestOptions requestOptions); BulkByScrollResponse deleteByQuery(DeleteByQueryRequest deleteByQueryRequest, RequestOptions requestOptions); RestHighLevelClient getClient(); boolean close();  }