ElasticsearchStorage extends zipkin2.storage.StorageComponent { @Override public SpanStore spanStore() { ensureIndexTemplates(); return new ElasticsearchSpanStore(this); } ElasticsearchStorage(); static Builder newBuilder(LazyHttpClient lazyHttpClient); @Nullable abstract String pipeline(); abstract boolean flushOnWrites(); abstract boolean strictTraceId(); abstract IndexNameFormatter indexNameFormatter(); abstract int namesLookback(); @Override SpanStore spanStore(); @Override Traces traces(); @Override ServiceAndSpanNames serviceAndSpanNames(); @Override AutocompleteTags autocompleteTags(); @Override SpanConsumer spanConsumer(); @Memoized float version(); void clear(); @Override boolean isOverCapacity(Throwable e); @Override CheckResult check(); @Override final String toString(); @Override void close();  }
@Test void memoizesIndexTemplate() throws Exception { server.enqueue(AggregatedHttpResponse.of( HttpStatus.OK, MediaType.JSON_UTF_8, "{\"version\":{\"number\":\"6.7.0\"}}")); server.enqueue(SUCCESS_RESPONSE); server.enqueue(SUCCESS_RESPONSE); server.enqueue(SUCCESS_RESPONSE); server.enqueue(SUCCESS_RESPONSE); server.enqueue(SUCCESS_RESPONSE); long endTs = Instant.parse("2016-10-02T00:00:00Z").toEpochMilli(); storage.spanStore().getDependencies(endTs, DAY).execute(); storage.spanStore().getDependencies(endTs, DAY).execute(); server.takeRequest(); server.takeRequest(); server.takeRequest(); server.takeRequest(); assertThat(server.takeRequest().request().path()) .startsWith("/zipkin*dependency-2016-10-01,zipkin*dependency-2016-10-02/_search"); assertThat(server.takeRequest().request().path()) .startsWith("/zipkin*dependency-2016-10-01,zipkin*dependency-2016-10-02/_search"); }