public class HBaseDataContext extends QueryPostprocessDataContext
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_ID |
INFORMATION_SCHEMA_NAME| Constructor and Description |
|---|
HBaseDataContext(HBaseConfiguration configuration)
Creates a
HBaseDataContext. |
HBaseDataContext(HBaseConfiguration configuration,
org.apache.hadoop.hbase.client.Connection connection)
Creates a
HBaseDataContext. |
| Modifier and Type | Method and Description |
|---|---|
protected Number |
executeCountQuery(Table table,
List<FilterItem> whereItems,
boolean functionApproximationAllowed)
Executes a simple count query, if possible.
|
protected Row |
executePrimaryKeyLookupQuery(Table table,
List<SelectItem> selectItems,
Column primaryKeyColumn,
Object keyValue)
Executes a query which obtains a row by primary key (as defined by
Column.isPrimaryKey()). |
org.apache.hadoop.hbase.client.Admin |
getAdmin()
Gets the
Admin used by this DataContext |
HBaseConfiguration |
getConfiguration()
Gets the
HBaseConfiguration that is used in this datacontext. |
org.apache.hadoop.hbase.client.Connection |
getConnection() |
protected org.apache.hadoop.hbase.client.Table |
getHTable(String name) |
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
protected DataSet |
materializeMainSchemaTable(Table table,
Column[] columns,
int maxRows)
Executes a simple one-table query against a table in the main schema of
the subclasses of this class.
|
addConverter, executeQuery, getDefaultSchemaName, getMainSchemaInternal, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeMainSchemaTable, materializeTable, materializeTablecompileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemaspublic static final String FIELD_ID
public HBaseDataContext(HBaseConfiguration configuration)
HBaseDataContext.configuration - public HBaseDataContext(HBaseConfiguration configuration, org.apache.hadoop.hbase.client.Connection connection)
HBaseDataContext.configuration - connection - public org.apache.hadoop.hbase.client.Admin getAdmin()
Admin used by this DataContextpublic org.apache.hadoop.hbase.client.Connection getConnection()
protected Schema getMainSchema() throws MetaModelException
getMainSchema in class QueryPostprocessDataContextMetaModelExceptionpublic HBaseConfiguration getConfiguration()
HBaseConfiguration that is used in this datacontext.protected String getMainSchemaName() throws MetaModelException
getMainSchemaName in class QueryPostprocessDataContextMetaModelExceptionprotected Number executeCountQuery(Table table, List<FilterItem> whereItems, boolean functionApproximationAllowed)
QueryPostprocessDataContextexecuteCountQuery in class QueryPostprocessDataContexttable - the table on which the count is requested.whereItems - a (sometimes empty) list of WHERE items.functionApproximationAllowed - whether approximation is allowed or not.protected org.apache.hadoop.hbase.client.Table getHTable(String name)
protected Row executePrimaryKeyLookupQuery(Table table, List<SelectItem> selectItems, Column primaryKeyColumn, Object keyValue)
QueryPostprocessDataContextColumn.isPrimaryKey()). This method is provided to allow
subclasses to optimize lookup queries since they are quite common and
often a datastore can retrieve the row using some specialized means which
is much more performant than scanning all records manually.executePrimaryKeyLookupQuery in class QueryPostprocessDataContexttable - the table on which the lookup is requested.selectItems - the items to select from the lookup query.primaryKeyColumn - the column that is the primary keykeyValue - the primary key value that is specified in the lookup query.protected DataSet materializeMainSchemaTable(Table table, Column[] columns, int maxRows)
QueryPostprocessDataContextmaterializeMainSchemaTable in class QueryPostprocessDataContexttable - the table to querycolumns - the columns of the table to querymaxRows - the maximum amount of rows needed or -1 if all rows are
wanted.Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.