Examples of MultiCallback


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

                if (zkActiveLedgers.size() == 0) {
                    finalCb.processResult(successRc, null, ctx);
                    return;
                }

                MultiCallback mcb = new MultiCallback(zkActiveLedgers.size(), finalCb, ctx,
                                                      successRc, failureRc);
                // start loop over all ledgers
                for (Long ledger : zkActiveLedgers) {
                    processor.process(ledger, mcb);
                }
View Full Code Here

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

                if (zkActiveLedgers.size() == 0) {
                    finalCb.processResult(successRc, null, ctx);
                    return;
                }

                MultiCallback mcb = new MultiCallback(zkActiveLedgers.size(), finalCb, ctx,
                                                      successRc, failureRc);
                // start loop over all ledgers
                for (Long ledger : zkActiveLedgers) {
                    processor.process(ledger, mcb);
                }
View Full Code Here

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

                /*
                 * Multicallback for ledger. Once all fragments for the ledger have been recovered
                 * trigger the ledgerIterCb
                 */
                MultiCallback ledgerFragmentsMcb
                    = new MultiCallback(ledgerFragmentsToRecover.size(), ledgerIterCb, null,
                                        BKException.Code.OK, BKException.Code.LedgerRecoveryException);
                /*
                 * Now recover all of the necessary ledger fragments
                 * asynchronously using a MultiCallback for every fragment.
                 */
                for (final Long startEntryId : ledgerFragmentsToRecover) {
                    Long endEntryId = ledgerFragmentsRange.get(startEntryId);
                    InetSocketAddress newBookie = null;
                    try {
                        newBookie = getNewBookie(lh.getLedgerMetadata().getEnsembles().get(startEntryId),
                                                 availableBookies);
                    } catch (BKException.BKNotEnoughBookiesException bke) {
                        ledgerFragmentsMcb.processResult(BKException.Code.NotEnoughBookiesException,
                                                         null, null);
                        continue;
                    }
                   
                    if (LOG.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.mahout.df.callback.MultiCallback

   
    // compute the test set error using m=1 (Single Input Error)
    errorOne = new ForestPredictions(test.size(), nblabels);
   
    if (oobM < oobOne) {
      forestM.classify(test, new MultiCallback(testError, treeError));
      forestOne.classify(test, errorOne);
    } else {
      forestOne.classify(test, new MultiCallback(testError, treeError, errorOne));
    }
   
    sumTestErr += ErrorEstimate.errorRate(testLabels, testError.computePredictions(rng));
    sumOneErr += ErrorEstimate.errorRate(testLabels, errorOne.computePredictions(rng));
    sumTreeErr += treeError.meanTreeError();
View Full Code Here

Examples of org.apache.mahout.df.callback.MultiCallback

    // compute the test set error using m=1 (Single Input Error)
    errorOne = new ForestPredictions(dataSize, nblabels);

    if (oobM < oobOne) {
      forestM.classify(test, new MultiCallback(testError, treeError));
      forestOne.classify(test, errorOne);
    } else {
      forestOne.classify(test,
          new MultiCallback(testError, treeError, errorOne));
    }

    sumTestErr += ErrorEstimate.errorRate(testLabels, testError.computePredictions(rng));
    sumOneErr += ErrorEstimate.errorRate(testLabels, errorOne.computePredictions(rng));
    sumTreeErr += treeError.meanTreeError();
View Full Code Here

Examples of org.apache.zookeeper.AsyncCallback.MultiCallback

    private List<OpResult> multi(ZooKeeper zk, Iterable<Op> ops)
    throws KeeperException, InterruptedException {
        if (useAsync) {
            final MultiResult res = new MultiResult();
            zk.multi(ops, new MultiCallback() {
                @Override
                public void processResult(int rc, String path, Object ctx,
                                          List<OpResult> opResults) {
                    synchronized (res) {
                        res.rc = rc;
View Full Code Here

Examples of org.apache.zookeeper.AsyncCallback.MultiCallback

    private void multiHavingErrors(ZooKeeper zk, Iterable<Op> ops,
            List<Integer> expectedResultCodes, String expectedErr)
            throws KeeperException, InterruptedException {
        if (useAsync) {
            final MultiResult res = new MultiResult();
            zk.multi(ops, new MultiCallback() {
                @Override
                public void processResult(int rc, String path, Object ctx,
                        List<OpResult> opResults) {
                    synchronized (res) {
                        res.rc = rc;
View Full Code Here

Examples of org.apache.zookeeper.AsyncCallback.MultiCallback

    private List<OpResult> commit(Transaction txn)
    throws KeeperException, InterruptedException {
        if (useAsync) {
            final MultiResult res = new MultiResult();
            txn.commit(new MultiCallback() {
                @Override
                public void processResult(int rc, String path, Object ctx,
                                          List<OpResult> opResults) {
                    synchronized (res) {
                        res.rc = rc;
View Full Code Here

Examples of org.apache.zookeeper.AsyncCallback.MultiCallback

                Op.create("/foo", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
        );
        List<OpResult> results = null;
        if (useAsync) {
            final MultiResult res = new MultiResult();
            zk.multi(ops, new MultiCallback() {
                @Override
                public void processResult(int rc, String path, Object ctx,
                                          List<OpResult> opResults) {
                    synchronized (res) {
                        res.rc = rc;
View Full Code Here

Examples of org.apache.zookeeper.AsyncCallback.MultiCallback

    private List<OpResult> multi(ZooKeeper zk, Iterable<Op> ops)
    throws KeeperException, InterruptedException {
        if (useAsync) {
            final MultiResult res = new MultiResult();
            zk.multi(ops, new MultiCallback() {
                @Override
                public void processResult(int rc, String path, Object ctx,
                                          List<OpResult> opResults) {
                    synchronized (res) {
                        res.rc = rc;
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.