eab148 commented on code in PR #6484:
URL: https://github.com/apache/hbase/pull/6484#discussion_r1857116474
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.java:
##########
@@ -97,13 +97,39 @@ default ReplicationPeerConfigBuilder
putAllPeerData(Map<byte[], byte[]> peerData
*/
ReplicationPeerConfigBuilder setTableCFsMap(Map<TableName, List<String>>
tableCFsMap);
+ /**
+ * Sets an explicit map of source to sink tables that should be replicated
to the given peer. If
+ * the map is empty for a table, the source table is used for the given peer.
+ * @param sourceToSinkTableOverrides A map from a source tableName to sink
tableName. By default,
+ * edits will be replicated to the same
target table as the
+ * source table. A null or empty
collection can be passed to
+ * indicate there are no overrides.
+ * @return {@code this}
+ */
+ ReplicationPeerConfigBuilder
+ setSourceToSinkTableOverrides(Map<TableName, TableName>
sourceToSinkTableOverrides);
+
/**
* Sets a unique collection of HBase namespaces that should be replicated to
this peer.
* @param namespaces A set of namespaces to be replicated to this peer.
* @return {@code this}
*/
ReplicationPeerConfigBuilder setNamespaces(Set<String> namespaces);
+ /**
+ * Sets an explicit map of source to sink namespaces that should be
replicated to the given peer.
+ * If the map is empty for a namespace, the source namespace is used for the
given peer. Use
+ * {@link #setSourceToSinkTableOverrides} to override the namespace
overrides set in this method
+ * for a given table.
+ * @param sourceToSinkNamespaceOverrides A map from a source namespace to
sink namespace. By
+ * default, edits will be replicated
to the same namespace
+ * as the source namespace. A null or
empty collection can
+ * be passed to indicate there are no
overrides.
Review Comment:
If the overrides only cover a subset of the peer's tables, then we assume
that the source tableName is the same as the sink tableName.
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.java:
##########
@@ -97,13 +97,39 @@ default ReplicationPeerConfigBuilder
putAllPeerData(Map<byte[], byte[]> peerData
*/
ReplicationPeerConfigBuilder setTableCFsMap(Map<TableName, List<String>>
tableCFsMap);
+ /**
+ * Sets an explicit map of source to sink tables that should be replicated
to the given peer. If
+ * the map is empty for a table, the source table is used for the given peer.
+ * @param sourceToSinkTableOverrides A map from a source tableName to sink
tableName. By default,
+ * edits will be replicated to the same
target table as the
+ * source table. A null or empty
collection can be passed to
+ * indicate there are no overrides.
+ * @return {@code this}
+ */
+ ReplicationPeerConfigBuilder
+ setSourceToSinkTableOverrides(Map<TableName, TableName>
sourceToSinkTableOverrides);
+
/**
* Sets a unique collection of HBase namespaces that should be replicated to
this peer.
* @param namespaces A set of namespaces to be replicated to this peer.
* @return {@code this}
*/
ReplicationPeerConfigBuilder setNamespaces(Set<String> namespaces);
+ /**
+ * Sets an explicit map of source to sink namespaces that should be
replicated to the given peer.
+ * If the map is empty for a namespace, the source namespace is used for the
given peer. Use
+ * {@link #setSourceToSinkTableOverrides} to override the namespace
overrides set in this method
+ * for a given table.
+ * @param sourceToSinkNamespaceOverrides A map from a source namespace to
sink namespace. By
+ * default, edits will be replicated
to the same namespace
+ * as the source namespace. A null or
empty collection can
+ * be passed to indicate there are no
overrides.
Review Comment:
If the overrides only cover a subset of the peer's tables, then we assume
that the source tableName is the same as the sink tableName for all of those
tableNames that do not exist in the map
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]