• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JvmPauseMonitor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: preRegistrationInitialization

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
/**
 * All initialization needed before we go register with Master.
 *
 * @throws IOException
 * @throws InterruptedException
 */
private void preRegistrationInitialization() {
  try {
    setupClusterConnection();

    // Health checker thread.
    if (isHealthCheckerConfigured()) {
      int sleepTime = this.conf
          .getInt(HConstants.HEALTH_CHORE_WAKE_FREQ, HConstants.DEFAULT_THREAD_WAKE_FREQUENCY);
      healthCheckChore = new HealthCheckChore(sleepTime, this, getConfiguration());
    }
    this.pauseMonitor = new JvmPauseMonitor(conf);
    pauseMonitor.start();

    initializeZooKeeper();
    if (!isStopped() && !isAborted()) {
      initializeThreads();
    }
  } catch (Throwable t) {
    // Call stop if error or process will stick around for ever since server
    // puts up non-daemon threads.
    this.rpcServices.stop();
    abort("Initialization of RS failed.  Hence aborting RS.", t);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:31,代码来源:HRegionServer.java


示例2: preRegistrationInitialization

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
/**
 * All initialization needed before we go register with Master.
 *
 * @throws IOException
 * @throws InterruptedException
 */
private void preRegistrationInitialization() {
    try {
        setupClusterConnection();//1.初始化HConnection 2.初始化MetaTableLocator

        // Health checker thread.
        if (isHealthCheckerConfigured()) {//健康检测线程
            int sleepTime = this.conf.getInt(HConstants.HEALTH_CHORE_WAKE_FREQ,
                    HConstants.DEFAULT_THREAD_WAKE_FREQUENCY);
            healthCheckChore = new HealthCheckChore(sleepTime, this, getConfiguration());
        }
        this.pauseMonitor = new JvmPauseMonitor(conf);//JVM 暂停检测
        pauseMonitor.start();

        initializeZooKeeper();//zookeeper相关的初始化
        if (!isStopped() && !isAborted()) {
            initializeThreads();
        }
    } catch (Throwable t) {
        // Call stop if error or process will stick around for ever since server
        // puts up non-daemon threads.
        this.rpcServices.stop();
        abort("Initialization of RS failed.  Hence aborting RS.", t);
    }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:31,代码来源:HRegionServer.java


示例3: testPauseMonitor

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
@Test
public void testPauseMonitor() {
  Configuration conf = new Configuration();
  conf.setLong(JvmPauseMonitor.INFO_THRESHOLD_KEY, 1000L);
  conf.setLong(JvmPauseMonitor.WARN_THRESHOLD_KEY, 10000L);
  JvmPauseMonitor monitor = new JvmPauseMonitor(conf, serverSource);
  monitor.updateMetrics(1500, false);
  HELPER.assertCounter("pauseInfoThresholdExceeded", 1, serverSource);
  HELPER.assertCounter("pauseWarnThresholdExceeded", 0, serverSource);
  HELPER.assertCounter("pauseTimeWithoutGc_num_ops", 1, serverSource);
  HELPER.assertCounter("pauseTimeWithGc_num_ops", 0, serverSource);
  monitor.updateMetrics(15000, true);
  HELPER.assertCounter("pauseInfoThresholdExceeded", 1, serverSource);
  HELPER.assertCounter("pauseWarnThresholdExceeded", 1, serverSource);
  HELPER.assertCounter("pauseTimeWithoutGc_num_ops", 1, serverSource);
  HELPER.assertCounter("pauseTimeWithGc_num_ops", 1, serverSource);
}
 
开发者ID:apache,项目名称:hbase,代码行数:18,代码来源:TestMetricsRegionServer.java


示例4: RESTServlet

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
/**
 * Constructor with existing configuration
 * @param conf existing configuration
 * @param userProvider the login user provider
 * @throws IOException
 */
RESTServlet(final Configuration conf,
    final UserProvider userProvider) throws IOException {
  this.realUser = userProvider.getCurrent().getUGI();
  this.conf = conf;
  registerCustomFilter(conf);

  int cleanInterval = conf.getInt(CLEANUP_INTERVAL, 10 * 1000);
  int maxIdleTime = conf.getInt(MAX_IDLETIME, 10 * 60 * 1000);
  connectionCache = new ConnectionCache(
    conf, userProvider, cleanInterval, maxIdleTime);
  if (supportsProxyuser()) {
    ProxyUsers.refreshSuperUserGroupsConfiguration(conf);
  }

  metrics = new MetricsREST();

  pauseMonitor = new JvmPauseMonitor(conf, metrics.getSource());
  pauseMonitor.start();
}
 
开发者ID:apache,项目名称:hbase,代码行数:26,代码来源:RESTServlet.java


示例5: initializeThreads

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
private void initializeThreads() throws IOException {
  // Cache flushing thread.
  this.cacheFlusher = new MemStoreFlusher(conf, this);

  // Compaction thread
  this.compactSplitThread = new CompactSplitThread(this);

  // Background thread to check for compactions; needed if region has not gotten updates
  // in a while. It will take care of not checking too frequently on store-by-store basis.
  this.compactionChecker = new CompactionChecker(this, this.threadWakeFrequency, this);
  this.periodicFlusher = new PeriodicMemstoreFlusher(this.threadWakeFrequency, this);
  // Health checker thread.
  int sleepTime = this.conf.getInt(HConstants.HEALTH_CHORE_WAKE_FREQ,
    HConstants.DEFAULT_THREAD_WAKE_FREQUENCY);
  if (isHealthCheckerConfigured()) {
    healthCheckChore = new HealthCheckChore(sleepTime, this, getConfiguration());
  }

  this.leases = new Leases(this.threadWakeFrequency);

  // Create the thread to clean the moved regions list
  movedRegionsCleaner = MovedRegionsCleaner.createAndStart(this);

  if (this.nonceManager != null) {
    // Create the chore that cleans up nonces.
    nonceManagerChore = this.nonceManager.createCleanupChore(this);
  }

  // Setup RPC client for master communication
  rpcClient = new RpcClient(conf, clusterId, new InetSocketAddress(
      this.isa.getAddress(), 0));
  this.pauseMonitor = new JvmPauseMonitor(conf);
  pauseMonitor.start();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:35,代码来源:HRegionServer.java


示例6: initializeThreads

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
private void initializeThreads() throws IOException {
  // Cache flushing thread.
  this.cacheFlusher = new MemStoreFlusher(conf, this);

  // Compaction thread
  this.compactSplitThread = new CompactSplitThread(this);

  // Background thread to check for compactions; needed if region has not gotten updates
  // in a while. It will take care of not checking too frequently on store-by-store basis.
  this.compactionChecker = new CompactionChecker(this, this.threadWakeFrequency, this);
  this.periodicFlusher = new PeriodicMemstoreFlusher(this.threadWakeFrequency, this);
  // Health checker thread.
  int sleepTime = this.conf.getInt(HConstants.HEALTH_CHORE_WAKE_FREQ,
    HConstants.DEFAULT_THREAD_WAKE_FREQUENCY);
  if (isHealthCheckerConfigured()) {
    healthCheckChore = new HealthCheckChore(sleepTime, this, getConfiguration());
  }

  this.leases = new Leases(this.threadWakeFrequency);

  // Create the thread to clean the moved regions list
  movedRegionsCleaner = MovedRegionsCleaner.createAndStart(this);

  if (this.nonceManager != null) {
    // Create the chore that cleans up nonces.
    nonceManagerChore = this.nonceManager.createCleanupChore(this);
  }

  // Setup RPC client for master communication
  rpcClient = new RpcClient(conf, clusterId, new InetSocketAddress(
    rpcServices.isa.getAddress(), 0));
  this.pauseMonitor = new JvmPauseMonitor(conf);
  pauseMonitor.start();
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:35,代码来源:HRegionServer.java


示例7: initializeThreads

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
private void initializeThreads() throws IOException {
  // Cache flushing thread.
  this.cacheFlusher = new MemStoreFlusher(conf, this);

  // Compaction thread
  this.compactSplitThread = new CompactSplitThread(this);

  // Background thread to check for compactions; needed if region has not gotten updates
  // in a while. It will take care of not checking too frequently on store-by-store basis.
  this.compactionChecker = new CompactionChecker(this, this.threadWakeFrequency, this);
  this.periodicFlusher = new PeriodicMemstoreFlusher(this.threadWakeFrequency, this);
  // Health checker thread.
  int sleepTime = this.conf.getInt(HConstants.HEALTH_CHORE_WAKE_FREQ,
    HConstants.DEFAULT_THREAD_WAKE_FREQUENCY);
  if (isHealthCheckerConfigured()) {
    healthCheckChore = new HealthCheckChore(sleepTime, this, getConfiguration());
  }

  this.leases = new Leases(this.threadWakeFrequency);

  // Create the thread to clean the moved regions list
  movedRegionsCleaner = MovedRegionsCleaner.createAndStart(this);

  // Setup RPC client for master communication
  rpcClient = new RpcClient(conf, clusterId, new InetSocketAddress(
      this.isa.getAddress(), 0));
  this.pauseMonitor = new JvmPauseMonitor(conf);
  pauseMonitor.start();
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:30,代码来源:HRegionServer.java


示例8: ThriftServerRunner

import org.apache.hadoop.hbase.util.JvmPauseMonitor; //导入依赖的package包/类
public ThriftServerRunner(Configuration conf) throws IOException {
  UserProvider userProvider = UserProvider.instantiate(conf);
  // login the server principal (if using secure Hadoop)
  securityEnabled = userProvider.isHadoopSecurityEnabled()
    && userProvider.isHBaseSecurityEnabled();
  if (securityEnabled) {
    host = Strings.domainNamePointerToHostName(DNS.getDefaultHost(
      conf.get("hbase.thrift.dns.interface", "default"),
      conf.get("hbase.thrift.dns.nameserver", "default")));
    userProvider.login("hbase.thrift.keytab.file",
      "hbase.thrift.kerberos.principal", host);
  }
  this.conf = HBaseConfiguration.create(conf);
  this.listenPort = conf.getInt(PORT_CONF_KEY, DEFAULT_LISTEN_PORT);
  this.metrics = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.ONE);
  this.pauseMonitor = new JvmPauseMonitor(conf, this.metrics.getSource());
  this.hbaseHandler = new HBaseHandler(conf, userProvider);
  this.hbaseHandler.initMetrics(metrics);
  this.handler = HbaseHandlerMetricsProxy.newInstance(
    hbaseHandler, metrics, conf);
  this.realUser = userProvider.getCurrent().getUGI();
  String strQop = conf.get(THRIFT_QOP_KEY);
  if (strQop != null) {
    this.qop = SaslUtil.getQop(strQop);
  }
  doAsEnabled = conf.getBoolean(THRIFT_SUPPORT_PROXYUSER, false);
  if (doAsEnabled) {
    if (!conf.getBoolean(USE_HTTP_CONF_KEY, false)) {
      LOG.warn("Fail to enable the doAs feature. hbase.regionserver.thrift.http is not " +
              "configured ");
    }
  }
  if (qop != null) {
    if (qop != QualityOfProtection.AUTHENTICATION &&
        qop != QualityOfProtection.INTEGRITY &&
        qop != QualityOfProtection.PRIVACY) {
      throw new IOException(String.format("Invalide %s: It must be one of %s, %s, or %s.",
                            THRIFT_QOP_KEY,
                            QualityOfProtection.AUTHENTICATION.name(),
                            QualityOfProtection.INTEGRITY.name(),
                            QualityOfProtection.PRIVACY.name()));
    }
    checkHttpSecurity(qop, conf);
    if (!securityEnabled) {
      throw new IOException("Thrift server must"
        + " run in secure mode to support authentication");
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:50,代码来源:ThriftServerRunner.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Resources类代码示例发布时间:2022-05-22
下一篇:
Java TextInlineImageSpan类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap