HBASE-5616 Make compaction code standalone
Review Request #4469 - Created March 23, 2012 and updated
Introduces a standalone CompactionTool under src/test. Can call it from its main and have it run compactions on arbitrary storefiles. Compaction code is moved out of Store into a new Compactor class. CompactionTool needs a Store and a mocked up Region to run because compacting uses a StoreScanner (A StoreScanner needs a Store. A Store needs an HRegion). Rather than expect to be passed a coherent HRegion pointer, instead, we fake up one using Mockito. I tried to break out of HRegion a "Region" Interface. This Region Interface would have a basic subset of HRegion functionality and we'd pass this instead of HRegion to SplitTransaction, Store, CompactionRequest, etc. but the change would be massive. Everything expects to be able to do anything on an HRegion. This is work we need to do but I"m not doing it as part of this patch. M src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java Use new CompactionTool instead of asking Store directly to compact. M src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java Formatting. M src/main/java/org/apache/hadoop/hbase/util/FSUtils.java Format the log message so properly spaced. A src/test/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java New compactiontool. Runs all compactions. M src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Make getOpenAndCloseThreadPool static. M src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Move compaction code out to CompactionTool. Refactor so can override ttl and Store home directory so Store is more mockable; can now stand up a Store on its own w/o real HRegion context. M src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java Formatting.
Diff revision 2 (Latest)