Class AbstractElasticSearchDataContext
- java.lang.Object
-
- org.apache.metamodel.AbstractDataContext
-
- org.apache.metamodel.QueryPostprocessDataContext
-
- org.apache.metamodel.elasticsearch.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>dynamicTableDefinitionsprotected StringindexNameprotected List<org.apache.metamodel.util.SimpleTableDef>staticTableDefinitionsstatic org.elasticsearch.common.unit.TimeValueTIMEOUT_SCROLL
-
Constructor Summary
Constructors Constructor Description AbstractElasticSearchDataContext(String indexName, org.apache.metamodel.util.SimpleTableDef... tableDefinitions)Constructs aAbstractElasticSearchDataContext.
-
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.StringgetIndexName()Gets the name of the index that thisDataContextis working on.protected org.apache.metamodel.schema.SchemagetMainSchema()protected StringgetMainSchemaName()protected booleanlimitMaxRowsIsSet(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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
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 aAbstractElasticSearchDataContext. This constructor accepts a custom array ofSimpleTableDefs which allows the user to define his own view on the indexes in the engine.- Parameters:
indexName- the name of the ElasticSearch index to representtableDefinitions- an array ofSimpleTableDefs, 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:
getMainSchemain classorg.apache.metamodel.QueryPostprocessDataContext- Throws:
org.apache.metamodel.MetaModelException
-
getMainSchemaName
protected String getMainSchemaName() throws org.apache.metamodel.MetaModelException
- Specified by:
getMainSchemaNamein classorg.apache.metamodel.QueryPostprocessDataContext- Throws:
org.apache.metamodel.MetaModelException
-
getIndexName
public String getIndexName()
Gets the name of the index that thisDataContextis working on.
-
limitMaxRowsIsSet
protected boolean limitMaxRowsIsSet(int maxRows)
-
sortTables
protected static org.apache.metamodel.util.SimpleTableDef[] sortTables(List<org.apache.metamodel.util.SimpleTableDef> result)
-
-