public interface AliHBaseTableInterface
extends org.apache.hadoop.hbase.client.Table
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addExternalIndex(com.alibaba.lindorm.client.core.meta.ExternalIndexConfig config,
com.alibaba.lindorm.client.core.meta.ExternalIndexField... fields) |
void |
addExternalIndex(com.alibaba.lindorm.client.core.meta.ExternalIndexConfig config,
List<com.alibaba.lindorm.client.core.meta.ExternalIndexField> fields) |
void |
addExternalIndex(com.alibaba.lindorm.client.core.meta.ExternalIndexField... fields) |
void |
addExternalIndex(List<com.alibaba.lindorm.client.core.meta.ExternalIndexField> fields) |
void |
addExternalIndex(String targetIndexName,
com.alibaba.lindorm.client.core.meta.ExternalIndexType type,
com.alibaba.lindorm.client.core.meta.ExternalIndexRowFormatterType rowFormatterType,
com.alibaba.lindorm.client.core.meta.ExternalIndexField... fields) |
void |
addExternalIndex(String targetIndexName,
com.alibaba.lindorm.client.core.meta.ExternalIndexType indexType,
com.alibaba.lindorm.client.core.meta.ExternalIndexRowFormatterType rowFormatterType,
List<com.alibaba.lindorm.client.core.meta.ExternalIndexField> fields)
Add the fields to index to the TableDescriptor
|
void |
buildExternalIndex()
build index for data in the table
|
void |
cancelBuildExternalIndex()
Cancel the currently building external index job
|
void |
removeExternalIndex(List<String> fields)
remove indexed field
|
void |
removeExternalIndex(String... fields) |
append, batch, batchCallback, batchCoprocessorService, batchCoprocessorService, checkAndDelete, checkAndDelete, checkAndDelete, checkAndMutate, checkAndMutate, checkAndMutate, checkAndPut, checkAndPut, checkAndPut, close, coprocessorService, coprocessorService, coprocessorService, delete, delete, exists, exists, existsAll, get, get, getConfiguration, getDescriptor, getName, getOperationTimeout, getOperationTimeout, getReadRpcTimeout, getReadRpcTimeout, getRpcTimeout, getRpcTimeout, getScanner, getScanner, getScanner, getTableDescriptor, getWriteRpcTimeout, getWriteRpcTimeout, increment, incrementColumnValue, incrementColumnValue, mutateRow, put, put, setOperationTimeout, setReadRpcTimeout, setRpcTimeout, setWriteRpcTimeoutvoid addExternalIndex(String targetIndexName, com.alibaba.lindorm.client.core.meta.ExternalIndexType indexType, com.alibaba.lindorm.client.core.meta.ExternalIndexRowFormatterType rowFormatterType, List<com.alibaba.lindorm.client.core.meta.ExternalIndexField> fields) throws IOException
targetIndexName - the target index name, for example, if the indexer is solr, then it will
be the collection name, if indexer is ES, then index name will be it. The
targetIndexName will be set to TableIndexConfig and stored in TableDescriptor.
TargetIndexName will be compared each time if index field changed. The fields in
one table can only index to the same target. Set targetIndexName to null to use
the stored targetIndexName directly.indexType - the indexer type, only SOLR can supported for now.
All fields in one table can only be indexed to one indexer, so the type will be
compared with the previous stored. Set type to null to use the stored type directly.rowFormatterType - Rowkey of HBase KeyValue will be indexed to an unique field named 'id' in the external index.
User may use this 'id' field to read back the whole row from HBase. the 'id' field is String type
and rowkey of HBase is byte[]. RowFormatterType is used to Tell the system how to index
rowkey of HBase KeyValue to a unique id in the external indexer.
If your rowkey can convert to a string, then use ExternalIndexRowFormatterType.STRING.
It will use Bytes.toString(byte[]) to convert rowkey to an unique "id" string in the external indexer.
Otherwise use HEX, it wll use org.apache.commons.codec.binary.Hex.encodeAsString(byte[]) to
convert rowkey to an unique "id" string in the external indexfields - the field to add. To define a column to index, a ExternalIndexField class need to be
constructed. For example, if we want to index f:q1 in Solr, the filed name in solr f
or this field is q1_s, and the data stored in f:q1 is string, type will be STRING.
Then the code will be like this:
ExternalIndexField field = new ExternalIndexField("f", "q1", "q1_s", ValueType.STRING)
When indexing this filed, Bytes.toString(f:q1) will be used to convert it to a String,
when type=LONG, then Bytes.toLong(f:q1) will be used. It is important to set field type right,
otherwise, the converting will wrong and end up in data corruption.
Type supported:INT, LONG, STRING, BOOLEAN, FLOAT, DOUBLE, SHORT("short"), BIGDECIMALIOExceptionvoid addExternalIndex(String targetIndexName, com.alibaba.lindorm.client.core.meta.ExternalIndexType type, com.alibaba.lindorm.client.core.meta.ExternalIndexRowFormatterType rowFormatterType, com.alibaba.lindorm.client.core.meta.ExternalIndexField... fields) throws IOException
targetIndexName - type - fields - IOExceptionaddExternalIndex(String, ExternalIndexType, ExternalIndexRowFormatterType, List)void addExternalIndex(com.alibaba.lindorm.client.core.meta.ExternalIndexConfig config,
List<com.alibaba.lindorm.client.core.meta.ExternalIndexField> fields)
throws IOException
config - see ExternalIndexConfig for more details, config target index name, index type and rowformatter type inside config.fields - IOExceptionaddExternalIndex(String, ExternalIndexType, ExternalIndexRowFormatterType, List)void addExternalIndex(com.alibaba.lindorm.client.core.meta.ExternalIndexConfig config,
com.alibaba.lindorm.client.core.meta.ExternalIndexField... fields)
throws IOException
config - see ExternalIndexConfig for more details, config target index name, index type and rowformatter type inside config.fields - IOExceptionaddExternalIndex(String, ExternalIndexType, ExternalIndexRowFormatterType, List)void addExternalIndex(List<com.alibaba.lindorm.client.core.meta.ExternalIndexField> fields) throws IOException
void addExternalIndex(com.alibaba.lindorm.client.core.meta.ExternalIndexField... fields)
throws IOException
fields - IOExceptionfor detatilsvoid removeExternalIndex(List<String> fields) throws IOException
fields - the field to remove, field name should include family name and qualifier name
For example, if we want to stop to index a column with family 'f' and qualifier name 'q1'
then filed name will be 'f:q1'IOExceptionvoid removeExternalIndex(String... fields) throws IOException
IOExceptionvoid buildExternalIndex()
throws IOException
IOExceptionvoid cancelBuildExternalIndex()
throws IOException
IOExceptionCopyright © 2019. All rights reserved.