Package org.apache.s4.comm.tools

Examples of org.apache.s4.comm.tools.TaskSetup.clean()


        CommTestUtils.cleanupTmpDirs();

        zkFactory = CommTestUtils.startZookeeperServer();

        TaskSetup taskSetup = new TaskSetup("localhost:" + CommTestUtils.ZK_PORT);
        taskSetup.clean("s4");
        taskSetup.setup("cluster1", numTasks, 1300);
    }

    @After
    public void cleanupZkBasedTest() throws IOException, InterruptedException {
View Full Code Here


    }

    private void initializeS4Node() throws ConfigurationException, IOException, InterruptedException, KeeperException {
        // 1. start s4 nodes. Check that no app is deployed.
        TaskSetup taskSetup = new TaskSetup("localhost:" + CommTestUtils.ZK_PORT);
        taskSetup.clean("s4");
        taskSetup.setup(PRODUCER_CLUSTER, 1, 1300);

        TaskSetup taskSetup2 = new TaskSetup("localhost:" + CommTestUtils.ZK_PORT);
        taskSetup2.setup(CONSUMER_CLUSTER, 1, 1400);
View Full Code Here

        try {

            logger.info("preparing new cluster [{}] with [{}] node(s)", clusterArgs.clusterName, clusterArgs.nbTasks);

            TaskSetup taskSetup = new TaskSetup(clusterArgs.zkConnectionString);
            taskSetup.clean(clusterArgs.clusterName);
            taskSetup.setup(clusterArgs.clusterName, clusterArgs.nbTasks, clusterArgs.firstListeningPort);
            logger.info("New cluster configuration uploaded into zookeeper");
        } catch (Exception e) {
            logger.error("Cannot initialize zookeeper with specified configuration", e);
        }
View Full Code Here

                    clusterConfigs = Collections.emptyList();
                }
            }
            for (ClusterConfig config : clusterConfigs) {
                TaskSetup taskSetup = new TaskSetup("localhost:" + zkArgs.zkPort);
                taskSetup.clean(config.clusterName);
                taskSetup.setup(config.clusterName, config.nbTasks, config.firstListeningPort);
                logger.info("Defined S4 cluster [{}] with [{}] tasks with first listening port [{}]", new String[] {
                        config.clusterName, String.valueOf(config.nbTasks), String.valueOf(config.firstListeningPort) });
            }
View Full Code Here

    @Test
    public void testAssignment() throws Exception {
        TaskSetup taskSetup = new TaskSetup(zookeeperAddress);
        final String clusterName = "test-s4-cluster";
        taskSetup.clean(clusterName);
        taskSetup.setup(clusterName, 10);

        final TopologyFromZK topologyFromZK = new TopologyFromZK(clusterName, zookeeperAddress, 30000, 30000);
        final Lock lock = new ReentrantLock();
        final Condition signal = lock.newCondition();
View Full Code Here

    @Test
    public void testAssignment() throws Exception {
        TaskSetup taskSetup = new TaskSetup(zookeeperAddress);
        final String clusterName = "test-s4-cluster";
        taskSetup.clean(clusterName);
        taskSetup.setup(clusterName, 10);
        final CountDownLatch latch = new CountDownLatch(10);
        for (int i = 0; i < 10; i++) {
            Runnable runnable = new Runnable() {
View Full Code Here

        ZkClient zkClient2 = new ZkClient(zookeeperAddress, 10000, 10000);
        zkClient2.getCreationTime("/");
        TaskSetup taskSetup = new TaskSetup(zookeeperAddress);
        final String clusterName = "s4-test-cluster";
        taskSetup.clean(clusterName);
        taskSetup.setup(clusterName, 1);
        // final CountDownLatch latch = new CountDownLatch(10);
        // for (int i = 0; i < 10; i++) {
        // Runnable runnable = new Runnable() {
        //
View Full Code Here

    }

    private void initializeS4Node() throws ConfigurationException, IOException, InterruptedException, KeeperException {
        // 1. start s4 node. Check that no app is deployed.
        TaskSetup taskSetup = new TaskSetup("localhost:" + CommTestUtils.ZK_PORT);
        taskSetup.clean("s4");
        taskSetup.setup(PRODUCER_CLUSTER, 1, 1300);

        zkClient = new ZkClient("localhost:" + CommTestUtils.ZK_PORT);
        zkClient.setZkSerializer(new ZNRecordSerializer());
        List<String> processes = zkClient.getChildren("/s4/clusters/" + PRODUCER_CLUSTER + "/process");
View Full Code Here

                    clusterConfigs = Collections.emptyList();
                }
            }
            for (ClusterConfig config : clusterConfigs) {
                TaskSetup taskSetup = new TaskSetup("localhost:" + zkArgs.zkPort);
                taskSetup.clean(config.clusterName);
                taskSetup.setup(config.clusterName, config.nbTasks, config.firstListeningPort);
                logger.info("Defined S4 cluster [{}] with [{}] tasks with first listening port [{}]", new String[] {
                        config.clusterName, String.valueOf(config.nbTasks), String.valueOf(config.firstListeningPort) });
            }
View Full Code Here

    }

    private void initializeS4Node() throws ConfigurationException, IOException, InterruptedException, KeeperException {
        // 1. start s4 nodes. Check that no app is deployed.
        TaskSetup taskSetup = new TaskSetup("localhost:" + CommTestUtils.ZK_PORT);
        taskSetup.clean("s4");
        taskSetup.setup(PRODUCER_CLUSTER, 1, 1300);

        TaskSetup taskSetup2 = new TaskSetup("localhost:" + CommTestUtils.ZK_PORT);
        taskSetup2.setup(CONSUMER_CLUSTER, 1, 1400);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.