aasha commented on a change in pull request #2167:
URL: https://github.com/apache/hive/pull/2167#discussion_r613181869
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUpdaterThread.java
##########
@@ -226,8 +227,8 @@ private void stopWorkers() {
// on the target again
// 2. updating stats requires a writeId to be created. Hence writeIds on
source and target
// can get out of sync when stats are updated. That can cause
consistency issues.
- String replTrgtParam =
table.getParameters().get(ReplConst.REPL_TARGET_TABLE_PROPERTY);
- if (replTrgtParam != null && !replTrgtParam.isEmpty()) {
+ HiveMetaStoreClient msc = new HiveMetaStoreClient(conf);
+ if (ReplUtils.isTargetOfReplication(msc.getDatabase(table.getCatName(),
table.getDbName()))) {
Review comment:
can use rs directly instead of msc
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
##########
@@ -140,7 +140,7 @@
public static final String RANGER_CONFIGURATION_RESOURCE_NAME =
"ranger-hive-security.xml";
- public static final String TARGET_OF_REPLICATION = "repl.target.for";
+ public static final String TARGET_OF_REPLICATION =
ReplConst.TARGET_OF_REPLICATION;
Review comment:
you dont need another constant TARGET_OF_REPLICATION is its already
defined in ReplConst class
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java
##########
@@ -88,9 +90,13 @@ private static boolean partitionDiscoveryEnabled(Map<String,
String> params) {
params.get(DISCOVER_PARTITIONS_TBLPROPERTY).equalsIgnoreCase("true");
}
- private static boolean tblBeingReplicatedInto(Map<String, String> params) {
- return params != null &&
params.containsKey(ReplConst.REPL_TARGET_TABLE_PROPERTY) &&
- !params.get(ReplConst.REPL_TARGET_TABLE_PROPERTY).trim().isEmpty();
+ public boolean isTargetOfReplication(Database db) {
+ assert (db != null);
+ Map<String, String> m = db.getParameters();
Review comment:
rename to params
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUpdaterThread.java
##########
@@ -226,8 +227,8 @@ private void stopWorkers() {
// on the target again
// 2. updating stats requires a writeId to be created. Hence writeIds on
source and target
// can get out of sync when stats are updated. That can cause
consistency issues.
- String replTrgtParam =
table.getParameters().get(ReplConst.REPL_TARGET_TABLE_PROPERTY);
- if (replTrgtParam != null && !replTrgtParam.isEmpty()) {
+ HiveMetaStoreClient msc = new HiveMetaStoreClient(conf);
+ if (ReplUtils.isTargetOfReplication(msc.getDatabase(table.getCatName(),
table.getDbName()))) {
Review comment:
in case of table level replication is anything need to be handled?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]