hbase rest:声明协处理器

xtupzzrd  于 2021-06-09  发布在  Hbase
关注(0)|答案(0)|浏览(344)

我很难通过hbase rest创建带有协处理器的hbase表。
hbase\u table\u ttt.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<TableSchema name="ttt" coprocessor="hdfs:///my_coprocessor-1.0.jar|com.mycompany.MyCoprocessor|1001|">
    <ColumnSchema name="d" BLOCKCACHE="true" VERSIONS="1" IN_MEMORY="true"/>
</TableSchema>

通过创建表的后续调用:

TARGET_HOST="hbase-instance-with-rest.amazonaws.com:8080"
curl -X PUT -H "Content-Type: text/xml" -H "Accept: text/xml" -d @hbase_table_ttt.xml http://$TARGET_HOST/ttt/schema/

在禁用协处理器的情况下,生成以下架构:

'ttt', {METHOD => 'table_att', CONFIG => {'coprocessor' => 'hdfs:///my_coprocessor-1.0.jar|com.mycompany.MyCoprocessor|1001|'}}, 
       {NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', 
        MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', 
        IN_MEMORY => 'true', ENCODE_ON_DISK => 'true', BLOCKCACHE=>'true'}

同时, hbase shell 命令:

create 'ttt', 'd'
disable 'ttt'
alter 'ttt', METHOD => 'table_att', 'coprocessor'=>'hdfs:///my_coprocessor-1.0.jar|com.mycompany.MyCoprocessor|1001|'
enable 'ttt'

生成启用了协处理器的架构:

'ttt', {METHOD => 'table_att', coprocessor$1 => 'hdfs:///my_coprocessor-1.0.jar|com.mycompany.MyCoprocessor|1001|'}, 
       {NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE',
        MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', 
        IN_MEMORY => 'true', ENCODE_ON_DISK => 'true', BLOCKCACHE => 'true'}

问题:
如何在hbase\u table\u ttt.xml文件中正确注册协处理器?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题