Package org.apache.zookeeper

Examples of org.apache.zookeeper.KeeperException.code()


            fail("Should throw NodeExistsException as the znode is not getting expired");
        } catch (IOException e) {
            Throwable t = e.getCause();
            if (t instanceof KeeperException) {
                KeeperException ke = (KeeperException) t;
                Assert.assertTrue("ErrorCode:" + ke.code()
                        + ", Registration node doesn't exists",
                        ke.code() == KeeperException.Code.NODEEXISTS);

                // verify ephemeral owner of the bkReg znode
                Stat bkRegNode2 = newzk.exists(bkRegPath, false);
View Full Code Here


            Throwable t = e.getCause();
            if (t instanceof KeeperException) {
                KeeperException ke = (KeeperException) t;
                Assert.assertTrue("ErrorCode:" + ke.code()
                        + ", Registration node doesn't exists",
                        ke.code() == KeeperException.Code.NODEEXISTS);

                // verify ephemeral owner of the bkReg znode
                Stat bkRegNode2 = newzk.exists(bkRegPath, false);
                Assert.assertNotNull("Bookie registration has been failed",
                        bkRegNode2);
View Full Code Here

                if (eventState == KeeperState.SyncConnected) {
                    try {
                        initializeRootNode();
                    } catch (ServiceLocatorException e) {
                        KeeperException zke = (KeeperException) e.getCause();
                        if (zke.code().equals(KeeperException.Code.NOAUTH)) {
                            authenticate();
                            initializeRootNode();
                        }
                    }
                    //fix for TESB-9642
View Full Code Here

        tryNum++;
      } catch (Exception e1) {
        tryNum++;
        if (e1 instanceof KeeperException) {
          KeeperException e = (KeeperException) e1;
          switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: ", e);
            break;
          default:
View Full Code Here

          break;
        }
      } catch (Exception e1) {
        if (e1 instanceof KeeperException) {
          KeeperException e = (KeeperException) e1;
          switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.debug("Possibly transient ZooKeeper exception: ", e);
            continue;
          default:
View Full Code Here

        tryNum++;
      } catch (Exception e1) {
        tryNum++;
        if (e1 instanceof KeeperException) {
          KeeperException e = (KeeperException) e1;
          switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: ", e);
            break;
          default:
View Full Code Here

        }

        if ( KeeperException.class.isAssignableFrom(e.getClass()) )
        {
            KeeperException keeperException = (KeeperException)e;
            switch ( keeperException.code() )
            {
                default:
                {
                    type = ExceptionType.ZOOKEEPER;
                    zooKeeperException = ZooKeeperExceptionType.valueOf(keeperException.code().name());
View Full Code Here

            switch ( keeperException.code() )
            {
                default:
                {
                    type = ExceptionType.ZOOKEEPER;
                    zooKeeperException = ZooKeeperExceptionType.valueOf(keeperException.code().name());
                    nodeException = null;
                    break;
                }

                case NONODE:
View Full Code Here

                case NOTEMPTY:
                case BADVERSION:
                {
                    type = ExceptionType.NODE;
                    zooKeeperException = null;
                    nodeException = NodeExceptionType.valueOf(keeperException.code().name());
                    break;
                }
            }
        }
        else
View Full Code Here

        tryNum++;
      } catch (Exception e1) {
        tryNum++;
        if (e1 instanceof KeeperException) {
          KeeperException e = (KeeperException) e1;
          switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: ", e);
            break;
          default:
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.