org.apache.hadoop.metrics2.util.MBeans.getMBeanName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.hadoop.metrics2.util.MBeans.getMBeanName()方法的一些代码示例,展示了MBeans.getMBeanName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MBeans.getMBeanName()方法的具体详情如下:
包路径:org.apache.hadoop.metrics2.util.MBeans
类名称:MBeans
方法名:getMBeanName

MBeans.getMBeanName介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

"JMX bean properties should not be null for "
    + "bean registration.");
ObjectName name = getMBeanName(serviceName, nameName, properties);
if (name != null) {
 try {

代码示例来源:origin: io.fabric8/fabric-hadoop

/**
 * Register the MBean using our standard MBeanName format
 * "hadoop:service=<serviceName>,name=<nameName>"
 * Where the <serviceName> and <nameName> are the supplied parameters
 *
 * @param serviceName
 * @param nameName
 * @param theMbean - the MBean to register
 * @return the named used to register the MBean
 */
static public ObjectName register(String serviceName, String nameName,
                 Object theMbean) {
 final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = getMBeanName(serviceName, nameName);
 try {
  mbs.registerMBean(theMbean, name);
  return name;
 } catch (InstanceAlreadyExistsException ie) {
  LOG.warn(name, ie);
 } catch (Exception e) {
  LOG.warn("Error registering "+ name, e);
 }
 return null;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Register the MBean using our standard MBeanName format
 * "hadoop:service=<serviceName>,name=<nameName>"
 * Where the <serviceName> and <nameName> are the supplied parameters
 *
 * @param serviceName
 * @param nameName
 * @param theMbean - the MBean to register
 * @return the named used to register the MBean
 */
static public ObjectName register(String serviceName, String nameName,
                 Object theMbean) {
 final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = getMBeanName(serviceName, nameName);
 try {
  mbs.registerMBean(theMbean, name);
  LOG.debug("Registered "+ name);
  return name;
 } catch (InstanceAlreadyExistsException iaee) {
  if (LOG.isTraceEnabled()) {
   LOG.trace("Failed to register MBean \""+ name + "\"", iaee);
  } else {
   LOG.warn("Failed to register MBean \""+ name
     + "\": Instance already exists.");
  }
 } catch (Exception e) {
  LOG.warn("Failed to register MBean \""+ name + "\"", e);
 }
 return null;
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Register the MBean using our standard MBeanName format
 * "hadoop:service=<serviceName>,name=<nameName>"
 * Where the <serviceName> and <nameName> are the supplied parameters
 *
 * @param serviceName
 * @param nameName
 * @param theMbean - the MBean to register
 * @return the named used to register the MBean
 */
static public ObjectName register(String serviceName, String nameName,
                 Object theMbean) {
 final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = getMBeanName(serviceName, nameName);
 try {
  mbs.registerMBean(theMbean, name);
  LOG.debug("Registered "+ name);
  return name;
 } catch (InstanceAlreadyExistsException iaee) {
  if (LOG.isTraceEnabled()) {
   LOG.trace("Failed to register MBean \""+ name + "\"", iaee);
  } else {
   LOG.warn("Failed to register MBean \""+ name
     + "\": Instance already exists.");
  }
 } catch (Exception e) {
  LOG.warn("Failed to register MBean \""+ name + "\"", e);
 }
 return null;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Register the MBean using our standard MBeanName format
 * "hadoop:service=<serviceName>,name=<nameName>"
 * Where the <serviceName> and <nameName> are the supplied parameters
 *
 * @param serviceName
 * @param nameName
 * @param theMbean - the MBean to register
 * @return the named used to register the MBean
 */
static public ObjectName register(String serviceName, String nameName,
                 Object theMbean) {
 final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = getMBeanName(serviceName, nameName);
 try {
  mbs.registerMBean(theMbean, name);
  LOG.debug("Registered "+ name);
  return name;
 } catch (InstanceAlreadyExistsException iaee) {
  if (LOG.isTraceEnabled()) {
   LOG.trace("Failed to register MBean \""+ name + "\"", iaee);
  } else {
   LOG.warn("Failed to register MBean \""+ name
     + "\": Instance already exists.");
  }
 } catch (Exception e) {
  LOG.warn("Failed to register MBean \""+ name + "\"", e);
 }
 return null;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Register the MBean using our standard MBeanName format
 * "hadoop:service=<serviceName>,name=<nameName>"
 * Where the <serviceName> and <nameName> are the supplied parameters
 *
 * @param serviceName
 * @param nameName
 * @param theMbean - the MBean to register
 * @return the named used to register the MBean
 */
static public ObjectName register(String serviceName, String nameName,
                 Object theMbean) {
 final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = getMBeanName(serviceName, nameName);
 try {
  mbs.registerMBean(theMbean, name);
  LOG.debug("Registered "+ name);
  return name;
 } catch (InstanceAlreadyExistsException iaee) {
  if (LOG.isTraceEnabled()) {
   LOG.trace("Failed to register MBean \""+ name + "\"", iaee);
  } else {
   LOG.warn("Failed to register MBean \""+ name
     + "\": Instance already exists.");
  }
 } catch (Exception e) {
  LOG.warn("Failed to register MBean \""+ name + "\"", e);
 }
 return null;
}

相关文章