Package org.apache.bookkeeper.proto.BookkeeperInternalCallbacks

Examples of org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadEntryCallback


        connectLatch.await(5, TimeUnit.SECONDS);
       
        assertEquals("client not connected", BKException.Code.OK, outerrc.get());
        outerrc.set(-1000);
        final CountDownLatch readLatch = new CountDownLatch(1);
        ReadEntryCallback cb = new ReadEntryCallback() {
                public void readEntryComplete(int rc, long ledgerId, long entryId, ChannelBuffer buffer, Object ctx) {
                    outerrc.set(rc);
                    readLatch.countDown();
                }
            };
View Full Code Here


        AtomicLong bytesOutstanding = new AtomicLong(0);

        final PerChannelBookieClient client = new PerChannelBookieClient(executor, channelFactory,
                                                                         addr, bytesOutstanding);
        final CountDownLatch completion = new CountDownLatch(1);
        final ReadEntryCallback cb = new ReadEntryCallback() {
                @Override
                public void readEntryComplete(int rc, long ledgerId, long entryId,
                                              ChannelBuffer buffer, Object ctx) {
                    completion.countDown();
                }
            };

        client.connectIfNeededAndDoOp(new GenericCallback<Void>() {
            @Override
            public void operationComplete(final int rc, Void result) {
                if (rc != BKException.Code.OK) {
                    executor.submitOrdered(1, new SafeRunnable() {
                        @Override
                        public void safeRun() {
                            cb.readEntryComplete(rc, 1, 1, null, null);
                        }
                    });
                    return;
                }
View Full Code Here

        connectLatch.await(5, TimeUnit.SECONDS);
       
        assertEquals("client not connected", BKException.Code.OK, outerrc.get());
        outerrc.set(-1000);
        final CountDownLatch readLatch = new CountDownLatch(1);
        ReadEntryCallback cb = new ReadEntryCallback() {
                public void readEntryComplete(int rc, long ledgerId, long entryId, ChannelBuffer buffer, Object ctx) {
                    outerrc.set(rc);
                    readLatch.countDown();
                }
            };
View Full Code Here

        connectLatch.await(5, TimeUnit.SECONDS);
       
        assertEquals("client not connected", BKException.Code.OK, outerrc.get());
        outerrc.set(-1000);
        final CountDownLatch readLatch = new CountDownLatch(1);
        ReadEntryCallback cb = new ReadEntryCallback() {
                public void readEntryComplete(int rc, long ledgerId, long entryId, ChannelBuffer buffer, Object ctx) {
                    outerrc.set(rc);
                    readLatch.countDown();
                }
            };
View Full Code Here

TOP

Related Classes of org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadEntryCallback

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.