Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2541#discussion_r204656119
--- Diff:
core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
---
@@ -769,6 +769,26 @@ public static Boolean
isLoadInProgressInTable(CarbonTable carbonTable) {
return loadInProgress;
}
+ /**
+ * Return true if the compaction is in progress for the table
+ * @param carbonTable
+ * @return
+ */
+ public static Boolean isCompactionInProgress(CarbonTable carbonTable) {
+ if (carbonTable == null) {
+ return false;
+ }
+ boolean compactionInProgress;
+ ICarbonLock lock = CarbonLockFactory
+ .getCarbonLockObj(carbonTable.getAbsoluteTableIdentifier(),
LockUsage.COMPACTION_LOCK);
+ try {
+ compactionInProgress = !lock.lockWithRetries();
--- End diff --
call lockWithRetries(int retryCount, int retryInterval) with retrycount 1
---