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

Examples of com.alibaba.otter.shared.common.model.config.pipeline.PipelineParameter.LoadBanlanceAlgorithm


*/
public class LoadBalanceFactory {

    public static Node getNextExtractNode(Long pipelineId) throws InterruptedException {
        Pipeline pipeline = ArbitrateConfigUtils.getPipeline(pipelineId);
        LoadBanlanceAlgorithm loadBanlanceAlgorithm = pipeline.getParameters().getLbAlgorithm();
        LoadBalance loadbalance = null;
        if (loadBanlanceAlgorithm.isRandom()) {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, ExtractRandomLoadBanlance.class);
        } else if (loadBanlanceAlgorithm.isRoundRbin()) {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, ExtractRoundRobinLoadBalance.class);
        } else {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, ExtractStickLoadBalance.class);
        }
        Node node = loadbalance.next();// 获取下一个处理节点信息
View Full Code Here


        return node;
    }

    public static Node getNextTransformNode(Long pipelineId) throws InterruptedException {
        Pipeline pipeline = ArbitrateConfigUtils.getPipeline(pipelineId);
        LoadBanlanceAlgorithm loadBanlanceAlgorithm = pipeline.getParameters().getLbAlgorithm();
        LoadBalance loadbalance = null;
        if (loadBanlanceAlgorithm.isRandom()) {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, TransformRandomLoadBanlance.class);
        } else if (loadBanlanceAlgorithm.isRoundRbin()) {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, TransformRoundRobinLoadBalance.class);
        } else {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, TransformStickLoadBalance.class);
        }
        Node node = loadbalance.next();// 获取下一个处理节点信息
View Full Code Here

TOP

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

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.