Class ElasticsearchSchema

  • All Implemented Interfaces:

    public class ElasticsearchSchema
    extends AbstractSchema
    Each table in the schema is an ELASTICSEARCH index.
    • Field Detail

      • client

        private final org.elasticsearch.client.RestClient client
      • mapper

        private final com.fasterxml.jackson.databind.ObjectMapper mapper
      • tableMap

        private final java.util.Map<java.lang.String,​Table> tableMap
      • fetchSize

        private final int fetchSize
        Default batch size to be used during scrolling.
    • Constructor Detail

      • ElasticsearchSchema

        public ElasticsearchSchema​(org.elasticsearch.client.RestClient client,
                                   com.fasterxml.jackson.databind.ObjectMapper mapper,
                                   java.lang.String index)
        Allows schema to be instantiated from existing elastic search client.
        client - existing client instance
        mapper - mapper for JSON (de)serialization
        index - name of ES index
      • ElasticsearchSchema

        ElasticsearchSchema​(org.elasticsearch.client.RestClient client,
                            com.fasterxml.jackson.databind.ObjectMapper mapper,
                            java.lang.String index,
                            int fetchSize)
    • Method Detail

      • createTables

        private java.util.Map<java.lang.String,​Table> createTables​(java.lang.Iterable<java.lang.String> indices)
      • indicesFromElastic

        private java.util.Set<java.lang.String> indicesFromElastic()
        Queries _alias definition to automatically detect all indices
        list of indices
        Throws: - for any IO related issues
        java.lang.IllegalStateException - if reply is not understood