Package io.s4.message

Examples of io.s4.message.Response


    }

    private static void testStaticTaskManager(String[] args) {
        String address = null;
        address = "localhost:2181";
        TaskManager taskManager = new StaticTaskManager(address,
                                                        "taskmanagerTest",
                                                        ClusterType.S4,
                                                        null);
        Map<String, String> customTaskData = new HashMap<String, String>();
        Object acquireTask = taskManager.acquireTask(customTaskData);
        System.out.println("Acuired Task:" + acquireTask);

    }
View Full Code Here


    }

    private static void testStaticProcessMonitor(String[] args) {
        String address = null;
        address = "localhost:2181";
        StaticProcessMonitor monitor = new StaticProcessMonitor(address,
                                                                "taskmanagerTest",
                                                                ClusterType.S4);
        monitor.monitor();
        System.out.println(monitor.getDestinationList());
        System.out.println(monitor.getDestinationMap());
    }
View Full Code Here

            String clusterName, CommEventCallback callbackHandler) {
        ProcessMonitor processMonitor = null;
        String mode = System.getProperty("commlayer.mode");
        if (mode != null && mode.equalsIgnoreCase("static")) {
            logger.info("Comm layer mode is set to static");
            processMonitor = new StaticProcessMonitor(zkaddress,
                                                      clusterName,
                                                      ClusterType.S4);
        } else {
            processMonitor = new ZkProcessMonitor(zkaddress,
                                                  clusterName,
View Full Code Here

    }

    private static void testStaticTaskManager(String[] args) {
        String address = null;
        address = "localhost:2181";
        TaskManager taskManager = new StaticTaskManager(address,
                                                        "taskmanagerTest",
                                                        ClusterType.S4,
                                                        null);
        Map<String, String> customTaskData = new HashMap<String, String>();
        Object acquireTask = taskManager.acquireTask(customTaskData);
        System.out.println("Acuired Task:" + acquireTask);

    }
View Full Code Here

            CommEventCallback callbackHandler) {
        String mode = System.getProperty("commlayer.mode");
        TaskManager taskManager = null;
        if (mode != null && mode.equalsIgnoreCase("static")) {
            logger.info("Comm layer mode is set to static");
            taskManager = new StaticTaskManager(zkaddress,
                                                clusterName,
                                                clusterType,
                                                callbackHandler);
        } else {
            taskManager = new ZkTaskManager(zkaddress,
View Full Code Here

        System.err.println("java TaskSetupApp <zk_address> [clean|setup] setup_config_xml");
        System.exit(1);
    }

    private static void doMain(String zkAddress, boolean clean, boolean setup, String setupXml) {
        ConfigParser parser = new ConfigParser();
        Config config = parser.parse(setupXml);
        for (Cluster cluster : config.getClusters()) {
            processCluster(clean, zkAddress, cluster, config.getVersion());
        }
    }
View Full Code Here

            String clusterName, ClusterType clusterType, boolean isStatic) {
        ConfigParser parser = new ConfigParser();
        ConfigParser.Config config = parser.parse(configFilename);

        // find the requested cluster
        Cluster cluster = null;
        for (Cluster checkCluster : config.getClusters()) {
            if (checkCluster.getName().equals(clusterName)
                    && checkCluster.getType().equals(clusterType)) {
                cluster = checkCluster;
                break;
View Full Code Here

        System.exit(1);
    }

    private static void doMain(String zkAddress, boolean clean, boolean setup, String setupXml) {
        ConfigParser parser = new ConfigParser();
        Config config = parser.parse(setupXml);
        for (Cluster cluster : config.getClusters()) {
            processCluster(clean, zkAddress, cluster, config.getVersion());
        }
    }
View Full Code Here

            logger.info("Comm layer mode is set to static");
            processMonitor = new StaticProcessMonitor(zkaddress,
                                                      clusterName,
                                                      ClusterType.S4);
        } else {
            processMonitor = new ZkProcessMonitor(zkaddress,
                                                  clusterName,
                                                  ClusterType.S4,
                                                  callbackHandler);
        }
        return processMonitor;
View Full Code Here

import org.apache.zookeeper.KeeperException;

public class ZkQueueTest {
    public static void main(String args[]) {
        ZkQueue q = new ZkQueue(args[0], "/app1");

        System.out.println("Input: " + args[0]);
        int i;
        Integer max = new Integer(args[1]);

        if (args[2].equals("p")) {
            System.out.println("Producer");
            for (i = 0; i < max; i++)
                try {
                    q.produce(new Integer(10 + i));
                } catch (KeeperException e) {

                } catch (InterruptedException e) {

                }
        } else {
            System.out.println("Consumer");

            for (i = 0; i < max || true; i++) {
                try {
                    Integer r = (Integer) q.consume();
                    System.out.println("Item: " + r);
                } catch (KeeperException e) {
                    e.printStackTrace();
                    i--;
                } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of io.s4.message.Response

Copyright © 2018 www.massapicom. 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.