hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioakim Perros <imper...@gmail.com>
Subject Major compaction queue monitoring
Date Sat, 22 Sep 2012 14:58:09 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message