Class ElasticSources

java.lang.Object
com.hazelcast.jet.elastic.ElasticSources

@Deprecated(forRemoval=true, since="5.7") public final class ElasticSources extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Provides factory methods for Elasticsearch sources. Alternatively you can use ElasticSourceBuilder
Since:
Jet 4.2
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns new instance of ElasticSourceBuilder
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a source which queries local instance of Elasticsearch for all documents
    static <T> BatchSource<T>
    elastic(FunctionEx<? super org.elasticsearch.search.SearchHit,T> mapToItemFn)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a source which queries local instance of Elasticsearch for all documents.
    elastic(SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a source which queries Elasticsearch using client obtained from RestClientBuilder supplier function.
    static <T> BatchSource<T>
    elastic(SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn, FunctionEx<? super org.elasticsearch.search.SearchHit,T> mapToItemFn)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a source which queries Elasticsearch using client obtained from RestClientBuilder supplier function.
    static <T> BatchSource<T>
    elastic(SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn, SupplierEx<org.elasticsearch.action.search.SearchRequest> searchRequestFn, FunctionEx<? super org.elasticsearch.search.SearchHit,T> mapToItemFn)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a source which queries Elasticsearch using client obtained from RestHighLevelClient supplier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • elastic

      @Nonnull public static BatchSource<String> elastic()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a source which queries local instance of Elasticsearch for all documents

      Useful for quick prototyping. See other methods elastic(SupplierEx, SupplierEx, FunctionEx) and builder()

      For example:

      
       pipeline.readFrom(ElasticSources.elastic());
       
    • elastic

      @Nonnull public static BatchSource<String> elastic(@Nonnull SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a source which queries Elasticsearch using client obtained from RestClientBuilder supplier function. Queries all indexes for all documents. Uses SearchHit.getSourceAsString() as mapping function

      For example:

      
       pipeline.readFrom(ElasticSources.elastic(
         () -> ElasticClients.client("localhost", 9200),
       ));
       
      Parameters:
      clientFn - supplier function returning configured RestClientBuilder
    • elastic

      @Nonnull public static <T> BatchSource<T> elastic(@Nonnull FunctionEx<? super org.elasticsearch.search.SearchHit,T> mapToItemFn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a source which queries local instance of Elasticsearch for all documents. Uses provided mapToItemFn to map results.

      For example:

      
       pipeline.readFrom(ElasticSources.elastic(
         SearchHit::getSourceAsMap
       ));
       
      Type Parameters:
      T - result type returned by the map function
      Parameters:
      mapToItemFn - function mapping the result from a SearchHit to a result type
    • elastic

      @Nonnull public static <T> BatchSource<T> elastic(@Nonnull SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn, @Nonnull FunctionEx<? super org.elasticsearch.search.SearchHit,T> mapToItemFn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a source which queries Elasticsearch using client obtained from RestClientBuilder supplier function. Uses provided mapToItemFn to map results. Queries all indexes for all documents.

      For example:

      
       pipeline.readFrom(ElasticSources.elastic(
         () -> ElasticClients.client("localhost", 9200),
         SearchHit::getSourceAsMap
       ));
       
      Type Parameters:
      T - result type returned by the map function
      Parameters:
      clientFn - supplier function returning configured RestClientBuilder
      mapToItemFn - function mapping the result from a SearchHit to a result type
    • elastic

      @Nonnull public static <T> BatchSource<T> elastic(@Nonnull SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn, @Nonnull SupplierEx<org.elasticsearch.action.search.SearchRequest> searchRequestFn, @Nonnull FunctionEx<? super org.elasticsearch.search.SearchHit,T> mapToItemFn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a source which queries Elasticsearch using client obtained from RestHighLevelClient supplier.

      For example:

      
       pipeline.readFrom(ElasticSources.elastic(
         () -> ElasticClients.client("localhost", 9200),
         () -> new SearchRequest("my-index"),
         SearchHit::getSourceAsMap
       ));
       
      Type Parameters:
      T - result type returned by the map function
      Parameters:
      clientFn - supplier function returning configured RestClientBuilder
      searchRequestFn - supplier function of a SearchRequest used to query for documents
      mapToItemFn - function mapping the result from a SearchHit to a result type
    • builder

      @Nonnull public static ElasticSourceBuilder<Void> builder()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns new instance of ElasticSourceBuilder