hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qianxi Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-11490) In HBase Shell set_peer_tableCFs, if the tableCFS is null, it will be wrong
Date Thu, 10 Jul 2014 12:37:04 GMT
Qianxi Zhang created HBASE-11490:

             Summary: In HBase Shell set_peer_tableCFs, if the tableCFS is null, it will be
                 Key: HBASE-11490
                 URL: https://issues.apache.org/jira/browse/HBASE-11490
             Project: HBase
          Issue Type: Bug
          Components: Replication
    Affects Versions: 0.99.0
            Reporter: Qianxi Zhang
            Assignee: Qianxi Zhang
            Priority: Minor

In HBase Shell set_peer_tableCFs, If the tableCFS is null, it will throw NPE

 # set all tables to be replicable for a peer
    hbase> set_peer_tableCFs '1', ""
    hbase> set_peer_tableCFs '1'

  public void setPeerTableCFs(String id, String tableCFs) throws ReplicationException {
    this.replicationPeers.setPeerTableCFsConfig(id, tableCFs);

  public void setPeerTableCFsConfig(String id, String tableCFsStr) throws ReplicationException
    try {
      if (!peerExists(id)) {
        throw new IllegalArgumentException("Cannot set peer tableCFs because id=" + id
            + " does not exist.");
      String tableCFsZKNode = getTableCFsNode(id);
      byte[] tableCFs = Bytes.toBytes(tableCFsStr);
      if (ZKUtil.checkExists(this.zookeeper, tableCFsZKNode) != -1) {
        ZKUtil.setData(this.zookeeper, tableCFsZKNode, tableCFs);
      } else {
        ZKUtil.createAndWatch(this.zookeeper, tableCFsZKNode, tableCFs);
      LOG.info("Peer tableCFs with id= " + id + " is now " + tableCFsStr);
    } catch (KeeperException e) {
      throw new ReplicationException("Unable to change tableCFs of the peer with id=" + id,

This message was sent by Atlassian JIRA

View raw message