[
https://issues.apache.org/jira/browse/HBASE-11386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14052580#comment-14052580
]
stack commented on HBASE-11386:
-------------------------------
Nice patch [~qianxiZhang] We'll break anyone currently using this feature?
Their configuration string will break when this code goes in? Does it have to
be this way? Could we support old format and new? Could new format have a
preamble or some such? Looking here, seems like '.' is illegal cf name:
http://hbase.apache.org/xref/org/apache/hadoop/hbase/HColumnDescriptor.html#487
Also '/' or '\'. Would that work.
This doesn't seem right:
- // format: "table1:cf1,cf2;table2:cfA,cfB"
+ // format: "ns:table1 cf1,cf2,cf3; ns:table2 cf1,cf2,cf3: ns:table3;
table4"
Should that be a ';' after cf3?
Suggest you use table1 and table2 instead of tab1 and tab2 in below. It makes
it more explicit that its table:
- hbase> add_peer '3', "zk4,zk5,zk6:11000:/hbase-test", "tab1; tab2:cf1;
tab3:cf2,cf3"
+ hbase> add_peer '3', "zk4,zk5,zk6:11000:/hbase-test", "ns1:tab1; tab2;
ns2:tab2 cf1; tab3 cf2,cf3; ns4:tab4 cf1,cf3,cf5"
Nice work.
> Replication#table,CF config will be wrong if the table name includes namespace
> ------------------------------------------------------------------------------
>
> Key: HBASE-11386
> URL: https://issues.apache.org/jira/browse/HBASE-11386
> Project: HBase
> Issue Type: Bug
> Components: Replication
> Reporter: Qianxi Zhang
> Assignee: Qianxi Zhang
> Priority: Minor
> Attachments: HBASE_11386_trunk_v1.patch
>
>
> Now we can config the table and CF in Replication, but I think the parse will
> be wrong if the table name includes namespace
> ReplicationPeer#parseTableCFsFromConfig(line 125)
> {code}
> Map<String, List<String>> tableCFsMap = null;
> // parse out (table, cf-list) pairs from tableCFsConfig
> // format: "table1:cf1,cf2;table2:cfA,cfB"
> String[] tables = tableCFsConfig.split(";");
> for (String tab : tables) {
> // 1 ignore empty table config
> tab = tab.trim();
> if (tab.length() == 0) {
> continue;
> }
> // 2 split to "table" and "cf1,cf2"
> // for each table: "table:cf1,cf2" or "table"
> String[] pair = tab.split(":");
> String tabName = pair[0].trim();
> if (pair.length > 2 || tabName.length() == 0) {
> LOG.error("ignore invalid tableCFs setting: " + tab);
> continue;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)