Package org.kiji.schema.layout.impl.ZooKeeperMonitor

Examples of org.kiji.schema.layout.impl.ZooKeeperMonitor.LayoutTracker.open()


    BlockingQueue<byte[]> layoutQueue = Queues.newSynchronousQueue();
    LayoutTracker tracker =
        zkMonitor.newTableLayoutTracker(tableURI, new QueueingLayoutUpdateHandler(layoutQueue));
    try {
      tracker.open();
      Assert.assertEquals(layout1, Bytes.toString(layoutQueue.poll(5, TimeUnit.SECONDS)));

      ZooKeeperUtils.setTableLayout(mZKClient, tableURI, layout2);
      Assert.assertEquals(layout2, Bytes.toString(layoutQueue.poll(5, TimeUnit.SECONDS)));
    } finally {
View Full Code Here


                  throw new RuntimeInterruptedException(ie);
                }
              }
            });

        layoutTracker.open();
        final String layout1 = queue.poll(1, TimeUnit.SECONDS);
        Assert.assertEquals("layout.v1", layout1);

        monitor.notifyNewTableLayout(tableURI, Bytes.toBytes("layout.v2"), -1);
        final String layout2 = queue.poll(1, TimeUnit.SECONDS);
View Full Code Here

    LayoutTracker tracker =
        mMonitor.newTableLayoutTracker(tableURI, new QueueingLayoutUpdateHandler(layoutQueue));

    try {
      mMonitor.notifyNewTableLayout(tableURI, layout0, -1);
      tracker.open();
      Assert.assertTrue("No notification for initial layout.",
          Arrays.equals(layout0, layoutQueue.poll(1, TimeUnit.SECONDS)));

      mMonitor.notifyNewTableLayout(tableURI, layout1, -1);
      Assert.assertTrue("No notification for layout update.",
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.