Package com.alipay.bluewhale.core.callback

Examples of com.alipay.bluewhale.core.callback.RunnableCallback


    @Override
    public void run() {
        try {
            while (manager.isRunning()) {
                RunnableCallback r = null;
                try {
                    r = manager.take();
                } catch (InterruptedException e) {
                    LOG.info("Failed to get ArgsRunable from EventManager queue");
                }

                if (r == null) {
                    continue;
                }

                r.run();
                Exception e = r.error();
                if (e != null) {
                    throw e;
                }
                manager.proccessinc();
View Full Code Here


    public boolean isRunning() {
        return isrunning.get();
    }

    public RunnableCallback take() throws InterruptedException {
        RunnableCallback event = queue.take();
        return event;
    }
View Full Code Here

          List<String> toks = PathUtils.tokenize_path(path);
          int size = toks.size();
          if (size >= 1) {
            String params = null;
            String root = toks.get(0);
            RunnableCallback fn = null;
            if (root.equals(Cluster.ASSIGNMENTS_ROOT)) {
              if (size == 1) {
                //����null������oldvalue
                fn = assignments_callback.getAndSet(null);
              } else {
                params = toks.get(1);
                fn = assignment_info_callback.remove(params);
              }

            } else if (root.equals(Cluster.SUPERVISORS_ROOT)) {
              fn = supervisors_callback.getAndSet(null);
            }else if (root.equals(Cluster.DRPCS_ROOT)) {
                fn = drpcs_callback.getAndSet(null);
            } else if (root.equals(Cluster.STORMS_ROOT) && size > 1) {
              params = toks.get(1);
              fn = storm_base_callback.remove(params);
            } else if (root.equals(Cluster.HIGO_ROOT) && size > 1) {
              params = toks.get(1);
              fn = higo_base_callback.remove(params);
            } else {
              StormUtils.halt_process(30,
                  "Unknown callback for subtree " + path);
            }
           
            if (fn != null) {
              //FIXME �δ�������������������
              //fn.setArgs(params, zkEventTypes, path);
              fn.run();
            }
          }
        } else {
          LOG.error("the size of param is not 2");
        }
View Full Code Here

TOP

Related Classes of com.alipay.bluewhale.core.callback.RunnableCallback

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.