phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] yanxinyi commented on a change in pull request #489: PHOENIX-5252 Add job priority option to UpdateStatisticsTool
Date Mon, 22 Apr 2019 23:42:09 GMT
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_r277474726
 
 

 ##########
 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:
   maybe I should change to normal or default instead UNDEFINED_PRIORITY

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message