public class ElasticSearchDataContext extends QueryPostprocessDataContext implements DataContext, UpdateableDataContext
SimpleTableDef class.| Modifier and Type | Field and Description |
|---|---|
static org.elasticsearch.common.unit.TimeValue |
TIMEOUT_SCROLL |
INFORMATION_SCHEMA_NAME| Constructor and Description |
|---|
ElasticSearchDataContext(org.elasticsearch.client.Client client,
String indexName)
Constructs a
ElasticSearchDataContext and automatically detects
the schema structure/view on all indexes (see
detectTable(ClusterState, String, String)). |
ElasticSearchDataContext(org.elasticsearch.client.Client client,
String indexName,
SimpleTableDef... tableDefinitions)
Constructs a
ElasticSearchDataContext. |
| Modifier and Type | Method and Description |
|---|---|
static SimpleTableDef |
detectTable(org.elasticsearch.cluster.ClusterState cs,
String indexName,
String documentType)
Performs an analysis of an available index type in an ElasticSearch
Client client and tries to detect the index structure based on
the metadata provided by the java client. |
protected Number |
executeCountQuery(Table table,
List<FilterItem> whereItems,
boolean functionApproximationAllowed) |
protected Row |
executePrimaryKeyLookupQuery(Table table,
List<SelectItem> selectItems,
Column primaryKeyColumn,
Object keyValue) |
void |
executeUpdate(UpdateScript update) |
org.elasticsearch.client.Client |
getElasticSearchClient()
Gets the
Client that this DataContext is wrapping. |
String |
getIndexName()
Gets the name of the index that this
DataContext is working on. |
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
protected DataSet |
materializeMainSchemaTable(Table table,
Column[] columns,
int maxRows) |
protected DataSet |
materializeMainSchemaTable(Table table,
List<SelectItem> selectItems,
List<FilterItem> whereItems,
int firstRow,
int maxRows) |
addConverter, executeQuery, getDefaultSchemaName, getMainSchemaInternal, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeTable, materializeTablecompileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompileQuery, executeQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemaspublic static final org.elasticsearch.common.unit.TimeValue TIMEOUT_SCROLL
public ElasticSearchDataContext(org.elasticsearch.client.Client client,
String indexName,
SimpleTableDef... tableDefinitions)
ElasticSearchDataContext. This constructor accepts a
custom array of SimpleTableDefs which allows the user to define
his own view on the indexes in the engine.client - the ElasticSearch clientindexName - the name of the ElasticSearch index to representtableDefinitions - an array of SimpleTableDefs, which define the table
and column model of the ElasticSearch index.public ElasticSearchDataContext(org.elasticsearch.client.Client client,
String indexName)
ElasticSearchDataContext and automatically detects
the schema structure/view on all indexes (see
detectTable(ClusterState, String, String)).client - the ElasticSearch clientindexName - the name of the ElasticSearch index to representpublic static SimpleTableDef detectTable(org.elasticsearch.cluster.ClusterState cs, String indexName, String documentType) throws Exception
Client client and tries to detect the index structure based on
the metadata provided by the java client.cs - the ElasticSearch clusterindexName - the name of the indexdocumentType - the name of the index typeExceptionprotected Schema getMainSchema() throws MetaModelException
getMainSchema in class QueryPostprocessDataContextMetaModelExceptionprotected String getMainSchemaName() throws MetaModelException
getMainSchemaName in class QueryPostprocessDataContextMetaModelExceptionprotected DataSet materializeMainSchemaTable(Table table, List<SelectItem> selectItems, List<FilterItem> whereItems, int firstRow, int maxRows)
materializeMainSchemaTable in class QueryPostprocessDataContextprotected DataSet materializeMainSchemaTable(Table table, Column[] columns, int maxRows)
materializeMainSchemaTable in class QueryPostprocessDataContextprotected Row executePrimaryKeyLookupQuery(Table table, List<SelectItem> selectItems, Column primaryKeyColumn, Object keyValue)
executePrimaryKeyLookupQuery in class QueryPostprocessDataContextprotected Number executeCountQuery(Table table, List<FilterItem> whereItems, boolean functionApproximationAllowed)
executeCountQuery in class QueryPostprocessDataContextpublic void executeUpdate(UpdateScript update)
executeUpdate in interface UpdateableDataContextpublic org.elasticsearch.client.Client getElasticSearchClient()
Client that this DataContext is wrapping.public String getIndexName()
DataContext is working on.Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.