Java Code Examples for org.apache.hadoop.hdfs.server.datanode.metrics.FSDatasetMBean

The following examples show how to use org.apache.hadoop.hdfs.server.datanode.metrics.FSDatasetMBean. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: RDFS   Source File: SimulatedFSDataset.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<storageid>"
 *  We use storage id for MBean name since a minicluster within a single
 * Java VM may have multiple Simulated Datanodes.
 */
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;

  try {
    bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeanUtil.registerMBean("DataNode",
        "FSDatasetState-" + storageId, bean);
  } catch (NotCompliantMBeanException e) {
    e.printStackTrace();
  }
 
  DataNode.LOG.info("Registered FSDatasetStatusMBean");
}
 
Example 2
Source Project: RDFS   Source File: FSDataset.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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);
    versionBeanName = VersionInfo.registerJMX("DataNode");
  } catch (NotCompliantMBeanException e) {
    e.printStackTrace();
  }

  DataNode.LOG.info("Registered FSDatasetStatusMBean");
}
 
Example 3
Source Project: hadoop-gpu   Source File: SimulatedFSDataset.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Register the FSDataset MBean using the name
 *        "hadoop:service=DataNode,name=FSDatasetState-<storageid>"
 *  We use storage id for MBean name since a minicluster within a single
 * Java VM may have multiple Simulated Datanodes.
 */
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;

  try {
    bean = new StandardMBean(this,FSDatasetMBean.class);
    mbeanName = MBeanUtil.registerMBean("DataNode",
        "FSDatasetState-" + storageId, bean);
  } catch (NotCompliantMBeanException e) {
    e.printStackTrace();
  }
 
  DataNode.LOG.info("Registered FSDatasetStatusMBean");
}
 
Example 4
Source Project: hadoop-gpu   Source File: FSDataset.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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");
}
 
Example 5
Source Project: hadoop   Source File: FsDatasetImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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");
}
 
Example 6
Source Project: big-c   Source File: FsDatasetImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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");
}