use of com.alibaba.otter.shared.common.model.config.pipeline.PipelineParameter.LoadBanlanceAlgorithm in project otter by alibaba.
the class LoadBalanceFactory method getNextExtractNode.
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();
return node;
}
use of com.alibaba.otter.shared.common.model.config.pipeline.PipelineParameter.LoadBanlanceAlgorithm in project otter by alibaba.
the class LoadBalanceFactory method getNextTransformNode.
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();
return node;
}
Aggregations