Package com.alibaba.otter.shared.arbitrate.model

Examples of com.alibaba.otter.shared.arbitrate.model.SyncStatusEventData


    private ToolArbitrateEvent toolEvent;

    @Test
    public void test_simple() {
        toolEvent = new ToolArbitrateEvent();
        SyncStatusEventData eventData = toolEvent.fetch(pipelineId);
        eventData.setPipelineId(pipelineId);
        eventData.addStatus(new SyncStatus(false, 1000));
        eventData.addStatus(new SyncStatus(true, 1001));
        toolEvent.single(eventData);

        eventData = toolEvent.fetch(pipelineId);
        want.object(eventData).notNull();
    }
View Full Code Here


    public SyncStatusEventData fetch(Long pipelineId) {
        String path = StagePathUtils.getPipeline(pipelineId);
        try {
            byte[] bytes = zookeeper.readData(path);
            if (bytes == null || bytes.length == 0) {
                SyncStatusEventData evnetData = new SyncStatusEventData();
                evnetData.setPipelineId(pipelineId);
                return evnetData;
            } else {
                return JsonUtils.unmarshalFromByte(bytes, SyncStatusEventData.class);
            }
        } catch (ZkException e) {
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.arbitrate.model.SyncStatusEventData

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.