gpt4 book ai didi

org.apache.helix.monitoring.mbeans.ZkClientMonitor.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:47:28 25 4
gpt4 key购买 nike

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

ZkClientMonitor.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/helix

protected ZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout,
  PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey,
  String monitorInstanceName, boolean monitorRootPathOnly) {
 if (zkConnection == null) {
  throw new NullPointerException("Zookeeper connection is null!");
 }
 _connection = zkConnection;
 _pathBasedZkSerializer = zkSerializer;
 _operationRetryTimeoutInMillis = operationRetryTimeout;
 connect(connectionTimeout, this);
 // initiate monitor
 try {
  if (monitorKey != null && !monitorKey.isEmpty() && monitorType != null && !monitorType
    .isEmpty()) {
   _monitor =
     new ZkClientMonitor(monitorType, monitorKey, monitorInstanceName, monitorRootPathOnly,
       _eventThread);
   _monitor.register();
  } else {
   LOG.info("ZkClient monitor key or type is not provided. Skip monitoring.");
  }
 } catch (JMException e) {
  LOG.error("Error in creating ZkClientMonitor", e);
 }
}

代码示例来源:origin: org.apache.helix/helix-core

protected ZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout,
  PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey,
  String monitorInstanceName, boolean monitorRootPathOnly) {
 if (zkConnection == null) {
  throw new NullPointerException("Zookeeper connection is null!");
 }
 _connection = zkConnection;
 _pathBasedZkSerializer = zkSerializer;
 _operationRetryTimeoutInMillis = operationRetryTimeout;
 connect(connectionTimeout, this);
 // initiate monitor
 try {
  if (monitorKey != null && !monitorKey.isEmpty() && monitorType != null && !monitorType
    .isEmpty()) {
   _monitor =
     new ZkClientMonitor(monitorType, monitorKey, monitorInstanceName, monitorRootPathOnly);
   _monitor.setZkEventThread(_eventThread);
  } else {
   LOG.info("ZkClient monitor key or type is not provided. Skip monitoring.");
  }
 } catch (JMException e) {
  LOG.error("Error in creating ZkClientMonitor", e);
 }
}

代码示例来源:origin: apache/helix

@Test
public void testMBeanRegisteration() throws JMException {
 final String TEST_TAG_1 = "test_tag_1";
 final String TEST_KEY_1 = "test_key_1";
 ZkClientMonitor monitor = new ZkClientMonitor(TEST_TAG_1, TEST_KEY_1, null, true, null);
 Assert.assertFalse(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null)));
 monitor.register();
 Assert.assertTrue(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null)));
 // no per-path monitor items created since "monitorRootPathOnly" = true
 Assert.assertFalse(_beanServer.isRegistered(
   buildPathMonitorObjectName(TEST_TAG_1, TEST_KEY_1, null,
     ZkClientPathMonitor.PredefinedPath.IdealStates.name())));
 ZkClientMonitor monitorDuplicate = new ZkClientMonitor(TEST_TAG_1, TEST_KEY_1, null, true, null);
 monitorDuplicate.register();
 Assert.assertTrue(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null, 1)));
 monitor.unregister();
 monitorDuplicate.unregister();
 Assert.assertFalse(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null)));
 Assert.assertFalse(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null, 1)));
}

代码示例来源:origin: apache/helix

final String TEST_INSTANCE = "test_instance_3";
ZkClientMonitor monitor = new ZkClientMonitor(TEST_TAG, TEST_KEY, TEST_INSTANCE, false, null);
monitor.register();

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com