Examples of IZkDataListener


Examples of org.I0Itec.zkclient.IZkDataListener

        String uriProducer = producerS4R.toURI().toString();

        initializeS4Node();

        final BlockingQueue<Object> queue = new ArrayBlockingQueue<Object>(1);
        zkClient.subscribeDataChanges("/s4/classLoader", new IZkDataListener() {

            @Override
            public void handleDataDeleted(String dataPath) throws Exception {
            }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

        this.serverData = serverData;
    }

    public ServerRunningMonitor(){
        // 创建父节点
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put("destination", destination);
                ServerRunningData runningData = JsonUtils.unmarshalFromByte((byte[]) data, ServerRunningData.class);
                if (!isMine(runningData.getAddress())) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

    private ScheduledExecutorService   delayExector = Executors.newScheduledThreadPool(1);
    private ClientRunningListener      listener;
    private int                        delayTime    = 5;

    public ClientRunningMonitor(){
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put("destination", destination);
                ClientRunningData runningData = JsonUtils.unmarshalFromByte((byte[]) data, ClientRunningData.class);
                if (!isMine(activeData.getAddress())) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

                initClusters(currentChilds);
            }

        };

        dataListener = new IZkDataListener() {

            public void handleDataDeleted(String dataPath) throws Exception {
                runningAddress = null;
            }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

    private ScheduledExecutorService   delayExector = Executors.newScheduledThreadPool(1);
    private ClientRunningListener      listener;
    private int                        delayTime    = 5;

    public ClientRunningMonitor(){
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put("destination", destination);
                ClientRunningData runningData = JsonUtils.unmarshalFromByte((byte[]) data, ClientRunningData.class);
                if (!isMine(runningData.getAddress())) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

        this.serverData = serverData;
    }

    public ServerRunningMonitor(){
        // 创建父节点
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put("destination", destination);
                ServerRunningData runningData = JsonUtils.unmarshalFromByte((byte[]) data, ServerRunningData.class);
                if (!isMine(runningData.getAddress())) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

    private ScheduledExecutorService   delayExector = Executors.newScheduledThreadPool(1);
    private ClientRunningListener      listener;
    private int                        delayTime    = 5;

    public ClientRunningMonitor(){
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put("destination", destination);
                ClientRunningData runningData = JsonUtils.unmarshalFromByte((byte[]) data, ClientRunningData.class);
                if (!isMine(activeData.getAddress())) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

    public PermitMonitor(Long pipelineId){
        super(pipelineId);
        existOpposite = (ArbitrateConfigUtils.getOppositePipeline(getPipelineId()) != null);
        // 开始同步
        channelDataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                initChannelStatus((byte[]) data);
            }

            public void handleDataDeleted(String dataPath) throws Exception {
                channelStatus = ChannelStatus.STOP;
                permitSem();
            }
        };
        String path = StagePathUtils.getChannel(getPipelineId());
        zookeeper.subscribeDataChanges(path, channelDataListener);

        mainstemDataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                initMainStemStatus((byte[]) data);
            }

            public void handleDataDeleted(String dataPath) throws Exception {
                // mainstem节点挂了后,状态直接修改为taking
                mainStemStatus = MainStemEventData.Status.TAKEING;
                permitSem();
            }
        };

        path = StagePathUtils.getMainStem(getPipelineId());
        zookeeper.subscribeDataChanges(path, mainstemDataListener);

        initChannelStatus();
        initMainStemStatus();
        // syncChannelStatus();
        // syncMainStemStatus();
        if (existOpposite) {
            oppositeMainstemDataListener = new IZkDataListener() {

                public void handleDataChange(String dataPath, Object data) throws Exception {
                    initOppositeMainStemStatus((byte[]) data);
                }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

    private List<MainstemListener>     listeners    = Collections.synchronizedList(new ArrayList<MainstemListener>());

    public MainstemMonitor(Long pipelineId){
        super(pipelineId);
        // initMainstem();
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put(ArbitrateConstants.splitPipelineLogFileKey, String.valueOf(getPipelineId()));
                MainStemEventData mainStemData = JsonUtils.unmarshalFromByte((byte[]) data, MainStemEventData.class);
                if (!isMine(mainStemData.getNid())) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkDataListener

        this.serverData = serverData;
    }

    public ServerRunningMonitor(){
        // 创建父节点
        dataListener = new IZkDataListener() {

            public void handleDataChange(String dataPath, Object data) throws Exception {
                MDC.put("destination", destination);
                ServerRunningData runningData = JsonUtils.unmarshalFromByte((byte[]) data, ServerRunningData.class);
                if (!isMine(runningData.getAddress())) {
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.