Skip to content

Commit fa3ee3f

Browse files
committed
KYLIN-2525 tolerate job metadata exception in StorageCleanupJob
1 parent c6b4592 commit fa3ee3f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tool/src/main/java/org/apache/kylin/tool/StorageCleanupJob.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.apache.kylin.common.util.AbstractApplication;
4747
import org.apache.kylin.common.util.CliCommandExecutor;
4848
import org.apache.kylin.common.util.HadoopUtil;
49+
import org.apache.kylin.common.util.HiveCmdBuilder;
4950
import org.apache.kylin.common.util.OptionsHelper;
5051
import org.apache.kylin.cube.CubeInstance;
5152
import org.apache.kylin.cube.CubeManager;
@@ -57,7 +58,6 @@
5758
import org.apache.kylin.job.execution.ExecutableState;
5859
import org.apache.kylin.metadata.realization.IRealizationConstants;
5960
import org.apache.kylin.source.hive.HiveClientFactory;
60-
import org.apache.kylin.common.util.HiveCmdBuilder;
6161
import org.apache.kylin.source.hive.IHiveClient;
6262
import org.slf4j.Logger;
6363
import org.slf4j.LoggerFactory;
@@ -276,9 +276,14 @@ public boolean apply(@Nullable String input) {
276276
sb.append(jobId).append("(").append(state).append("), ");
277277
}
278278

279-
String segmentId = getSegmentIdFromJobId(jobId);
280-
if (segmentId != null) {//some jobs are not cubing jobs
281-
segmentId2JobId.put(segmentId, jobId);
279+
try {
280+
String segmentId = getSegmentIdFromJobId(jobId);
281+
if (segmentId != null) {//some jobs are not cubing jobs
282+
segmentId2JobId.put(segmentId, jobId);
283+
}
284+
} catch (Exception ex) {
285+
logger.warn("Failed to find segment ID from job ID " + jobId + ", ignore it");
286+
// some older version job metadata may fail to read, ignore it
282287
}
283288
}
284289
logger.info("Working jobIDs: " + workingJobList);

0 commit comments

Comments
 (0)