Interface ElasticsearchStorage.LazyHttpClient

All Superinterfaces:
AutoCloseable, Closeable, Supplier<com.linecorp.armeria.client.WebClient>
Enclosing class:
ElasticsearchStorage

public static interface ElasticsearchStorage.LazyHttpClient extends Supplier<com.linecorp.armeria.client.WebClient>, Closeable
This defers creation of an WebClient. This is needed because routinely, I/O occurs in constructors and this can delay or cause startup to crash. For example, an underlying EndpointGroup could be delayed due to DNS, implicit api calls or health checks.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    com.linecorp.armeria.client.WebClient
    get()
    Lazily creates an instance of the http client configured to the correct elasticsearch host or cluster.
    This should return the initial endpoints in a single-string without resolving them.
  • Method Details

    • get

      com.linecorp.armeria.client.WebClient get()
      Lazily creates an instance of the http client configured to the correct elasticsearch host or cluster. The same value should always be returned.
      Specified by:
      get in interface Supplier<com.linecorp.armeria.client.WebClient>
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • toString

      String toString()
      This should return the initial endpoints in a single-string without resolving them.
      Overrides:
      toString in class Object