On Fri, Jul 23, 2010 at 2:40 PM, Ted Yu <[email protected]> wrote: > Hi, > I am looking for HBase API for getting the following information: > 1. is Meta table available - I found > RegionServerOperation.metaTableAvailable() but it is protected
Thats not what you think it is Ted. To see if meta is available, do a Scan on it every so often. You can open a Scanner -- via thrift if you are using perl, or write a bit of jruby and have it return a non-zero exit code on fail -- on it as you would any other. If the scan does not complete in some time then its not deployed. > 2. I found ProcessRegionStatusChange.metaRegionAvailable() which is also > protected Yeah, this is stuff internal to the servers; it won't get you what you want. > 3. cluster statistics: the total number of tables, the total space consumed > by all the tables > Total number of tables is something you'd have to do yourself I'd say. Given the above meta scan, look at the row names and when their prefix changes -- their prefix is the table name the region belongs too, increment your table count. To see how much space is being used by hbase, thats ./bin/hadoop fs -dus /HBASE.ROOTDIR parsing whatever it returns. St.Ack > The goal is to call the above APIs from Perl library our Ops has developed > to facilitate cluster management. > > Thanks >
