当前位置: 首页>>代码示例>>Java>>正文


Java MBeanUtil类代码示例

本文整理汇总了Java中org.apache.hadoop.metrics.util.MBeanUtil的典型用法代码示例。如果您正苦于以下问题:Java MBeanUtil类的具体用法?Java MBeanUtil怎么用?Java MBeanUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MBeanUtil类属于org.apache.hadoop.metrics.util包,在下文中一共展示了MBeanUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
/**
 * Start the TaskTracker, point toward the indicated JobTracker
 */
public static void main(String argv[]) throws Exception {
  StringUtils.startupShutdownMessage(TaskTracker.class, argv, LOG);
  if (argv.length != 0) {
    System.out.println("usage: TaskTracker");
    System.exit(-1);
  }
  try {
    JobConf conf=new JobConf();
    // enable the server to track time spent waiting on locks
    ReflectionUtils.setContentionTracing
      (conf.getBoolean("tasktracker.contention.tracking", false));
    TaskTracker tt = new TaskTracker(conf);
    MBeanUtil.registerMBean("TaskTracker", "TaskTrackerInfo", tt);
    tt.run();
  } catch (Throwable e) {
    LOG.error("Can not start task tracker because "+
              StringUtils.stringifyException(e));
    System.exit(-1);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:24,代码来源:TaskTracker.java

示例2: shutdown

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
public void shutdown() {
  if (spanReceiverHost != null) {
    spanReceiverHost.closeReceivers();
  }
  if (cpHost != null) {
    try {
      cpHost.preShutdown();
    } catch (IOException ioe) {
      LOG.error("Error call master coprocessor preShutdown()", ioe);
    }
  }
  if (mxBean != null) {
    MBeanUtil.unregisterMBean(mxBean);
    mxBean = null;
  }
  if (this.assignmentManager != null) this.assignmentManager.shutdown();
  if (this.serverManager != null) this.serverManager.shutdownCluster();
  try {
    if (this.clusterStatusTracker != null){
      this.clusterStatusTracker.setClusterDown();
    }
  } catch (KeeperException e) {
    LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:26,代码来源:HMaster.java

示例3: shutdown

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void shutdown() {
  if (cpHost != null) {
    try {
      cpHost.preShutdown();
    } catch (IOException ioe) {
      LOG.error("Error call master coprocessor preShutdown()", ioe);
    }
  }
  if (mxBean != null) {
    MBeanUtil.unregisterMBean(mxBean);
    mxBean = null;
  }
  this.assignmentManager.shutdown();
  this.serverManager.shutdownCluster();
  try {
    this.clusterStatusTracker.setClusterDown();
  } catch (KeeperException e) {
    LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);
  }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:23,代码来源:HMaster.java

示例4: shutdown

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
@Override // FSDatasetInterface
public void shutdown() {
  if (mbeanName != null)
    MBeanUtil.unregisterMBean(mbeanName);
  
  if (asyncDiskService != null) {
    asyncDiskService.shutdown();
  }
  
  if(volumes != null) {
    for (FSVolume volume : volumes.volumes) {
      if(volume != null) {
        volume.dfsUsage.shutdown();
      }
    }
  }
}
 
开发者ID:cumulusyebl,项目名称:cumulus,代码行数:18,代码来源:FSDataset.java

示例5: shutdown

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
public void shutdown() throws IOException {
  if (spanReceiverHost != null) { 
    spanReceiverHost.closeReceivers();
  }
  if (cpHost != null) {
    cpHost.preShutdown();
  }
  if (mxBean != null) {
    MBeanUtil.unregisterMBean(mxBean);
    mxBean = null;
  }
  if (this.assignmentManager != null) this.assignmentManager.shutdown();
  if (this.serverManager != null) this.serverManager.shutdownCluster();
  try {
    if (this.clusterStatusTracker != null){
      this.clusterStatusTracker.setClusterDown();
    }
  } catch (KeeperException e) {
    LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:22,代码来源:HMaster.java

示例6: IncrementCoalescer

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public IncrementCoalescer(HBaseHandler hand) {
  this.handler = hand;
  LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
  pool =
      new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE, 50, TimeUnit.MILLISECONDS, queue,
          Threads.newDaemonThreadFactory("IncrementCoalescer"));

  MBeanUtil.registerMBean("thrift", "Thrift", this);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:IncrementCoalescer.java

示例7: HBaseInfoMBean

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
public HBaseInfoMBean(MetricsRegistry registry, String rsName) {
  super(registry, "HBase cluster information");
  // The name seems wrong to me; should include clusterid IMO.
  // That would make it harder to locate and rare we have
  // two clusters up on single machine. St.Ack 20120309
  mbeanName = MBeanUtil.registerMBean("HBase", "Info", this);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:8,代码来源:HBaseInfo.java

示例8: shutdown

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void shutdown() {
  if (cpHost != null) {
    try {
      cpHost.preShutdown();
    } catch (IOException ioe) {
      LOG.error("Error call master coprocessor preShutdown()", ioe);
    }
  }
  if (mxBean != null) {
    MBeanUtil.unregisterMBean(mxBean);
    mxBean = null;
  }
  if (this.assignmentManager != null) this.assignmentManager.shutdown();
  if (this.serverManager != null) this.serverManager.shutdownCluster();

  try {
    if (this.clusterStatusTracker != null){
      this.clusterStatusTracker.setClusterDown();
    }
  } catch (KeeperException e) {
    if (e instanceof KeeperException.SessionExpiredException) {
      LOG.warn("ZK session expired. Retry a new connection...");
      try {
        this.zooKeeper.reconnectAfterExpiration();
        this.clusterStatusTracker.setClusterDown();
      } catch (Exception ex) {
        LOG.error("Retry setClusterDown failed", ex);
      }
    } else {
      LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);
    }
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:36,代码来源:HMaster.java

示例9: registerMBean

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
/**
 * Register bean with platform management server
 */
@SuppressWarnings("deprecation")
void registerMBean() {
  MXBeanImpl mxBeanInfo = MXBeanImpl.init(this);
  MBeanUtil.registerMBean("Master", "Master", mxBeanInfo);
  LOG.info("Registered HMaster MXBean");
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:10,代码来源:HMaster.java

示例10: IncrementCoalescer

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public IncrementCoalescer(HBaseHandler hand) {
  this.handler = hand;
  LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
  pool =
      new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE, 50, TimeUnit.MILLISECONDS, queue,
          new DaemonThreadFactory());

  MBeanUtil.registerMBean("thrift", "Thrift", this);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:11,代码来源:IncrementCoalescer.java

示例11: registerMBean

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
/**
 * Register bean with platform management server
 */
@SuppressWarnings("deprecation")
void registerMBean() {
  MXBeanImpl mxBeanInfo = MXBeanImpl.init(this);
  mxBean = MBeanUtil.registerMBean("RegionServer", "RegionServer", mxBeanInfo);
  LOG.info("Registered RegionServer MXBean");
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:10,代码来源:HRegionServer.java

示例12: HBaseRPCStatistics

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
@SuppressWarnings({"UnusedDeclaration"})
public HBaseRPCStatistics(MetricsRegistry registry,
    String hostName, String port) {
 super(registry, "Metrics for RPC server instance");

  String name = String.format("RPCStatistics-%s",
      (port != null ? port : "unknown"));

  mbeanName = MBeanUtil.registerMBean("HBase", name, this);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:11,代码来源:HBaseRPCStatistics.java

示例13: close

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
void close() throws IOException {
  if (this.infoServer != null) {
    LOG.info("Stopping infoServer");
    try {
      this.infoServer.stop();
    } catch (Exception ex) {
      LOG.warn("Exception shutting down JobTracker", ex);
    }
  }
  if (this.interTrackerServer != null) {
    LOG.info("Stopping interTrackerServer");
    this.interTrackerServer.stop();
  }

  shutdown = true;

  closeThread(this.expireTrackersThread);
  closeThread(this.retireJobsThread);
  closeThread(this.jobUpdaterThread);

  if (taskScheduler != null) {
    taskScheduler.terminate();
  }

  closeThread(this.expireLaunchingTaskThread);
  closeThread(this.completedJobsStoreThread);
  if (versionBeanName != null) {
    MBeanUtil.unregisterMBean(versionBeanName);
  }
  LOG.info("stopped all jobtracker services");
  return;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:33,代码来源:JobTracker.java

示例14: unregisterMBean

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
public void unregisterMBean() {
  if (this.raidnodeMXBeanName != null) {
    MBeanUtil.unregisterMBean(raidnodeMXBeanName);
  }
  if (this.beanName != null) {
    MBeanUtil.unregisterMBean(beanName);
  }
  LOG.info("Unregistered RaidNodeStatusMBean");
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:10,代码来源:RaidNode.java

示例15: getOrCreateMBean

import org.apache.hadoop.metrics.util.MBeanUtil; //导入依赖的package包/类
private synchronized JMXContextMBean getOrCreateMBean(String recordName) {
  JMXContextMBean bean = JMXBeans.get(recordName);
  if (bean == null) {
    bean = new JMXContextMBean(recordName);
    JMXBeans.put(recordName, bean);
    if (isMonitoring()) {
      ObjectName registeredName = 
        MBeanUtil.registerMBean(getContextName(), recordName, bean);
      beanHandles.put(bean, registeredName);
    }
  }
  return bean;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:JMXContext.java


注:本文中的org.apache.hadoop.metrics.util.MBeanUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。