Package com.alibaba.otter.shared.arbitrate.impl.setl.monitor

Examples of com.alibaba.otter.shared.arbitrate.impl.setl.monitor.MainstemMonitor.waitForActive()


        MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
        boolean running = mainstemMonitor.check();
        want.bool(running).is(true);

        try {
            mainstemMonitor.waitForActive();
        } catch (InterruptedException e) {
            want.fail();
        }

        ArbitrateFactory.destory(pipelineId);
View Full Code Here


        boolean release = mainstemMonitor.releaseMainstem();// 模拟一次断网,
        want.bool(release).is(true);

        long start = System.currentTimeMillis();
        try {
            mainstemMonitor.waitForActive();
        } catch (InterruptedException e) {
            want.fail();
        }
        want.number(System.currentTimeMillis() - start).isLe(1000L);
        ArbitrateFactory.destory(pipelineId);
View Full Code Here

        switchWarmup(channelId, pipelineId);
        sleep(1000L); // 等manual release被响应

        long start = System.currentTimeMillis();
        try {
            mainstemMonitor.waitForActive();
        } catch (InterruptedException e) {
            want.fail();
        }
        want.number(System.currentTimeMillis() - start).isGe(4000L);
        ArbitrateFactory.destory(pipelineId);
View Full Code Here

        } else if (isRuning == false) {
            if (!status.isStart()) {
                permitMonitor.waitForChannelPermit(); // 阻塞等待挂起
            }
            MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
            mainstemMonitor.waitForActive();// 等待自己成为active

            status = permitMonitor.getChannelPermit(false);
            if (status.isStart()) {
                return;
            } else {
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.