[
https://issues.apache.org/jira/browse/HBASE-11386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14982622#comment-14982622
]
Ashish Singhi commented on HBASE-11386:
---------------------------------------
Raised the priority of this issue.
Currently user cannot explicitly ask only for a namespace table data to
replicate and if a table with same name is present in 'n' different namespaces
then data from all that namespaces is getting replicated though user is not
interested.
To fix this may be we can keep existing practice of specifying table CFs as it
is
{noformat}
add_peer '3', "zk4,zk5,zk6:11000:/hbase-test", "table1; table2:cf1;
table3:cf1,cf2"}}
{noformat}
and can expand
{noformat}
hbase> add_peer '10', ENDPOINT_CLASSNAME =>
'org.apache.hadoop.hbase.MyReplicationEndpoint', TABLE_CFS => { "table1" => [],
"table2" => ["cf1"], "table3" => ["cf1", "cf2"] }
{noformat}
to support namespace. Internally may be we can use '::' as a delimiter between
a namespace and a table.
So if user uses the former one to set table cfs then we can keep existing
behavior as it is and for latter one we can develop code to replicate only
requested namespace data to replicate.
With this we will extend this functionality to allow user to specify only
namespace, so for that we can replicate all the data belonging only to that
namespace.
[~qianxiZhang], are u still interested in working on this ? If not, I can
happily take this up.
> 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: Critical
> Attachments: HBASE_11386_trunk_v1.patch, HBASE_11386_trunk_v2.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.3.4#6332)