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

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


    }

    @Test
    public void testInit() {
        MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
        boolean running = mainstemMonitor.check();
        want.bool(running).is(true);

        try {
            mainstemMonitor.waitForActive();
        } catch (InterruptedException e) {
View Full Code Here


    }

    @Test
    public void testRelease() {
        MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
        boolean running = mainstemMonitor.check();
        want.bool(running).is(true);

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

    }

    @Test
    public void testManualRelease() {
        MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
        boolean running = mainstemMonitor.check();
        want.bool(running).is(true);
        mainstemMonitor.setDelayTime(5);

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

    /**
     * 检查下当前的mainstem是否可以运行(在await获取成功后,每次执行业务之前进行check)
     */
    public boolean check(Long pipelineId) {
        MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
        return mainstemMonitor.check();
    }

    /**
     * 更新mainStem的同步状态数据
     */
 
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.