本文整理了Java中org.apache.pinot.common.utils.ZkStarter.startLocalZkServer()
方法的一些代码示例,展示了ZkStarter.startLocalZkServer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkStarter.startLocalZkServer()
方法的具体详情如下:
包路径:org.apache.pinot.common.utils.ZkStarter
类名称:ZkStarter
方法名:startLocalZkServer
[英]Starts an empty local Zk instance on the default port
[中]在默认端口上启动空的本地Zk实例
代码示例来源: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
/**
* 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
protected void startZk(int port) {
_zookeeperInstance = ZkStarter.startLocalZkServer(port);
}
代码示例来源:origin: apache/incubator-pinot
protected void startZk() {
_zookeeperInstance = ZkStarter.startLocalZkServer();
}
代码示例来源: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
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
@BeforeTest
public void beforeTest() {
_zookeeperInstance = ZkStarter.startLocalZkServer();
String helixClusterName = "TestTableQueryQuotaManagerService";
_helixManager = initHelixManager(helixClusterName);
_testPropertyStore = _helixManager.getHelixPropertyStore();
_tableQueryQuotaManager = new TableQueryQuotaManager(_helixManager);
}
代码示例来源: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
@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
@BeforeTest
public void setup()
throws Exception {
_zookeeperInstance = ZkStarter.startLocalZkServer();
_zkClient = new ZkClient(ZK_SERVER);
final String zkPath = "/" + HELIX_CLUSTER_NAME;
代码示例来源:origin: apache/incubator-pinot
@BeforeClass
public void setUp()
throws Exception {
_zookeeperInstance = ZkStarter.startLocalZkServer();
_zkClient = new ZkClient(ZK_STR);
Thread.sleep(1000);
_pinotHelixResourceManager =
new PinotHelixResourceManager(ZK_STR, HELIX_CLUSTER_NAME, CONTROLLER_INSTANCE_NAME, null, 1000L,
true, /*isUpdateStateModel=*/
false, true);
_pinotHelixResourceManager.start();
ControllerRequestBuilderUtil.addFakeDataInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZK_STR, 2, true);
ControllerRequestBuilderUtil.addFakeBrokerInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZK_STR, 2, true);
_offlineTableConfig =
new TableConfig.Builder(CommonConstants.Helix.TableType.OFFLINE).setTableName(TEST_TABLE_NAME).setNumReplicas(2)
.build();
final String instanceId = "localhost_helixController";
_helixManager = HelixSetupUtils.setup(HELIX_CLUSTER_NAME, ZK_STR, instanceId, /*isUpdateStateModel=*/false, true);
_pinotHelixResourceManager.addTable(_offlineTableConfig);
}
代码示例来源:origin: apache/incubator-pinot
@BeforeTest
public void setUp()
throws Exception {
_zookeeperInstance = ZkStarter.startLocalZkServer();
_zkClient = new ZkClient(ZkStarter.DEFAULT_ZK_STR);
final String instanceId = "localhost_helixController";
代码示例来源:origin: apache/incubator-pinot
@BeforeTest
public void beforeTest() {
_zookeeperInstance = ZkStarter.startLocalZkServer();
_zkClient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")),
ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
String helixClusterName = "TestTimeBoundaryService";
_zkClient.deleteRecursive("/" + helixClusterName + "/PROPERTYSTORE");
_zkClient.createPersistent("/" + helixClusterName + "/PROPERTYSTORE", true);
_propertyStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkClient),
"/" + helixClusterName + "/PROPERTYSTORE", null);
}
内容来源于网络,如有侵权,请联系作者删除!