Package com.alibaba.otter.shared.common.model.config.pipeline

Examples of com.alibaba.otter.shared.common.model.config.pipeline.Pipeline


            @Mock
            public Channel getChannelByChannelId(Long channelId) {
                Channel channel = new Channel();
                channel.setId(channelId);
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(local));
                pipeline.setExtractNodes(Arrays.asList(local));
                pipeline.setLoadNodes(Arrays.asList(local));
                pipeline.getParameters().setArbitrateMode(arbitrateMode);
                channel.setPipelines(Arrays.asList(pipeline));
                return channel;
            }

            @Mock
            public Pipeline getPipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(local));
                pipeline.setExtractNodes(Arrays.asList(local));
                pipeline.setLoadNodes(Arrays.asList(local));
                pipeline.getParameters().setArbitrateMode(arbitrateMode);
                return pipeline;
            }

            @Mock
            public Long getCurrentNid() {
                return nid;
            }

            @Mock
            public int getParallelism(Long pipelineId) {
                return 3;// 并行度
            }

            @Mock
            public Pipeline getOppositePipeline(Long pipelineId) {
                return null;
            }

            @Mock
            public Channel getChannel(Long pipelineId) {
                Channel channel = new Channel();
                channel.setId(channelId);
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.getParameters().setArbitrateMode(arbitrateMode);
                channel.setPipelines(Arrays.asList(pipeline));
                return channel;
            }

        });
View Full Code Here


        identity.setProcessId(100L);
    }

    @Test
    public void test_global_row() {
        final Pipeline pipeline = new Pipeline();
        pipeline.setId(100L);
        pipeline.getParameters().setSyncMode(SyncMode.ROW);
        pipeline.getParameters().setSyncConsistency(SyncConsistency.MEDIA);// 设置为全局

        int start = RandomUtils.nextInt();
        int count = 10;
        List<DataMediaPair> pairs = getDataMediaPairForMysql(start, count);
        pipeline.setPairs(pairs);

        new NonStrictExpectations() {

            {
                configClientService.findPipeline(100L);
View Full Code Here

        databaseExtractor.extract(new DbBatch(rowBatch));
        want.number(rowBatch.getDatas().size()).isEqualTo(count);
    }

    public void test_override_field() {
        final Pipeline pipeline = new Pipeline();
        pipeline.setId(100L);
        pipeline.getParameters().setSyncMode(SyncMode.FIELD);
        pipeline.getParameters().setSyncConsistency(SyncConsistency.BASE);// 设置为全局

        int start = RandomUtils.nextInt();
        int count = 10;
        List<DataMediaPair> pairs = getDataMediaPairForOracle(start, count);
        pipeline.setPairs(pairs);

        new NonStrictExpectations() {

            {
                configClientService.findPipeline(100L);
View Full Code Here

            @Mock
            public Channel getChannelByChannelId(Long channelId) {
                Channel channel = new Channel();
                channel.setId(channelId);
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(local));
                pipeline.setExtractNodes(Arrays.asList(local));
                pipeline.setLoadNodes(Arrays.asList(local));
                channel.setPipelines(Arrays.asList(pipeline));
                return channel;
            }

            @Mock
            public Channel getChannel(Long pipelineId) {
                Channel channel = new Channel();
                channel.setId(channelId);
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(local));
                pipeline.setExtractNodes(Arrays.asList(local));
                pipeline.setLoadNodes(Arrays.asList(local));
                channel.setPipelines(Arrays.asList(pipeline));
                return channel;
            }

            @Mock
            public Pipeline getPipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setSelectNodes(Arrays.asList(local));
                pipeline.setExtractNodes(Arrays.asList(local));
                pipeline.setLoadNodes(Arrays.asList(local));
                return pipeline;
            }

            @Mock
            public Pipeline getOppositePipeline(Long pipelineId) {
View Full Code Here

                return channel;
            }

            @Mock
            public Pipeline getOppositePipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                return pipeline;
            }

        });
View Full Code Here

                return channel;
            }

            @Mock
            public Pipeline getOppositePipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                return pipeline;
            }

        });
View Full Code Here

                return 3;// 并行度
            }

            @Mock
            public Pipeline getPipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(local));
                pipeline.setExtractNodes(Arrays.asList(local));
                pipeline.setLoadNodes(Arrays.asList(local));
                return pipeline;
            }

            @Mock
            public Long getCurrentNid() {
View Full Code Here

            @Mock
            public Channel getChannelByChannelId(Long channelId) {
                Channel channel = new Channel();
                channel.setId(channelId);
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(one));
                pipeline.setExtractNodes(Arrays.asList(one));
                pipeline.setLoadNodes(Arrays.asList(two));
                channel.setPipelines(Arrays.asList(pipeline));
                return channel;
            }

            @Mock
            public Pipeline getPipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(Arrays.asList(one));
                pipeline.setExtractNodes(Arrays.asList(one));
                pipeline.setLoadNodes(Arrays.asList(two));
                return pipeline;
            }

            @Mock
            public Long getCurrentNid() {
                return oneNid;
            }

            @Mock
            public int getParallelism(Long pipelineId) {
                return 3;// 并行度
            }

            @Mock
            public Pipeline getOppositePipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(oppositePipelineId);
                pipeline.setSelectNodes(Arrays.asList(two));
                pipeline.setExtractNodes(Arrays.asList(two));
                pipeline.setLoadNodes(Arrays.asList(one));
                return pipeline;
            }

            @Mock
            public Channel getChannel(Long pipelineId) {
                Channel channel = new Channel();
                channel.setId(channelId);

                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);

                Pipeline oppositePipeline = new Pipeline();
                oppositePipeline.setId(oppositePipelineId);
                channel.setPipelines(Arrays.asList(pipeline, oppositePipeline));
                return channel;
            }

        });
View Full Code Here

        // 初始化节点
        Mockit.setUpMock(ArbitrateConfigUtils.class, new Object() {

            @Mock
            public Pipeline getPipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(sourceList);
                pipeline.setExtractNodes(sourceList);
                pipeline.setLoadNodes(targetList);

                return pipeline;
            }

        });
View Full Code Here

        // 初始化节点
        Mockit.setUpMock(ArbitrateConfigUtils.class, new Object() {

            @Mock
            public Pipeline getPipeline(Long pipelineId) {
                Pipeline pipeline = new Pipeline();
                pipeline.setId(pipelineId);
                pipeline.setSelectNodes(sourceList);
                pipeline.setExtractNodes(sourceList);
                pipeline.setLoadNodes(targetList);
                return pipeline;
            }

        });
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.model.config.pipeline.Pipeline

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.