gpt4 book ai didi

org.apache.pinot.common.utils.ZkStarter类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 03:55:31 34 4
gpt4 key购买 nike

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

ZkStarter介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-pinot

/**
 * Starts an empty local Zk instance on the default port
 */
public static ZookeeperInstance startLocalZkServer() {
 return startLocalZkServer(DEFAULT_ZK_TEST_PORT);
}

代码示例来源:origin: apache/incubator-pinot

public boolean stop() {
 ZkStarter.stopLocalZkServer(_zookeeperInstance);
 return true;
}

代码示例来源:origin: apache/incubator-pinot

/**
 * Starts a local Zk instance with a generated empty data directory
 * @param port The port to listen on
 */
public static ZookeeperInstance startLocalZkServer(final int port) {
 return startLocalZkServer(port,
   org.apache.commons.io.FileUtils.getTempDirectoryPath() + File.separator + "test-" + System.currentTimeMillis());
}

代码示例来源:origin: apache/incubator-pinot

/**
 * Stops a local Zk instance, deleting its data directory
 */
public static void stopLocalZkServer(final ZookeeperInstance instance) {
 stopLocalZkServer(instance, true);
}

代码示例来源:origin: apache/incubator-pinot

protected void startZk(int port) {
 _zookeeperInstance = ZkStarter.startLocalZkServer(port);
}

代码示例来源:origin: apache/incubator-pinot

protected void stopZk() {
 try {
  ZkStarter.stopLocalZkServer(_zookeeperInstance);
 } catch (Exception e) {
  // Swallow exceptions
 }
}

代码示例来源:origin: apache/incubator-pinot

protected void startZk() {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
}

代码示例来源:origin: apache/incubator-pinot

@Override
 public void run() {
  try {
   printStatus(Color.GREEN, "***** Shutting down hybrid quick start *****");
   stream.shutdown();
   Thread.sleep(2000);
   runner.stop();
   KafkaStarterUtils.stopServer(_kafkaStarter);
   ZkStarter.stopLocalZkServer(_zookeeperInstance);
   FileUtils.deleteDirectory(_offlineQuickStartDataDir);
   FileUtils.deleteDirectory(_realtimeQuickStartDataDir);
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
});

代码示例来源:origin: apache/incubator-pinot

@Override
public boolean execute()
  throws IOException {
 LOGGER.info("Executing command: " + toString());
 _tmpdir = createAutoDeleteTempDir();
 File logdir = new File(_tmpdir + File.separator + "translog");
 File datadir = new File(_tmpdir + File.separator + "snapshot");
 IDefaultNameSpace _defaultNameSpace = new IDefaultNameSpace() {
  @Override
  public void createDefaultNameSpace(org.I0Itec.zkclient.ZkClient zkClient) {
   // init any zk paths if needed
  }
 };
 _zookeeperInstance = ZkStarter.startLocalZkServer(_zkPort, datadir.getAbsolutePath());
 LOGGER.info("Start zookeeper at localhost:" + _zkPort + " in thread " + Thread.currentThread().getName());
 savePID(System.getProperty("java.io.tmpdir") + File.separator + ".zooKeeper.pid");
 return true;
}

代码示例来源:origin: apache/incubator-pinot

@Override
 public void run() {
  try {
   printStatus(Color.GREEN, "***** Shutting down realtime quick start *****");
   meetupRSVPProvider.stopPublishing();
   runner.stop();
   KafkaStarterUtils.stopServer(kafkaStarter);
   ZkStarter.stopLocalZkServer(zookeeperInstance);
   FileUtils.deleteDirectory(quickStartDataDir);
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
});

代码示例来源:origin: apache/incubator-pinot

private void startKafka() {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
 _kafkaStarter = KafkaStarterUtils
   .startServer(KafkaStarterUtils.DEFAULT_KAFKA_PORT, KafkaStarterUtils.DEFAULT_BROKER_ID,
     KafkaStarterUtils.DEFAULT_ZK_STR, KafkaStarterUtils.getDefaultKafkaConfiguration());
 KafkaStarterUtils.createTopic("airlineStatsEvents", KafkaStarterUtils.DEFAULT_ZK_STR, 10);
}

代码示例来源:origin: apache/incubator-pinot

@AfterClass
 public void tearDown() {
  _pinotHelixResourceManager.stop();
  _zkClient.close();
  ZkStarter.stopLocalZkServer(_zookeeperInstance);
 }
}

代码示例来源:origin: apache/incubator-pinot

@BeforeTest
public void beforeTest() {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
 String helixClusterName = "TestTableQueryQuotaManagerService";
 _helixManager = initHelixManager(helixClusterName);
 _testPropertyStore = _helixManager.getHelixPropertyStore();
 _tableQueryQuotaManager = new TableQueryQuotaManager(_helixManager);
}

代码示例来源:origin: apache/incubator-pinot

@AfterClass
public void shutDown() {
 _pinotHelixResourceManager.stop();
 _zkClient.close();
 ZkStarter.stopLocalZkServer(_zookeeperInstance);
}

代码示例来源:origin: apache/incubator-pinot

final ZkStarter.ZookeeperInstance zookeeperInstance = ZkStarter.startLocalZkServer();
final KafkaServerStartable kafkaStarter = KafkaStarterUtils
  .startServer(KafkaStarterUtils.DEFAULT_KAFKA_PORT, KafkaStarterUtils.DEFAULT_BROKER_ID,

代码示例来源:origin: apache/incubator-pinot

@AfterTest
public void afterTest() {
 if (_helixManager instanceof FakeHelixManager) {
  ((FakeHelixManager) _helixManager).closeZkClient();
 }
 ZkStarter.stopLocalZkServer(_zookeeperInstance);
}

代码示例来源:origin: apache/incubator-pinot

@BeforeClass
public void setUp()
  throws Exception {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
 _zkClient = new ZkClient(ZkStarter.DEFAULT_ZK_STR);
 final String instanceId = "localhost_helixController";
 _pinotHelixResourceManager =
   new PinotHelixResourceManager(ZkStarter.DEFAULT_ZK_STR, HELIX_CLUSTER_NAME, instanceId, null, 10000L, true,
     /*isUpdateStateModel=*/ false, true);
 _pinotHelixResourceManager.start();
 _helixAdmin = _pinotHelixResourceManager.getHelixAdmin();
 ControllerRequestBuilderUtil
   .addFakeDataInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZkStarter.DEFAULT_ZK_STR, 1, true);
 ControllerRequestBuilderUtil
   .addFakeBrokerInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZkStarter.DEFAULT_ZK_STR, 1, true);
 Assert.assertEquals(_helixAdmin.getInstancesInClusterWithTag(HELIX_CLUSTER_NAME, "DefaultTenant_BROKER").size(), 1);
 Assert
   .assertEquals(_helixAdmin.getInstancesInClusterWithTag(HELIX_CLUSTER_NAME, "DefaultTenant_OFFLINE").size(), 1);
 Assert
   .assertEquals(_helixAdmin.getInstancesInClusterWithTag(HELIX_CLUSTER_NAME, "DefaultTenant_REALTIME").size(), 1);
 // Adding table
 TableConfig tableConfig =
   new TableConfig.Builder(CommonConstants.Helix.TableType.OFFLINE).setTableName(TABLE_NAME).build();
 _pinotHelixResourceManager.addTable(tableConfig);
}

代码示例来源:origin: apache/incubator-pinot

@AfterTest
public void afterTest() {
 _zkClient.close();
 ZkStarter.stopLocalZkServer(_zookeeperInstance);
}

代码示例来源:origin: apache/incubator-pinot

@BeforeTest
public void setup()
  throws Exception {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
 _zkClient = new ZkClient(ZK_SERVER);
 final String zkPath = "/" + HELIX_CLUSTER_NAME;

代码示例来源:origin: apache/incubator-pinot

@AfterTest
public void tearDown() {
 _pinotResourceManager.stop();
 _zkClient.close();
 ZkStarter.stopLocalZkServer(_zookeeperInstance);
}

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