Reamer commented on a change in pull request #4010:
URL: https://github.com/apache/zeppelin/pull/4010#discussion_r550987144



##########
File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/hive/HiveUtils.java
##########
@@ -71,11 +71,14 @@ public static void startHiveMonitorThread(Statement stmt,
     final ProgressBar progressBar = progressBarTemp;
     final long timeoutThreshold = Long.parseLong(
             
jdbcInterpreter.getProperty("zeppelin.jdbc.hive.timeout.threshold", "" + 60 * 
1000));
+    final long queryInterval = 
Long.parseLong(jdbcInterpreter.getProperty("zeppelin.jdbc.hive.monitor.query_interval",
+            DEFAULT_QUERY_PROGRESS_INTERVAL + ""));
     Thread thread = new Thread(() -> {
       boolean jobLaunched = false;
       long jobLastActiveTime = System.currentTimeMillis();
       while (hiveStmt.hasMoreLogs() && !Thread.interrupted()) {
         try {
+          Thread.sleep(queryInterval);

Review comment:
       For good practice we should restore the interrupted state.
   Take a look at this rule:
   https://rules.sonarsource.com/java/tag/multi-threading/RSPEC-2142
   
   Maybe it makes sense to swap the ’while’ and ’try’ to reduce the amount of 
’break’.
   




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


Reply via email to