Examples of CreateMode


Examples of org.apache.zookeeper.CreateMode

  public AccessResult doSet(String path, T record, int expectVersion, int options) {
    if (path == null) {
      throw new NullPointerException("path can't be null");
    }

    CreateMode mode = AccessOption.getMode(options);
    if (mode == null) {
      throw new IllegalArgumentException("Invalid set options: " + options);
    }

    Stat stat = null;
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

  public AccessResult doUpdate(String path, DataUpdater<T> updater, int options) {
    if (path == null || updater == null) {
      throw new NullPointerException("path|updater can't be null");
    }

    CreateMode mode = AccessOption.getMode(options);
    if (mode == null) {
      throw new IllegalArgumentException("Invalid update options: " + options);
    }

    boolean retry;
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

      throw new IllegalArgumentException(
          "paths and needCreate should be of same size, but paths size: " + paths.size()
              + ", needCreate size: " + needCreate.length);
    }

    CreateMode mode = AccessOption.getMode(options);
    if (mode == null) {
      throw new IllegalArgumentException("Invalid async set options: " + options);
    }

    CreateCallbackHandler[] cbList = new CreateCallbackHandler[paths.size()];
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

      throw new IllegalArgumentException(
          "paths and records should be of same size, but paths size: " + size + ", records size: "
              + records.size());
    }

    CreateMode mode = AccessOption.getMode(options);
    if (mode == null) {
      throw new IllegalArgumentException("Invalid async set options: " + options);
    }

    if (size == 0) {
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

      throw new IllegalArgumentException(
          "paths and updaters should be of same size, but paths size: " + size
              + ", updaters size: " + updaters.size());
    }

    CreateMode mode = AccessOption.getMode(options);
    if (mode == null) {
      throw new IllegalArgumentException("Invalid update options: " + options);
    }

    if (size == 0) {
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

        boolean         isDone = false;
        for ( int i = 0; !isDone && (i < MAX_TRIES); ++i )
        {
            try
            {
                CreateMode      mode = (service.getServiceType() == ServiceType.DYNAMIC) ? CreateMode.EPHEMERAL : CreateMode.PERSISTENT;
                client.create().creatingParentsIfNeeded().withMode(mode).forPath(path, bytes);
                isDone = true;
            }
            catch ( KeeperException.NodeExistsException e )
            {
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

     *            header.
     * @return the parsed {@link CreateMode} or null if the header was null or
     *         not a valid mode flag.
     */
    public static CreateMode getCreateMode(Message message, CreateMode defaultMode) {
        CreateMode mode = null;

        try {
            mode = message.getHeader(ZooKeeperMessage.ZOOKEEPER_CREATE_MODE, CreateMode.class);
        } catch (Exception e) {
        }
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

        return mode == null ? defaultMode : mode;
    }

    public static CreateMode getCreateModeFromString(String modeHeader, CreateMode defaultMode) {
       
        CreateMode mode = null;
        if (modeHeader != null) {
            try {
                mode = CreateMode.valueOf(modeHeader);
            } catch (Exception e) {
            }
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

    private OperationResult<String> createNode(ProductionContext ctx) throws Exception {
        CreateOperation create = new CreateOperation(ctx.connection, ctx.node);
        create.setPermissions(getAclListFromMessage(ctx.exchange.getIn()));
       
        CreateMode mode = null;
        String modeString = configuration.getCreateMode();
        if (modeString != null) {
            try {
                mode = getCreateModeFromString(modeString, CreateMode.EPHEMERAL);
            } catch (Exception e) { }
View Full Code Here

Examples of org.apache.zookeeper.CreateMode

  public AccessResult doCreate(String path, T record, int options) {
    if (path == null) {
      throw new NullPointerException("path can't be null");
    }

    CreateMode mode = AccessOption.getMode(options);
    if (mode == null) {
      throw new IllegalArgumentException("Invalid create options: " + options);
    }

    boolean retry;
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.