Java 类org.apache.hadoop.hdfs.server.datanode.metrics.FSDatasetMBean 实例源码

项目:hadoop    文件:FsDatasetImpl.java   
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
 */
void registerMBean(final String datanodeUuid) {
  // 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.
  try {
    StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeans.register("DataNode", "FSDatasetState-" + datanodeUuid, bean);
  } catch (NotCompliantMBeanException e) {
    LOG.warn("Error registering FSDatasetState MBean", e);
  }
  LOG.info("Registered FSDatasetState MBean");
}
项目:aliyun-oss-hadoop-fs    文件:FsDatasetImpl.java   
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
 */
void registerMBean(final String datanodeUuid) {
  // 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.
  try {
    StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeans.register("DataNode", "FSDatasetState-" + datanodeUuid, bean);
  } catch (NotCompliantMBeanException e) {
    LOG.warn("Error registering FSDatasetState MBean", e);
  }
  LOG.info("Registered FSDatasetState MBean");
}
项目:aliyun-oss-hadoop-fs    文件:DataNodeMetricHelper.java   
/**
 * Get metrics helper provides Helper function for
 * metrics2 interface to act as a Metric source
 *
 * @param collector Metrics Collector that is passed in
 * @param beanClass The Class that currently impliments the metric functions
 * @param context A string that idenitifies the context
 *
 * @throws IOException
 */
public static void getMetrics(MetricsCollector collector,
                              FSDatasetMBean beanClass, String context)
  throws IOException {

  if (beanClass == null) {
    throw new IOException("beanClass cannot be null");
  }

  String className = beanClass.getClass().getName();

  collector.addRecord(className)
    .setContext(context)
    .addGauge(Interns.info("Capacity", "Total storage capacity"),
      beanClass.getCapacity())
    .addGauge(Interns.info("DfsUsed", "Total bytes used by dfs datanode"),
      beanClass.getDfsUsed())
    .addGauge(Interns.info("Remaining", "Total bytes of free storage"),
      beanClass.getRemaining())
    .add(new MetricsTag(Interns.info("StorageInfo", "Storage ID"),
      beanClass.getStorageInfo()))
    .addGauge(Interns.info("NumFailedVolumes", "Number of failed Volumes" +
      " in the data Node"), beanClass.getNumFailedVolumes())
    .addGauge(Interns.info("LastVolumeFailureDate", "Last Volume failure in" +
      " milliseconds from epoch"), beanClass.getLastVolumeFailureDate())
    .addGauge(Interns.info("EstimatedCapacityLostTotal", "Total capacity lost"
      + " due to volume failure"), beanClass.getEstimatedCapacityLostTotal())
    .addGauge(Interns.info("CacheUsed", "Datanode cache used in bytes"),
      beanClass.getCacheUsed())
    .addGauge(Interns.info("CacheCapacity", "Datanode cache capacity"),
      beanClass.getCacheCapacity())
    .addGauge(Interns.info("NumBlocksCached", "Datanode number" +
      " of blocks cached"), beanClass.getNumBlocksCached())
    .addGauge(Interns.info("NumBlocksFailedToCache", "Datanode number of " +
      "blocks failed to cache"), beanClass.getNumBlocksFailedToCache())
    .addGauge(Interns.info("NumBlocksFailedToUnCache", "Datanode number of" +
        " blocks failed in cache eviction"),
      beanClass.getNumBlocksFailedToUncache());

}
项目:big-c    文件:FsDatasetImpl.java   
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
 */
void registerMBean(final String datanodeUuid) {
  // 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.
  try {
    StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeans.register("DataNode", "FSDatasetState-" + datanodeUuid, bean);
  } catch (NotCompliantMBeanException e) {
    LOG.warn("Error registering FSDatasetState MBean", e);
  }
  LOG.info("Registered FSDatasetState MBean");
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FsDatasetImpl.java   
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
 */
void registerMBean(final String datanodeUuid) {
  // 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.
  try {
    StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeans.register("DataNode", "FSDatasetState-" + datanodeUuid, bean);
  } catch (NotCompliantMBeanException e) {
    LOG.warn("Error registering FSDatasetState MBean", e);
  }
  LOG.info("Registered FSDatasetState MBean");
}
项目:FlexMap    文件:FsDatasetImpl.java   
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
 */
void registerMBean(final String datanodeUuid) {
  // 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.
  try {
    StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeans.register("DataNode", "FSDatasetState-" + datanodeUuid, bean);
  } catch (NotCompliantMBeanException e) {
    LOG.warn("Error registering FSDatasetState MBean", e);
  }
  LOG.info("Registered FSDatasetState MBean");
}
项目:hadoop-on-lustre2    文件:FsDatasetImpl.java   
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
 */
void registerMBean(final String datanodeUuid) {
  // 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.
  try {
    StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeans.register("DataNode", "FSDatasetState-" + datanodeUuid, bean);
  } catch (NotCompliantMBeanException e) {
    LOG.warn("Error registering FSDatasetState MBean", e);
  }
  LOG.info("Registered FSDatasetState MBean");
}