gpt4 book ai didi

org.lilyproject.util.zookeeper.ZooKeeperItf.create()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 20:50:49 26 4
gpt4 key购买 nike

本文整理了Java中org.lilyproject.util.zookeeper.ZooKeeperItf.create()方法的一些代码示例,展示了ZooKeeperItf.create()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperItf.create()方法的具体详情如下:
包路径:org.lilyproject.util.zookeeper.ZooKeeperItf
类名称:ZooKeeperItf
方法名:create

ZooKeeperItf.create介绍

暂无

代码示例

代码示例来源:origin: NGDATA/lilyproject

@Override
  public Object execute() throws KeeperException, InterruptedException {
    zk.create(nodesPath + "/" + repoAddressAndPort, null, ZooDefs.Ids.OPEN_ACL_UNSAFE,
        CreateMode.EPHEMERAL);
    return null;
  }
});

代码示例来源:origin: NGDATA/lilyproject

@Override
  public String execute() throws KeeperException, InterruptedException {
    return zk.create(lockPath + "/lock-" + threadId + "-", null, ZooDefs.Ids.OPEN_ACL_UNSAFE,
        CreateMode.EPHEMERAL_SEQUENTIAL);
  }
});

代码示例来源:origin: NGDATA/lilyproject

@Override
public String create(String path, byte[] data, List<ACL> acl, CreateMode createMode) throws KeeperException,
    InterruptedException {
  return wrapped.create(path, data, acl, createMode);
}

代码示例来源:origin: NGDATA/lilyproject

@Override
  public String execute() throws KeeperException, InterruptedException {
    return zk.create(electionPath + "/n_", null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
  }
});

代码示例来源:origin: NGDATA/lilyproject

@Override
public void create(String path, byte[] data, List<ACL> acl, CreateMode createMode, StringCallback cb, Object ctx) {
  wrapped.create(path, data, acl, createMode, cb, ctx);
}

代码示例来源:origin: NGDATA/lilyproject

@Override
  public Boolean execute() throws KeeperException, InterruptedException {
    if (zk.exists(subPath.toString(), false) == null) {
      try {
        zk.create(subPath.toString(), newData, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
        return true;
      } catch (KeeperException.NodeExistsException e) {
        return false;
      }
    }
    return false;
  }
});

代码示例来源:origin: NGDATA/lilyproject

private void assureDefaultRepositoryExists() throws KeeperException, InterruptedException {
  byte[] repoBytes = RepositoryDefinitionJsonSerDeser.INSTANCE.toJsonBytes(DEFAULT_REPOSITORY);
  try {
    zk.create(REPOSITORY_COLLECTION_PATH + "/" + DEFAULT_REPOSITORY.getName(), repoBytes, ZooDefs.Ids.OPEN_ACL_UNSAFE,
        CreateMode.PERSISTENT);
  } catch (KeeperException.NodeExistsException e) {
    // it already exists, fine
  }
}

代码示例来源:origin: NGDATA/lilyproject

@Override
public void create(String repositoryName) throws RepositoryExistsException, InterruptedException, RepositoryModelException {
  if (!RepoDefUtil.isValidRepositoryName(repositoryName)) {
    throw new IllegalArgumentException(String.format("'%s' is not a valid repository name. "
        + RepoDefUtil.VALID_NAME_EXPLANATION, repositoryName));
  }
  RepositoryDefinition repoDef = new RepositoryDefinition(repositoryName, RepositoryLifecycleState.CREATE_REQUESTED);
  byte[] repoBytes = RepositoryDefinitionJsonSerDeser.INSTANCE.toJsonBytes(repoDef);
  try {
    zk.create(REPOSITORY_COLLECTION_PATH + "/" + repositoryName, repoBytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
  } catch (KeeperException.NodeExistsException e) {
    throw new RepositoryExistsException("Can't create repository, a repository with this name already exists: "
        + repositoryName);
  } catch (KeeperException e) {
    throw new RepositoryModelException(e);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com