コード例 #1
0
 public DataNodeActivityMBean(final MetricsRegistry mr, final String storageId) {
   super(mr, "Activity statistics at the DataNode");
   String storageName;
   if (storageId.equals("")) { // Temp fix for the uninitialized storage
     storageName = "UndefinedStorageId" + rand.nextInt();
   } else {
     storageName = storageId;
   }
   mbeanName = MBeanUtil.registerMBean("DataNode", "DataNodeActivity-" + storageName, this);
 }
コード例 #2
0
  public void shutdown() {
    if (mbeanName != null) MBeanUtil.unregisterMBean(mbeanName);

    if (volumes != null) {
      for (FSVolume volume : volumes.volumes) {
        if (volume != null) {
          volume.dfsUsage.shutdown();
        }
      }
    }
  }
コード例 #3
0
  /**
   * Register the FSDataset MBean using the name
   * "hadoop:service=DataNode,name=FSDatasetState-<storageid>"
   */
  void registerMBean(final String storageId) {
    // We wrap to bypass standard mbean naming convetion.
    // This wraping can be removed in java 6 as it is more flexible in
    // package naming for mbeans and their impl.
    StandardMBean bean;
    String storageName;
    if (storageId == null || storageId.equals("")) { // Temp fix for the
      // uninitialized storage
      storageName = "UndefinedStorageId" + rand.nextInt();
    } else {
      storageName = storageId;
    }
    try {
      bean = new StandardMBean(this, FSDatasetMBean.class);
      mbeanName = MBeanUtil.registerMBean("DataNode", "FSDatasetState-" + storageName, bean);
    } catch (NotCompliantMBeanException e) {
      e.printStackTrace();
    }

    DataNode.LOG.info("Registered FSDatasetStatusMBean");
  }
コード例 #4
0
 public void shutdown() {
   if (mbeanName != null) MBeanUtil.unregisterMBean(mbeanName);
 }