diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/SweepJob.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/SweepJob.java index 1c8bad744b4..388fa63bd94 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/SweepJob.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/SweepJob.java @@ -141,6 +141,9 @@ public class SweepJob { * compaction in progress. * @param tn The current table name. * @param family The descriptor of the current column family. + * @return 0 upon success, 3 if bailing out because another compaction is currently happening, + * or 4 the mr job was unsuccessful + * * @throws IOException * @throws ClassNotFoundException * @throws InterruptedException @@ -215,7 +218,7 @@ public class SweepJob { // Archive the unused mob files. removeUnusedFiles(job, tn, family); } else { - System.err.println("Job Failed"); + System.err.println("Job was not successful"); return 4; } } finally { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java index 24b573e084b..9342a314d91 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java @@ -50,6 +50,8 @@ public class Sweeper extends Configured implements Tool { * the small mob files into bigger ones. * @param tableName The current table name in string format. * @param familyName The column family name. + * @return 0 if success, 2 if job aborted with an exception, 3 if unable to start due to + * other compaction,4 if mr job was unsuccessful * @throws IOException * @throws InterruptedException * @throws ClassNotFoundException @@ -74,7 +76,7 @@ public class Sweeper extends Configured implements Tool { // Run the sweeping return job.sweep(tn, family); } catch (Exception e) { - System.err.println("Job failed. " + e); + System.err.println("Job aborted due to exception " + e); return 2; // job failed } finally { try { @@ -98,6 +100,11 @@ public class Sweeper extends Configured implements Tool { System.err.println(" familyName The column family name"); } + /** + * Main method for the tool. + * @return 0 if success, 1 for bad args. 2 if job aborted with an exception, + * 3 if unable to start due to other compaction, 4 if mr job was unsuccessful + */ public int run(String[] args) throws Exception { if (args.length != 2) { printUsage();