@Test public void startup() throws Exception { ElasticSearchStore localStore = new ElasticSearchStore(PROPERTIES, null) { @Override JestClient createJestClient() throws IOException { return CLIENT; } }; localStore.startUp(); }
@Override protected void startUp() throws Exception { if (client != null) { return; } client = createJestClient(); IndicesExists action = new IndicesExists.Builder(INDEX).build(); while (state() == State.STARTING) { JestResult result = execute(action); if (result == null) { LOGGER.warn("Setting up elasticsearch data store failed, next retry in 10s"); TimeUnit.SECONDS.sleep(10L); continue; } setupStorage(result.isSucceeded()); LOGGER.info("Elasticsearch data store was setup successfully"); return; } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { @Override protected void startUp() throws Exception { if (client != null) { return; } client = createJestClient(); IndicesExists action = new IndicesExists.Builder(INDEX).build(); while (state() == State.STARTING) { JestResult result = execute(action); if (result == null) { LOGGER.warn("Setting up elasticsearch data store failed, next retry in 10s"); TimeUnit.SECONDS.sleep(10L); continue; } setupStorage(result.isSucceeded()); LOGGER.info("Elasticsearch data store was setup successfully"); return; } } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { @Override protected void startUp() throws Exception { if (client != null) { return; } client = createJestClient(); IndicesExists action = new IndicesExists.Builder(INDEX).build(); while (state() == State.STARTING) { JestResult result = execute(action); if (result == null) { LOGGER.warn("Setting up elasticsearch data store failed, next retry in 10s"); TimeUnit.SECONDS.sleep(10L); continue; } setupStorage(result.isSucceeded()); LOGGER.info("Elasticsearch data store was setup successfully"); return; } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { @Override protected void startUp() throws Exception { if (client != null) { return; } client = createJestClient(); IndicesExists action = new IndicesExists.Builder(INDEX).build(); while (state() == State.STARTING) { JestResult result = execute(action); if (result == null) { LOGGER.warn("Setting up elasticsearch data store failed, next retry in 10s"); TimeUnit.SECONDS.sleep(10L); continue; } setupStorage(result.isSucceeded()); LOGGER.info("Elasticsearch data store was setup successfully"); return; } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close(); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { @Override protected void startUp() throws Exception { if (client != null) { return; } client = createJestClient(); IndicesExists action = new IndicesExists.Builder(INDEX).build(); while (state() == State.STARTING) { JestResult result = execute(action); if (result == null) { LOGGER.warn("Setting up elasticsearch data store failed, next retry in 10s"); TimeUnit.SECONDS.sleep(10L); continue; } setupStorage(result.isSucceeded()); LOGGER.info("Elasticsearch data store was setup successfully"); return; } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close();  }