kasakrisz commented on code in PR #3916:
URL: https://github.com/apache/hive/pull/3916#discussion_r1063437196


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorThread.java:
##########
@@ -86,12 +93,18 @@ public Configuration getConf() {
 
   public void init(AtomicBoolean stop) throws Exception {
     setPriority(MIN_PRIORITY);
-    setDaemon(true); // this means the process will exit without waiting for 
this thread
+    setDaemon(false);
     this.stop = stop;
     this.hostName = ServerUtils.hostname();
     this.runtimeVersion = getRuntimeVersion();
   }
 
+  protected void checkInterrupt() throws InterruptedException {
+    if (Thread.interrupted()) {
+      throw new InterruptedException(type.name() + " execution is 
interrupted.");

Review Comment:
   Since we already have class hierarchy to define common and specific parts of 
the code the `CompactorThreadType` enum is not necessary. Especially if it is 
used only for naming subclasses.
   
   I think a method like
   ```
   abstract String getName(); 
   ``` 
   and the corresponding implementations in each subclass can be used.
   
   Or maybe something like `this.getClass().getName()` also works.



##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java:
##########
@@ -271,7 +272,7 @@ protected Boolean findNextCompactionAndExecute(boolean 
collectGenericStats, bool
       if (ci == null) {
         return false;
       }
-      if ((runtimeVersion != null || ci.initiatorVersion != null) && 
!runtimeVersion.equals(ci.initiatorVersion)) {
+      if ((runtimeVersion != null && ci.initiatorVersion != null) && 
!runtimeVersion.equals(ci.initiatorVersion)) {

Review Comment:
   What happens if `runtimeVersion` is not null but `ci.initiatorVersion` is 
null? Shouldn't we log the mismatch in this 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to