/** * Starts an empty local Zk instance on the default port */ public static ZookeeperInstance startLocalZkServer() { return startLocalZkServer(DEFAULT_ZK_TEST_PORT); }
/** * 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()); }
protected void startZk(int port) { _zookeeperInstance = ZkStarter.startLocalZkServer(port); }
protected void startZk() { _zookeeperInstance = ZkStarter.startLocalZkServer(); }
@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; }
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); }
@BeforeTest public void beforeTest() { _zookeeperInstance = ZkStarter.startLocalZkServer(); String helixClusterName = "TestTableQueryQuotaManagerService"; _helixManager = initHelixManager(helixClusterName); _testPropertyStore = _helixManager.getHelixPropertyStore(); _tableQueryQuotaManager = new TableQueryQuotaManager(_helixManager); }
final ZkStarter.ZookeeperInstance zookeeperInstance = ZkStarter.startLocalZkServer(); final KafkaServerStartable kafkaStarter = KafkaStarterUtils .startServer(KafkaStarterUtils.DEFAULT_KAFKA_PORT, KafkaStarterUtils.DEFAULT_BROKER_ID,
@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); }
@BeforeTest public void setup() throws Exception { _zookeeperInstance = ZkStarter.startLocalZkServer(); _zkClient = new ZkClient(ZK_SERVER); final String zkPath = "/" + HELIX_CLUSTER_NAME;
@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); }
@BeforeTest public void setUp() throws Exception { _zookeeperInstance = ZkStarter.startLocalZkServer(); _zkClient = new ZkClient(ZkStarter.DEFAULT_ZK_STR); final String instanceId = "localhost_helixController";
@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); }