Package org.apache.bookkeeper.client.AsyncCallback

Examples of org.apache.bookkeeper.client.AsyncCallback.AddCallback


        final AtomicInteger result = new AtomicInteger(0);
        final CountDownLatch counter = new CountDownLatch(1);

        // Try to write, we shoud get and error callback but not an exception
        lh.asyncAddEntry("test".getBytes(), new AddCallback() {
            public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) {
                result.set(rc);
                counter.countDown();
            }
        }, null);
View Full Code Here


                    public void run() {
                        try {
                            LedgerHandle lh = client.createLedger(3, 3, digestType, "testPasswd".getBytes());
                            startNewBookie();
                            killBookie(0);
                            lh.asyncAddEntry("test".getBytes(), new AddCallback() {
                                    @Override
                                    public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) {
                                        // noop, we don't care if this completes
                                    }
                                }, null);
View Full Code Here

        CountDownLatch latch = new CountDownLatch(1);
        sleepBookie(bookieToSleep, sleeptime, latch);
        latch.await();

        writelh.asyncAddEntry(tmp.getBytes(),
                new AddCallback() {
                    public void addComplete(int rc, LedgerHandle lh,
                                            long entryId, Object ctx) {
                        completed.set(true);
                    }
                }, null);
View Full Code Here

        if (!enabled) {
            cb.addRecordComplete(Code.LOGGERDISABLED, ctx);
            return;
        }

        this.lh.asyncAddEntry(record, new AddCallback() {
            @Override
            public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) {
                if (LOG.isDebugEnabled()) {
                    LOG.info("Add to ledger complete: " + lh.getId() + ", " + entryId);
                }
View Full Code Here

        // replace a slow dead bookie
        startDeadBookie(conf, deadIOLatch);

        // tried to add entries
        for (int i = 0; i < numEntries; i++) {
            lh.asyncAddEntry("data".getBytes(), new AddCallback() {
                @Override
                public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) {
                    if (BKException.Code.OK != rc) {
                        failedLatch.countDown();
                        deadIOLatch.countDown();
View Full Code Here

TOP

Related Classes of org.apache.bookkeeper.client.AsyncCallback.AddCallback

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.