Index: src/java/org/apache/hadoop/hbase/HStore.java =================================================================== --- src/java/org/apache/hadoop/hbase/HStore.java (revision 673092) +++ src/java/org/apache/hadoop/hbase/HStore.java Tue Jul 15 23:28:17 CST 2008 @@ -1481,12 +1477,50 @@ filesToCompact.size() < compactionThreshold) { return false; } + { + //by L.N. preparing all store file size for incremental compacting selection + int countOfFiles = filesToCompact.size(); + long totalSize = 0; + long[] fileSizes = new long[countOfFiles]; + long skipped = 0; + int point = 0; + for (int i=0; i( + filesToCompact.subList(point, countOfFiles)); + } + LOG.info("compaction size: " + totalSize + ", skipped " + point + + ", " +skipped); + } - Collections.reverse(filesToCompact); + Collections.reverse(filesToCompact); if (!fs.exists(compactionDir) && !fs.mkdirs(compactionDir)) { LOG.warn("Mkdir on " + compactionDir.toString() + " failed"); return false; } - // Step through them, writing to the brand-new MapFile HStoreFile compactedOutputFile = new HStoreFile(conf, fs, this.compactionDir, info.getEncodedName(), family.getFamilyName(),