Class AbstractElasticSearchDataContext

  • All Implemented Interfaces:
    org.apache.metamodel.convert.HasReadTypeConverters, org.apache.metamodel.DataContext, org.apache.metamodel.UpdateableDataContext

    public abstract class AbstractElasticSearchDataContext
    extends org.apache.metamodel.QueryPostprocessDataContext
    implements org.apache.metamodel.DataContext, org.apache.metamodel.UpdateableDataContext
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected List<org.apache.metamodel.util.SimpleTableDef> dynamicTableDefinitions  
      protected String indexName  
      protected List<org.apache.metamodel.util.SimpleTableDef> staticTableDefinitions  
      static org.elasticsearch.common.unit.TimeValue TIMEOUT_SCROLL  
      • Fields inherited from class org.apache.metamodel.QueryPostprocessDataContext

        INFORMATION_SCHEMA_NAME, SYSTEM_PROPERTY_CREATE_DEFAULT_TABLE_ALIAS
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract org.apache.metamodel.util.SimpleTableDef[] detectSchema()
      Performs an analysis of the available indexes in an ElasticSearch cluster instance and detects the elasticsearch types structure based on the metadata provided by the ElasticSearch java client.
      String getIndexName()
      Gets the name of the index that this DataContext is working on.
      protected org.apache.metamodel.schema.Schema getMainSchema()  
      protected String getMainSchemaName()  
      protected boolean limitMaxRowsIsSet​(int maxRows)  
      protected static org.apache.metamodel.util.SimpleTableDef[] sortTables​(List<org.apache.metamodel.util.SimpleTableDef> result)  
      • Methods inherited from class org.apache.metamodel.QueryPostprocessDataContext

        addConverter, executeCountQuery, executePrimaryKeyLookupQuery, executeQuery, getDefaultSchemaName, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeMainSchemaTable, materializeMainSchemaTableSelect, materializeTable
      • Methods inherited from class org.apache.metamodel.AbstractDataContext

        compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemas
      • Methods inherited from interface org.apache.metamodel.DataContext

        compileQuery, executeQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemas
      • Methods inherited from interface org.apache.metamodel.UpdateableDataContext

        executeUpdate
    • Field Detail

      • TIMEOUT_SCROLL

        public static final org.elasticsearch.common.unit.TimeValue TIMEOUT_SCROLL
      • indexName

        protected final String indexName
      • staticTableDefinitions

        protected final List<org.apache.metamodel.util.SimpleTableDef> staticTableDefinitions
      • dynamicTableDefinitions

        protected final List<org.apache.metamodel.util.SimpleTableDef> dynamicTableDefinitions
    • Constructor Detail

      • AbstractElasticSearchDataContext

        public AbstractElasticSearchDataContext​(String indexName,
                                                org.apache.metamodel.util.SimpleTableDef... tableDefinitions)
        Constructs a AbstractElasticSearchDataContext. This constructor accepts a custom array of SimpleTableDefs which allows the user to define his own view on the indexes in the engine.
        Parameters:
        indexName - the name of the ElasticSearch index to represent
        tableDefinitions - an array of SimpleTableDefs, which define the table and column model of the ElasticSearch index.
    • Method Detail

      • detectSchema

        protected abstract org.apache.metamodel.util.SimpleTableDef[] detectSchema()
        Performs an analysis of the available indexes in an ElasticSearch cluster instance and detects the elasticsearch types structure based on the metadata provided by the ElasticSearch java client.
        Returns:
        a mutable schema instance, useful for further fine tuning by the user.
      • getMainSchema

        protected org.apache.metamodel.schema.Schema getMainSchema()
                                                            throws org.apache.metamodel.MetaModelException
        Specified by:
        getMainSchema in class org.apache.metamodel.QueryPostprocessDataContext
        Throws:
        org.apache.metamodel.MetaModelException
      • getMainSchemaName

        protected String getMainSchemaName()
                                    throws org.apache.metamodel.MetaModelException
        Specified by:
        getMainSchemaName in class org.apache.metamodel.QueryPostprocessDataContext
        Throws:
        org.apache.metamodel.MetaModelException
      • getIndexName

        public String getIndexName()
        Gets the name of the index that this DataContext is working on.
      • limitMaxRowsIsSet

        protected boolean limitMaxRowsIsSet​(int maxRows)
      • sortTables

        protected static org.apache.metamodel.util.SimpleTableDef[] sortTables​(List<org.apache.metamodel.util.SimpleTableDef> result)