diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java index 752a639..fc39ba3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java @@ -639,7 +639,17 @@ public class LoadIncrementalHFiles extends Configured implements Tool { List lqis = new ArrayList(2); lqis.add(new LoadQueueItem(item.family, botOut)); lqis.add(new LoadQueueItem(item.family, topOut)); - + + // If the current item is already the result of previous splits, + // we don't need it anymore. Clean up to save space. + try { + tmpDir = item.hfilePath.getParent(); + if (tmpDir.getName().equals(TMP_DIR)) { + fs.delete(item.hfilePath, false); + } + } catch (IOException e) { + LOG.warn("Unable to delete temporary split file " + item.hfilePath); + } LOG.info("Successfully split into new HFiles " + botOut + " and " + topOut); return lqis; }