Codota Logo
ZkConnection.start
Code IndexAdd Codota to your IDE (free)

How to use
start
method
in
info.xiancloud.zookeeper.ZkConnection

Best Java code snippets using info.xiancloud.zookeeper.ZkConnection.start (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: xiancloud/xian

@Override
public void init() {
  start();
}
origin: xiancloud/xian

public static void start() {
  start(getZkConnStr());
}
origin: xiancloud/xian

  @Test
  public void setDataWithVersionTest() throws Exception {
    ZkConnection.start();
    try {
      /*ZkConnection.client.create().creatingParentsIfNeeded().forPath("/YY/11");*/
      ZkConnection.client.setData().withVersion(-1).forPath("/YY/11", "ss".getBytes());
    } finally {
      ZkConnection.close();
    }
  }
}
origin: xiancloud/xian

@Override
public void execute(UnitRequest msg, Handler<UnitResponse> handler) throws Exception {
  /**
   * 请设置此变量来删除指定路径下的脏节点
   */
  final String PATH = msg.get("basePath", "/xian_runtime_dev/unit");
  try {
    ZkConnection.start();
    for (String s : ZkConnection.client.getChildren().forPath(PATH)) {
      String fullPath = PATH.concat("/").concat(s);
      String data = new String(ZkConnection.client.getData().forPath(fullPath));
      System.out.println(data);
      if (StringUtil.isEmpty(data)) {
        LOG.debug("实现原理是xian服务注册会在unit和group节点data上写入其定义数据,如果没有定义数据的,那么一定是脏节点");
        ZkConnection.client.delete().forPath(fullPath);
      }
    }
  } finally {
    ZkConnection.close();
  }
  handler.handle(UnitResponse.createSuccess());
}
info.xiancloud.zookeeperZkConnectionstart

Popular methods of ZkConnection

  • close
  • getZkConnStr
  • isConnected

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now