本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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");
}
示例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);
}
示例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");
}
示例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);
}
示例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;
}
示例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");
}
示例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;
}