yanxinyi commented on a change in pull request #489: PHOENIX-5252 Add job
priority option to UpdateStatisticsTool
URL: https://github.com/apache/phoenix/pull/489#discussion_r277474512
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/schema/stats/UpdateStatisticsTool.java
##########
@@ -164,12 +168,36 @@ void parseArgs(String[] args) {
if (restoreDirOptionValue == null) {
restoreDirOptionValue = getConf().get(FS_DEFAULT_NAME_KEY) +
"/tmp";
}
-
+
+ jobPriority = getJobPriority(cmdLine);
+
restoreDir = new Path(restoreDirOptionValue);
manageSnapshot = cmdLine.hasOption(MANAGE_SNAPSHOT_OPTION.getOpt());
isForeground = cmdLine.hasOption(RUN_FOREGROUND_OPTION.getOpt());
}
+ public String getJobPriority() {
+ return this.jobPriority.toString();
+ }
+
+ private JobPriority getJobPriority(CommandLine cmdLine) {
+ String jobPriorityOption =
cmdLine.getOptionValue(JOB_PRIORITY_OPTION.getOpt());
+ if (jobPriorityOption == null) {
+ return JobPriority.DEFAULT;
+ }
+
+ switch (jobPriorityOption) {
+ case "0" : return JobPriority.VERY_HIGH;
+ case "1" : return JobPriority.HIGH;
+ case "2" : return JobPriority.NORMAL;
+ case "3" : return JobPriority.LOW;
+ case "4" : return JobPriority.VERY_LOW;
+ case "5" : return JobPriority.DEFAULT;
Review comment:
https://issues.apache.org/jira/browse/MAPREDUCE-5870
Yes, if priority is not indicated by the user, it sets to default.
----------------------------------------------------------------
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]
With regards,
Apache Git Services