In the HMaster, there is this:

  private void startServiceThreads() {
    // Do after main thread name has been set
    this.metrics = new MasterMetrics();

which calls the MBeanUtil registration (a hadoop utility) which
registers the MasterMetrics which contains all those metrics you are
interested in.  The HMaster constructor will block until the ZK master
node is available.

does this help?

On Thu, Apr 8, 2010 at 11:48 PM, Paul Smith <psm...@aconex.com> wrote:
> Hi gents, related to the Parfait/PCP discussion recently, I'm hitting a 
> problem that I need your help.
>
> Right now a MetricContext implementation is initialised fairly early within 
> the Hbase/Hadoop lifecycle, and is given a chance to initialise which is 
> good.  However what I've noticed is that other parts of the JMX namespace do 
> not appear for, say, the HMaster process until quite late; well after the 
> MetricContext impl is initialized.
>
> My PCPContext implementation I'm working on is going to want to 'sniff' and 
> identify what type of process it is, mainly so as to be able to route metrics 
> to a locally named file identifying it as metrics from that service.  There 
> is no way that I can spot at the moment where a MetricContext can be told 
> that the process own initialization is complete.  I'd like to have this so 
> that a proper exploration of the JMX namespace can happen to export things 
> like JVM metrics etc.
>
> Can someone point me in the right direction here?  For example, once the 
> HMaster is started up, there exists a JMX bean with the name pattern 
> 'hadoop:service=Master' namespace.  Unfortunately the RegionServer process 
> has a pattern that is 'hadoop:service=HBase', but that ALSO appears in the 
> Master process (and early) so right now my naive topology sniffing is seeing 
> this and thinking the Master is a RegionServer.
>
> If I can delay my PCPContext initialization (even by just waiting until I can 
> detect something has occurred) until the rest of the HBase process is 
> properly up and running, then I think I'm off and racing.
>
> Any hooks or ideas on this would be appreciated.
>
> Paul

Reply via email to