Interface ElasticsearchStorage.LazyHttpClient

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, java.util.function.Supplier<com.linecorp.armeria.client.HttpClient>
    Enclosing class:
    ElasticsearchStorage

    public static interface ElasticsearchStorage.LazyHttpClient
    extends java.util.function.Supplier<com.linecorp.armeria.client.HttpClient>, java.io.Closeable
    This defers creation of an HttpClient. 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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()  
      com.linecorp.armeria.client.HttpClient get()
      Lazily creates an instance of the http client configured to the correct elasticsearch host or cluster.
      java.lang.String toString()
      This should return the initial endpoints in a single-string without resolving them.
    • Method Detail

      • get

        com.linecorp.armeria.client.HttpClient 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 java.util.function.Supplier<com.linecorp.armeria.client.HttpClient>
      • close

        default void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • toString

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