veghlaci05 commented on code in PR #3803:
URL: https://github.com/apache/hive/pull/3803#discussion_r1031246443
##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorThread.java:
##########
@@ -61,6 +61,9 @@ public abstract class CompactorThread extends Thread
implements Configurable {
protected String hostName;
protected String runtimeVersion;
+ //Time threshold for compactor thread log
+ //In milli sec
Review Comment:
nit: milliseconds
##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java:
##########
@@ -181,10 +178,16 @@ public void run() {
}
// Now, go back to bed until it's time to do this again
long elapsedTime = System.currentTimeMillis() - startedAt;
- if (elapsedTime < cleanerCheckInterval && !stop.get()) {
- Thread.sleep(cleanerCheckInterval - elapsedTime);
+ long threadSleepTime = getThreadSleepTime(elapsedTime, stop,
CompactorUtil.CompactorThreadType.CLEANER);
+
+ if(threadSleepTime != -1 ) Thread.sleep(threadSleepTime);
+
+
+ if(elapsedTime < MAX_WARN_LOG_TIME){
+ LOG.debug("Cleaner loop took " + elapsedTime + " milli sec to
finish.");
Review Comment:
Please log the value in seconds, also in all other occurrences.
##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorUtil.java:
##########
@@ -34,6 +34,8 @@
public class CompactorUtil {
public static final String COMPACTOR = "compactor";
+
+ public enum CompactorThreadType {INITIATOR, WORKER, CLEANER}
Review Comment:
Move this to CompactorThread
--
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]