Examples of asyncReadEntries()


Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

            LOG.debug("Number of entries written: " + lh.getLastAddConfirmed());
            assertTrue("Verifying number of entries written", lh.getLastAddConfirmed() == (numEntriesToWrite - 1));

            // read entries
            lh.asyncReadEntries(0, numEntriesToWrite - 1, this, sync);

            synchronized (sync) {
                while (sync.value == false) {
                    sync.wait();
                }
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

            LOG.debug("Number of entries written: " + lh.getLastAddConfirmed());
            assertTrue("Verifying number of entries written", lh.getLastAddConfirmed() == (numEntriesToWrite - 1));

            // read entries
            lh.asyncReadEntries(0, numEntriesToWrite - 1, this, sync);

            synchronized (sync) {
                while (sync.value == false) {
                    sync.wait();
                }
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

        try {
            // read first entry, both go to first bookie, should be fine
            LatchCallback nospeccb = new LatchCallback();
            LatchCallback speccb = new LatchCallback();
            lnospec.asyncReadEntries(0, 0, nospeccb, null);
            lspec.asyncReadEntries(0, 0, speccb, null);
            nospeccb.expectSuccess(2000);
            speccb.expectSuccess(2000);

            // read second entry, both look for second book, spec read client
            // tries third bookie, nonspec client hangs as read timeout is very long.
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

            // read second entry, both look for second book, spec read client
            // tries third bookie, nonspec client hangs as read timeout is very long.
            nospeccb = new LatchCallback();
            speccb = new LatchCallback();
            lnospec.asyncReadEntries(1, 1, nospeccb, null);
            lspec.asyncReadEntries(1, 1, speccb, null);
            speccb.expectSuccess(4000);
            nospeccb.expectTimeout(4000);
        } finally {
            sleepLatch.countDown();
            lspec.close();
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

        try {
            // read first entry, should complete faster than timeout
            // as bookie 0 has the entry
            LatchCallback latch0 = new LatchCallback();
            l.asyncReadEntries(0, 0, latch0, null);
            latch0.expectSuccess(timeout/2);

            // second should have to hit two timeouts (bookie 1 & 2)
            // bookie 3 has the entry
            LatchCallback latch1 = new LatchCallback();
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

            latch0.expectSuccess(timeout/2);

            // second should have to hit two timeouts (bookie 1 & 2)
            // bookie 3 has the entry
            LatchCallback latch1 = new LatchCallback();
            l.asyncReadEntries(1, 1, latch1, null);
            latch1.expectTimeout(timeout);
            latch1.expectSuccess(timeout*2);
            LOG.info("Timeout {} latch1 duration {}", timeout, latch1.getDuration());
            assertTrue("should have taken longer than two timeouts, but less than 3",
                       latch1.getDuration() >= timeout*2
 
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

                       && latch1.getDuration() < timeout*3);

            // third should have to hit one timeouts (bookie 2)
            // bookie 3 has the entry
            LatchCallback latch2 = new LatchCallback();
            l.asyncReadEntries(2, 2, latch2, null);
            latch2.expectTimeout(timeout/2);
            latch2.expectSuccess(timeout);
            LOG.info("Timeout {} latch2 duration {}", timeout, latch2.getDuration());
            assertTrue("should have taken longer than one timeout, but less than 2",
                       latch2.getDuration() >= timeout
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

                       && latch2.getDuration() < timeout*2);

            // fourth should have no timeout
            // bookie 3 has the entry
            LatchCallback latch3 = new LatchCallback();
            l.asyncReadEntries(3, 3, latch3, null);
            latch3.expectSuccess(timeout/2);

            // fifth should hit one timeout, (bookie 4)
            // bookie 0 has the entry
            LatchCallback latch4 = new LatchCallback();
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

            latch3.expectSuccess(timeout/2);

            // fifth should hit one timeout, (bookie 4)
            // bookie 0 has the entry
            LatchCallback latch4 = new LatchCallback();
            l.asyncReadEntries(4, 4, latch4, null);
            latch4.expectTimeout(timeout/2);
            latch4.expectSuccess(timeout);
            LOG.info("Timeout {} latch4 duration {}", timeout, latch4.getDuration());
            assertTrue("should have taken longer than one timeout, but less than 2",
                       latch4.getDuration() >= timeout
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries()

        try {
            // read goes to first bookie, spec read timeout occurs,
            // goes to second
            LatchCallback latch0 = new LatchCallback();
            l.asyncReadEntries(0, 0, latch0, null);
            latch0.expectTimeout(timeout);

            // wake up first bookie
            sleepLatch0.countDown();
            latch0.expectSuccess(timeout/2);
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.