Package org.menagerie.collections

Source Code of org.menagerie.collections.S2

package org.menagerie.collections;


import org.apache.zookeeper.KeeperException;
import org.menagerie.DefaultZkSessionManager;
import org.menagerie.JavaSerializer;

/**
* @author Milind Parikh
*         Date: Apr 25, 2011
*/
public class S2 {
    private static final String testElement = "Test element";

    public static void  main(String [] args) throws InterruptedException, KeeperException {
        DefaultZkSessionManager dzsm = new DefaultZkSessionManager("localhost:2181", 2000);

//        dzsm.getZooKeeper().create("/cassandra_clusters",new byte[]{}, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
        ZkBlockingQueue <String> testQueue   = new ZkBlockingQueue <String> ("/cassandra_clusters/def", new JavaSerializer <String> () , dzsm, 100);


        testQueue.put(testElement);
        int reportedSize = testQueue.size();
        System.out.println(reportedSize);
        dzsm.shutdown();
    }

}
TOP

Related Classes of org.menagerie.collections.S2

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.