zoukankan      html  css  js  c++  java
  • phoenix创建二级索引

    create table user (id varchar primary key, firstname varchar, lastname varchar); 
    create index user_idx on user (firstname);

    hbase-site.xml中配置

            <property> 
              <name>hbase.regionserver.wal.codec</name> 
              <value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value> 
            </property>
    
            <property> 
              <name>hbase.region.server.rpc.scheduler.factory.class</name>
              <value>org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory</value> 
              <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description> 
            </property>
    
            <property>
              <name>hbase.rpc.controllerfactory.class</name>
              <value>org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory</value>
              <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description>
            </property>
    
            <property>
              <name>hbase.coprocessor.regionserver.classes</name>
              <value>org.apache.hadoop.hbase.regionserver.LocalIndexMerger</value> 
            </property>

    否则报错

    Error: ERROR 1029 (42Y88): Mutable secondary indexes must have the hbase.regionserver.wal.codec property set to
    org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec in the hbase-sites.xml of every region server. tableName=LAYER_IDX (state=42Y88,code=1029)

  • 相关阅读:
    sort()函数与qsort()函数
    个人作业——软件工程实践总结作业
    个人作业——软件评测
    软件工程实践2019第五次作业
    软件工程实践2019第四次作业
    软件工程实践2019第三次作业
    软件工程实践2019第二次作业
    期末大作业
    第7次实践作业
    第6次实践作业
  • 原文地址:https://www.cnblogs.com/nshuai/p/5805929.html
Copyright © 2011-2022 走看看