public class AccumuloDefaultIndexScanner extends Object implements AccumuloIndexScanner
This handler looks for the following hive serde properties: 'accumulo.indextable.name' = 'table_idx' (required - name of the corresponding index table) 'accumulo.indexed.columns' = 'name,age,phone' (optional - comma separated list of indexed hive columns if not defined or defined as '*' all columns are assumed to be indexed ) 'accumulo.index.rows.max' = '20000' (optional - maximum number of match indexes to use before converting to a full table scan default=20000' Note: This setting controls the size of the in-memory list of rowids each search predicate. Using large values for this setting or having very large rowid values may require additional memory to prevent out of memory errors 'accumulo.index.scanner' = 'org.apache.hadoop.hive.accumulo.AccumuloDefaultIndexScanner' (optional - name of the index scanner)
To implement your own index table scheme it should be as simple as sub-classing this class and overriding getIndexRowRanges() and optionally init() if you need more config settings
Constructor and Description |
---|
AccumuloDefaultIndexScanner() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
createColumnMap(org.apache.hadoop.conf.Configuration conf) |
org.apache.accumulo.core.security.Authorizations |
getAuths() |
org.apache.accumulo.core.client.Connector |
getConnect() |
protected org.apache.accumulo.core.client.Connector |
getConnector() |
AccumuloConnectionParameters |
getConnectParams() |
Set<String> |
getIndexColumns() |
AccumuloIndexParameters |
getIndexParams() |
List<org.apache.accumulo.core.data.Range> |
getIndexRowRanges(String column,
org.apache.accumulo.core.data.Range indexRange)
Get a list of rowid ranges by scanning a column index.
|
String |
getIndexTable() |
int |
getMaxRowIds() |
void |
init(org.apache.hadoop.conf.Configuration conf)
Initialize object based on configuration.
|
boolean |
isIndexed(String column)
Test if column is defined in the index table.
|
void |
setConnectParams(AccumuloConnectionParameters connectParams) |
public void init(org.apache.hadoop.conf.Configuration conf)
init
in interface AccumuloIndexScanner
conf
- - Hive configurationpublic List<org.apache.accumulo.core.data.Range> getIndexRowRanges(String column, org.apache.accumulo.core.data.Range indexRange)
getIndexRowRanges
in interface AccumuloIndexScanner
column
- - the hive column nameindexRange
- - Key range to scan on the index tablepublic boolean isIndexed(String column)
isIndexed
in interface AccumuloIndexScanner
column
- - hive column nameprotected Map<String,String> createColumnMap(org.apache.hadoop.conf.Configuration conf)
protected org.apache.accumulo.core.client.Connector getConnector() throws org.apache.accumulo.core.client.AccumuloSecurityException, org.apache.accumulo.core.client.AccumuloException
org.apache.accumulo.core.client.AccumuloSecurityException
org.apache.accumulo.core.client.AccumuloException
public void setConnectParams(AccumuloConnectionParameters connectParams)
public AccumuloConnectionParameters getConnectParams()
public AccumuloIndexParameters getIndexParams()
public int getMaxRowIds()
public org.apache.accumulo.core.security.Authorizations getAuths()
public String getIndexTable()
public org.apache.accumulo.core.client.Connector getConnect()
Copyright © 2022 The Apache Software Foundation. All rights reserved.