You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2019/04/22 23:25:55 UTC

[GitHub] [phoenix] ChinmaySKulkarni commented on a change in pull request #489: PHOENIX-5252 Add job priority option to UpdateStatisticsTool

ChinmaySKulkarni 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_r277471614
 
 

 ##########
 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:
   What is the `JobPriority.DEFAULT` level? Perhaps this should be the default case?

----------------------------------------------------------------
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