[
https://issues.apache.org/jira/browse/HIVE-24227?focusedWorklogId=495283&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-495283
]
ASF GitHub Bot logged work on HIVE-24227:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Oct/20 11:50
Start Date: 05/Oct/20 11:50
Worklog Time Spent: 10m
Work Description: aasha commented on a change in pull request #1550:
URL: https://github.com/apache/hive/pull/1550#discussion_r499539993
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
##########
@@ -280,6 +299,49 @@ public static PathFilter getBootstrapDirectoryFilter(final
FileSystem fs) {
};
}
+ public static Path getMetricPath(MessageHandler.Context context, HiveConf
hiveConf) throws Exception{
+ DumpType dumpType;
+ Path metricPath = null;
+ String dumpMetaFile = DumpMetaData.getDmdFileName();
+ FileSystem fs = null;
+ if(context.dmd != null) {
+ dumpType = context.dmd.getDumpType();
+ fs = context.dmd.getDumpFilePath().getFileSystem(hiveConf);
+ metricPath = context.dmd.getDumpFilePath().getParent();
+ }
+ else {
+ dumpType = null;
+ if(context.location != null){
+ metricPath = (new Path(context.location)).getParent();
+ fs = (new Path(context.location)).getFileSystem(hiveConf);
+ }
+ }
+ //traverse to hiveDumpRoot required by metric-collector
+ while (metricPath != null && fs != null && dumpType != DumpType.BOOTSTRAP
&& dumpType != DumpType.INCREMENTAL) {
+ metricPath = metricPath.getParent();
+ if (fs.exists(new Path(metricPath, dumpMetaFile))) {
+ dumpType = (new DumpMetaData(metricPath, hiveConf)).getDumpType();
+ }
+ }
+ return metricPath;
+ }
+
+ public static ReplicationMetricCollector
getMetricCollector(MessageHandler.Context context, String dbName,
+ Path metricPath,
HiveConf hiveConf) throws Exception {
+ if (metricPath != null) {
+ DumpType dumpType = (new DumpMetaData(metricPath,
hiveConf)).getDumpType();
+ //for using this, dumpType should be either INCREMENTAL or BOOTSTRAP.
+ if (dumpType == DumpType.BOOTSTRAP) {
+ return new BootstrapLoadMetricCollector(dbName, metricPath.toString(),
+ context.dmd.getDumpExecutionId(), hiveConf);
Review comment:
you can pass just the DumpExecutionId. no need to pass the entire context
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 495283)
Time Spent: 1h 50m (was: 1h 40m)
> sys.replication_metrics table shows incorrect status for failed policies
> ------------------------------------------------------------------------
>
> Key: HIVE-24227
> URL: https://issues.apache.org/jira/browse/HIVE-24227
> Project: Hive
> Issue Type: Bug
> Reporter: Arko Sharma
> Assignee: Arko Sharma
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)