Package org.apache.helix.manager.zk.ZkAsyncCallbacks

Examples of org.apache.helix.manager.zk.ZkAsyncCallbacks.CreateCallbackHandler


        {
          boolean[] needCreate = Arrays.copyOf(needSet, needSet.length);
          createCbList = create(paths, records, needCreate, pathsCreated, options);
          for (int i = 0; i < createCbList.length; i++)
          {
            CreateCallbackHandler createCb = createCbList[i];
            if (createCb == null)
            {
              continue;
            }

            Code rc = Code.get(createCb.getRc());
            switch (rc)
            {
            case OK:
              setStats.set(i, ZNode.ZERO_STAT);
              needSet[i] = false;
              break;
            case NODEEXISTS:
              retry = true;
              break;
            default:
              // if creation fails on error other than NodeExists
              // no need to retry set
              needSet[i] = false;
              break;
            }
          }
        }
      }
      while (retry);

      // construct return results
      for (int i = 0; i < cbList.length; i++)
      {
        SetDataCallbackHandler cb = cbList[i];

        Code rc = Code.get(cb.getRc());
        if (rc == Code.OK)
        {
          success[i] = true;
        }
        else if (rc == Code.NONODE)
        {
          CreateCallbackHandler createCb = createCbList[i];
          if (Code.get(createCb.getRc()) == Code.OK)
          {
            success[i] = true;
          }
        }
      }
View Full Code Here


        if (failOnNoNode)
        {
          createCbList = create(paths, newDataList, needCreate, pathsCreated, options);
          for (int i = 0; i < paths.size(); i++)
          {
            CreateCallbackHandler createCb = createCbList[i];
            if (createCb == null)
            {
              continue;
            }

            switch (Code.get(createCb.getRc()))
            {
            case OK:
              needUpdate[i] = false;
              updateData.set(i, newDataList.get(i));
              setStats.set(i, ZNode.ZERO_STAT);
View Full Code Here

TOP

Related Classes of org.apache.helix.manager.zk.ZkAsyncCallbacks.CreateCallbackHandler

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.