Examples of IZkChildListener


Examples of org.I0Itec.zkclient.IZkChildListener

    final AtomicBoolean success = new AtomicBoolean(true);
    for (int i = 0; i < 5; i++) {
      String instanceName = "localhost_" + (12918 + i);
      String msgPath = PropertyPathConfig.getPath(PropertyType.MESSAGES, clusterName, instanceName);

      _gZkClient.subscribeChildChanges(msgPath, new IZkChildListener() {

        @Override
        public void handleChildChange(String parentPath, List<String> currentChilds)
            throws Exception {
          if (currentChilds != null && currentChilds.size() > 1) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

    {
      String instanceName = "localhost_" + (12918 + i);
      String msgPath =
          PropertyPathConfig.getPath(PropertyType.MESSAGES, clusterName, instanceName);

      _gZkClient.subscribeChildChanges(msgPath, new IZkChildListener()
      {

        @Override
        public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception
        {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

    {
      String instanceName = "localhost_" + (12918 + i);
      String msgPath =
          PropertyPathConfig.getPath(PropertyType.MESSAGES, clusterName, instanceName);

      _gZkClient.subscribeChildChanges(msgPath, new IZkChildListener()
      {

        @Override
        public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception
        {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

        zkClient.setZkSerializer(new ZNRecordSerializer());
        List<String> processes = zkClient.getChildren("/s4/clusters/" + PRODUCER_CLUSTER + "/process");
        Assert.assertTrue(processes.size() == 0);
        final CountDownLatch signalProcessesReady = new CountDownLatch(1);

        zkClient.subscribeChildChanges("/s4/clusters/" + PRODUCER_CLUSTER + "/process", new IZkChildListener() {

            @Override
            public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {
                if (currentChilds.size() == 1) {
                    signalProcessesReady.countDown();
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

    public static CountDownLatch getConsumerReadySignal(String streamName) {
        final CountDownLatch signalAppReady = new CountDownLatch(1);

        ZkClient zkClient = new ZkClient("localhost:" + CoreTestUtils.ZK_PORT);
        // TODO check a proper app state variable. This is hacky
        zkClient.subscribeChildChanges("/s4/streams/" + streamName + "/consumers", new IZkChildListener() {

            @Override
            public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {
                if (currentChilds.size() == 1) {
                    signalAppReady.countDown();
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

  public void doClose() {
    client.close();
  }

  public IZkChildListener createTargetChildListener(String path, final ChildListener listener) {
    return new IZkChildListener() {
      public void handleChildChange(String parentPath, List<String> currentChilds)
          throws Exception {
        listener.childChanged(parentPath, currentChilds);
      }
    };
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

    private volatile List<InetSocketAddress> currentAddress = new ArrayList<InetSocketAddress>();
    private volatile InetSocketAddress       runningAddress = null;

    public ClusterNodeAccessStrategy(String destination, ZkClientx zkClient){
        this.zkClient = zkClient;
        childListener = new IZkChildListener() {

            public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {
                initClusters(currentChilds);
            }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

  public void close() {
    client.close();
  }

  public IZkChildListener createTargetChildListener(String path, final ChildListener listener) {
    return new IZkChildListener() {
      public void handleChildChange(String parentPath, List<String> currentChilds)
          throws Exception {
        listener.childChanged(parentPath, currentChilds);
      }
    };
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

    private TerminProcessQueue  waitProcessIds = new TerminProcessQueue();                    // 记录对应的终结信号数据,从小到大的排序
    private IZkChildListener    childListener;

    public TerminMonitor(Long pipelineId){
        super(pipelineId);
        childListener = new IZkChildListener() {

            public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {
                if (currentChilds != null) {
                    initTermin(currentChilds);
                }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkChildListener

    private List<NodeListener>  listeners  = Collections.synchronizedList(new ArrayList<NodeListener>());
    private volatile List<Long> aliveNodes = new ArrayList<Long>();                                      // se模块存活的节点
    private IZkChildListener    childListener;

    public NodeMonitor(){
        childListener = new IZkChildListener() {

            public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {
                if (currentChilds != null) {
                    initNodes(currentChilds);
                }
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.