@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;
}
});