Hi,
I would like to programmatically major compact a table's regions, but I
would like to check if major compaction ended (i.e.: compaction queue
size goes to zero).
I tried to do it through the following code but it failed throwing a
null pointer exc.
HBaseAdmin admin = new HBaseAdmin(config);
admin.majorCompact("myTable");
admin.close();
HRegionServer hr = new HRegionServer(config);
try {
if ( ! (hr.getMetrics().compactionQueueSize.get()==0) ){
System.out.println(
hr.getMetrics().compactionQueueSize.get() );
Thread.sleep(1000);
}
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
Does anyone know how to correctly check this?
Thanks in advance,
IP