Package org.menagerie

Examples of org.menagerie.DefaultZkSessionManager$SessionPollListener


  private ReadWriteLock someOtherLock;
  private AtomicInteger counter = new AtomicInteger(0);

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    sessionManager = new DefaultZkSessionManager("localhost:2181", 5000);
  }
View Full Code Here


  private ReadWriteLock nodeLock;
  private AtomicBoolean workflowThreadCompleted;

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    sessionManager = new DefaultZkSessionManager("localhost:2181", 5000);
  }
View Full Code Here

*/
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();
    }
View Full Code Here

*/
public class S3 {
    private static final String testElement = "Test element";

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


        ZkBlockingQueue <String> testQueue   = new ZkBlockingQueue <String> ("/cassandra_clusters/def", new JavaSerializer <String> () , dzsm,100);



        String peekedElement = testQueue.peek();
        System.out.println(peekedElement);
        long timeout = 5;
        String polledElement = testQueue.poll(timeout, TimeUnit.SECONDS);
        System.out.println(polledElement);
        dzsm.shutdown();
    }
View Full Code Here

 
  private ReadWriteLock nodeLock;

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    sessionManager = new DefaultZkSessionManager("10.27.2.184:2181,10.27.2.185:2181,10.27.2.240:2181", 5000);
  }
View Full Code Here

TOP

Related Classes of org.menagerie.DefaultZkSessionManager$SessionPollListener

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.