Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 642D918E99 for ; Fri, 21 Aug 2015 04:42:46 +0000 (UTC) Received: (qmail 50592 invoked by uid 500); 21 Aug 2015 04:42:46 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 50543 invoked by uid 500); 21 Aug 2015 04:42:46 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 50524 invoked by uid 99); 21 Aug 2015 04:42:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 04:42:46 +0000 Date: Fri, 21 Aug 2015 04:42:46 +0000 (UTC) From: "Anoop Sam John (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11490) In HBase Shell set_peer_tableCFs, if the tableCFS is null, it will be wrong MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-11490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14706226#comment-14706226 ] Anoop Sam John commented on HBASE-11490: ---------------------------------------- patch looks ok. nit : tableCFs = new byte[0]; Instead use HConstants.EMPTY_BYTE_ARRAY. Will be better to add an FT test case as Ashish suggested. > In HBase Shell set_peer_tableCFs, if the tableCFS is null, it will be wrong > --------------------------------------------------------------------------- > > 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 > Attachments: HBASE_11490_trunk_v1.patch > > > 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' > ReplicationAdmin#199 > {code} > public void setPeerTableCFs(String id, String tableCFs) throws ReplicationException { > this.replicationPeers.setPeerTableCFsConfig(id, tableCFs); > } > {code} > ReplicationPeersZKImpl#177 > {code} > 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, e); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)