Examples of acquireSemaphore()


Examples of org.apache.curator.test.Timing.acquireSemaphore()

            };
            selector = new LeaderSelector(client, "/leader", listener);
            selector.autoRequeue();
            selector.start();

            Assert.assertTrue(timing.acquireSemaphore(semaphore, 2));
        }
        finally
        {
            Closeables.closeQuietly(selector);
            Closeables.closeQuietly(client);
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

                }
            };
            selector = new LeaderSelector(client, "/leader", listener);
            selector.start();

            timing.acquireSemaphore(semaphore);

            server.close();

            timing.acquireSemaphore(semaphore);
        }
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

            timing.acquireSemaphore(semaphore);

            server.close();

            timing.acquireSemaphore(semaphore);
        }
        finally
        {
            Closeables.closeQuietly(selector);
            Closeables.closeQuietly(client);
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

            LeaderSelector leaderSelector2 = new LeaderSelector(client, PATH_NAME, listener);

            leaderSelector1.start();
            leaderSelector2.start();

            Assert.assertTrue(timing.acquireSemaphore(semaphore, 1));

            KillSession.kill(client.getZookeeperClient().getZooKeeper(), server.getConnectString());

            Assert.assertTrue(timing.awaitLatch(interruptedLatch));
            timing.sleepABit();
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

            timing.sleepABit();

            leaderSelector1.requeue();
            leaderSelector2.requeue();

            Assert.assertTrue(timing.acquireSemaphore(semaphore, 1));
            Assert.assertEquals(leaderCount.get(), 1);

            leaderSelector1.close();
            leaderSelector2.close();
        }
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

                    semaphore.release();
                }
            };
            client.checkExists().usingWatcher(watcher).forPath(PATH);
            node.setData("b".getBytes());
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertEquals(node.getActualPath(), PATH);
            Assert.assertEquals(client.getData().usingWatcher(watcher).forPath(PATH), "b".getBytes());
            node.setData("c".getBytes());
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertEquals(node.getActualPath(), PATH);
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

            node.setData("b".getBytes());
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertEquals(node.getActualPath(), PATH);
            Assert.assertEquals(client.getData().usingWatcher(watcher).forPath(PATH), "b".getBytes());
            node.setData("c".getBytes());
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertEquals(node.getActualPath(), PATH);
            Assert.assertEquals(client.getData().usingWatcher(watcher).forPath(PATH), "c".getBytes());
            node.close();
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertTrue(client.checkExists().forPath(PATH) == null);
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

            node.setData("c".getBytes());
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertEquals(node.getActualPath(), PATH);
            Assert.assertEquals(client.getData().usingWatcher(watcher).forPath(PATH), "c".getBytes());
            node.close();
            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            Assert.assertTrue(client.checkExists().forPath(PATH) == null);
        }
        finally
        {
            if ( node != null )
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

            };
            selector = new LeaderSelector(client, "/leader", listener);
            selector.autoRequeue();
            selector.start();

            Assert.assertTrue(timing.acquireSemaphore(semaphore));
            selector.interruptLeadership();

            Assert.assertTrue(timing.acquireSemaphore(semaphore));
        }
        finally
View Full Code Here

Examples of org.apache.curator.test.Timing.acquireSemaphore()

                            return null;
                        }
                    }
                );

            Assert.assertTrue(timing.acquireSemaphore(semaphore, 1));
            KillSession.kill(client.getZookeeperClient().getZooKeeper(), server.getConnectString());
            Assert.assertTrue(timing.acquireSemaphore(semaphore, 1));
        }
        finally
        {
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.