master
parent
b12705e6c5
commit
458b6747dd
|
@ -21,11 +21,6 @@ public class GatewayController {
|
|||
@Autowired
|
||||
private GatewayLoadService service;
|
||||
|
||||
@GetMapping("/locd/node")
|
||||
public Result<String> loadNode(){
|
||||
return Result.success(service.loadNode());
|
||||
}
|
||||
|
||||
@PostMapping("/getAssignedServer")
|
||||
public Result<String> getAssignedServer(){
|
||||
return service.getAssignedServer();
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import com.loadCenter.aliyun.gateway.model.NodeLoadNum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName GatewayIpLoadCountKey
|
||||
* @Description 缓存实例IP和负载量
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 22:29 2024/4/19
|
||||
*/
|
||||
@Component
|
||||
public class GatewayIpLoadCountKey extends GatewayNodeCacheAbs<String> {
|
||||
private final static String gatewayIpLoadCountKey = "ipAndCount";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加缓存数据
|
||||
* @param ipAndLoadCounts
|
||||
*/
|
||||
public void put(List<NodeLoadNum> ipAndLoadCounts) {
|
||||
this.remove();
|
||||
redisService.setCacheList(encode(gatewayIpLoadCountKey), ipAndLoadCounts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
* @return
|
||||
*/
|
||||
public List<NodeLoadNum> get() {
|
||||
List<Object> cacheList = redisService.getCacheList(encode(gatewayIpLoadCountKey));
|
||||
return JSON.parseArray(JSON.toJSONString(cacheList), NodeLoadNum.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
*/
|
||||
public void remove() {
|
||||
redisService.deleteObject(encode(gatewayIpLoadCountKey));
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayNodeCacheAbs
|
||||
* @Description 网关节点缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 16:16 2024/4/18
|
||||
*/
|
||||
@Component
|
||||
public class GatewayLoadNodeCache extends GatewayNodeCacheAbs {
|
||||
|
||||
private final static String GATEWAY_LOAD_NODE_KEY="node";
|
||||
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 存放负载集合
|
||||
* @param nodeList 节点权重集合
|
||||
*/
|
||||
public void put(List<String> nodeList){
|
||||
redisService.deleteObject(encode(GATEWAY_LOAD_NODE_KEY));
|
||||
redisService.setCacheList(encode(GATEWAY_LOAD_NODE_KEY),nodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有负载节点
|
||||
* @return 负载节点集合
|
||||
*/
|
||||
public List<String> get() {
|
||||
return redisService.getCacheList(encode(GATEWAY_LOAD_NODE_KEY));
|
||||
}
|
||||
|
||||
|
||||
public String getByIndex(Long index){
|
||||
if(index == null || index >100){
|
||||
throw new RuntimeException("下标违法,0-100");
|
||||
}
|
||||
return redisService.getCacheListValue(encode(GATEWAY_LOAD_NODE_KEY),index);
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
/**
|
||||
* @ClassName GatewayLoadSeriesCache
|
||||
* @Description 网关负载序列
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 19:47 2024/4/18
|
||||
*/
|
||||
@Component
|
||||
public class GatewayLoadSeriesCache extends GatewayNodeCacheAbs<String> {
|
||||
private final static String GATEWAY_LOAD_SERIES_KEY = "series";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* bean创建完成之后执行方法
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
redisService.setCacheObject(encode(GATEWAY_LOAD_SERIES_KEY),0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前序列值
|
||||
* @return 序列值
|
||||
*/
|
||||
public Long get(){
|
||||
return redisService.getCacheObject(encode(GATEWAY_LOAD_SERIES_KEY));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自增序列值
|
||||
* @return 自增序列值
|
||||
*/
|
||||
public Long incrementAndGet() {
|
||||
return redisService.increment(encode(GATEWAY_LOAD_SERIES_KEY),1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置序列值
|
||||
*/
|
||||
public void reset() {
|
||||
this.init();
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import com.loadCenter.aliyun.gateway.model.GatewayNodeInfo;
|
||||
import org.springframework.stereotype.Component;
|
||||
/**
|
||||
* @ClassName GatewayNodeCache
|
||||
* @Description 网关节点缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 19:50 2024/4/18
|
||||
*/
|
||||
@Component
|
||||
public class GatewayNodeCache extends GatewayNodeCacheAbs<String> {
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:node:info:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加缓存数据
|
||||
* @param gatewayNodeInfo 节点信息
|
||||
*/
|
||||
public void put(GatewayNodeInfo gatewayNodeInfo){
|
||||
redisService.setCacheObject(encode(gatewayNodeInfo.getNodeId()),gatewayNodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
* @param nodeId 节点ID
|
||||
* @return 节点信息
|
||||
*/
|
||||
public GatewayNodeInfo get(String nodeId){
|
||||
return redisService.getCacheObject(encode(nodeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网关节点
|
||||
* @param nodeId 节点ID
|
||||
*/
|
||||
public void remove(String nodeId) {
|
||||
redisService.deleteObject(encode(nodeId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayNodeIDCache
|
||||
* @Description 节点id缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 22:31 2024/4/19
|
||||
*/
|
||||
@Component
|
||||
public class GatewayNodeIDCache extends GatewayNodeCacheAbs<String> {
|
||||
private final static String gatewayLoadNodeIDKey = "NodeId";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加
|
||||
* @param gatewayNodeIds
|
||||
*/
|
||||
public void put(List<String> gatewayNodeIds) {
|
||||
this.remove();
|
||||
redisService.setCacheList(encode(gatewayLoadNodeIDKey), gatewayNodeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return
|
||||
*/
|
||||
public List<String> get() {
|
||||
return redisService.getCacheList(encode(gatewayLoadNodeIDKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public void remove() {
|
||||
redisService.deleteObject(encode(gatewayLoadNodeIDKey));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayNodeIPCache
|
||||
* @Description 负载节点IP缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 22:35 2024/4/19
|
||||
*/
|
||||
@Component
|
||||
public class GatewayNodeIPCache extends GatewayNodeCacheAbs<String> {
|
||||
private final static String gatewayLoadNodeIPKey = "NodeIp";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加缓存数据
|
||||
* @param gatewayNodeIps
|
||||
*/
|
||||
public void put(List<String> gatewayNodeIps) {
|
||||
this.remove();
|
||||
redisService.setCacheList(encode(gatewayLoadNodeIPKey), gatewayNodeIps);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
* @return
|
||||
*/
|
||||
public List<String> get() {
|
||||
return redisService.getCacheList(encode(gatewayLoadNodeIPKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存数据
|
||||
*/
|
||||
public void remove() {
|
||||
redisService.deleteObject(encode(gatewayLoadNodeIPKey));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import com.loadCenter.aliyun.gateway.model.GatewayNodeInfo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayNodeInfoCache
|
||||
* @Description 网关节点缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 22:34 2024/4/19
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class GatewayNodeInfoCache extends GatewayNodeCacheAbs<String> {
|
||||
//redis Key
|
||||
private final static String gatewayLoadInfoKey = "node:";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加缓存数据
|
||||
* @param gatewayNodeInfos
|
||||
*/
|
||||
public void put(List<GatewayNodeInfo> gatewayNodeInfos) {
|
||||
this.remove();
|
||||
redisService.setCacheList(encode(gatewayLoadInfoKey), gatewayNodeInfos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
* @return
|
||||
*/
|
||||
public List<GatewayNodeInfo> get() {
|
||||
List<Object> cacheList = redisService.getCacheList(encode(gatewayLoadInfoKey));
|
||||
|
||||
return JSON.parseArray(JSON.toJSONString(cacheList), GatewayNodeInfo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存数据
|
||||
*/
|
||||
public void remove() {
|
||||
redisService.deleteObject(encode(gatewayLoadInfoKey));
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayNodeScoreCache
|
||||
* @Description 网关节点分数
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 19:57 2024/4/18
|
||||
*/
|
||||
public class GatewayNodeScoreCache extends GatewayNodeCacheAbs<String> {
|
||||
@Override
|
||||
public String getPre() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayNodeSetVinCache
|
||||
* @Description 网关而几点存储VIN详情
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 19:58 2024/4/18
|
||||
*/
|
||||
public class GatewayNodeSetVinCache extends GatewayNodeCacheAbs<String> {
|
||||
@Override
|
||||
public String getPre() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayOrderCache
|
||||
* @Description 节点IP序列缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 22:36 2024/4/19
|
||||
*/
|
||||
@Component
|
||||
public class GatewayOrderCache extends GatewayNodeCacheAbs<String> {
|
||||
private final static String gatewayOrderCache = "order";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加缓存数据
|
||||
* @param gatewayNodeOrders
|
||||
*/
|
||||
public void put(List<String> gatewayNodeOrders) {
|
||||
this.remove();
|
||||
redisService.setCacheList(encode(gatewayOrderCache), gatewayNodeOrders);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取全部缓存数据
|
||||
* @return
|
||||
*/
|
||||
public List<String> get() {
|
||||
return redisService.getCacheList(encode(gatewayOrderCache));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存数据
|
||||
*/
|
||||
public void remove() {
|
||||
redisService.deleteObject(encode(gatewayOrderCache));
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayVehicleLineNodeCache
|
||||
* @Description 网关车辆对应网关节点
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 19:58 2024/4/18
|
||||
*/
|
||||
public class GatewayVehicleLineNodeCache extends GatewayNodeCacheAbs<String> {
|
||||
@Override
|
||||
public String getPre() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.loadCenter.aliyun.gateway.cache;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs;
|
||||
import com.loadCenter.aliyun.gateway.model.NodeLoadWeight;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GatewayWeightCache
|
||||
* @Description 缓存IP和权重
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 22:37 2024/4/19
|
||||
*/
|
||||
@Component
|
||||
public class GatewayWeightCache extends GatewayNodeCacheAbs<String> {
|
||||
private final static String gatewayWeightKey = "ipAndWeight";
|
||||
|
||||
@Override
|
||||
public String getPre() {
|
||||
return "gateway:load:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加缓存数据
|
||||
* @param ipAndWeights
|
||||
*/
|
||||
public void put(List<NodeLoadWeight> ipAndWeights) {
|
||||
this.remove();
|
||||
redisService.setCacheList(encode(gatewayWeightKey), ipAndWeights);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
* @return
|
||||
*/
|
||||
public List<NodeLoadWeight> get() {
|
||||
List<Object> cacheList = redisService.getCacheList(encode(gatewayWeightKey));
|
||||
return JSON.parseArray(JSON.toJSONString(cacheList), NodeLoadWeight.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存数据
|
||||
*/
|
||||
public void remove() {
|
||||
redisService.deleteObject(encode(gatewayWeightKey));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package com.loadCenter.aliyun.handle;
|
||||
|
||||
import com.aliyun.ecs20140526.models.DescribeInstancesResponseBody;
|
||||
import com.loadCenter.aliyun.common.aliyun.service.AliYunEcsService;
|
||||
import com.loadCenter.aliyun.common.utils.MqttUtil;
|
||||
import com.loadCenter.aliyun.common.utils.UserUtil;
|
||||
import com.loadCenter.aliyun.gateway.cache.*;
|
||||
import com.loadCenter.aliyun.gateway.model.GatewayNodeInfo;
|
||||
import com.loadCenter.aliyun.gateway.model.NodeLoadNum;
|
||||
import com.loadCenter.aliyun.gateway.model.NodeLoadWeight;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName HandleCache
|
||||
* @Description 操作缓存
|
||||
* @Author ZeJinG.Su
|
||||
* @Date 20:03 2024/4/19
|
||||
*/
|
||||
|
||||
@Log4j2
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class HandleCache {
|
||||
@Autowired
|
||||
private MqttUtil mqttUtil;
|
||||
|
||||
@Autowired
|
||||
private AliYunEcsService aliYunEcsService;
|
||||
|
||||
/*
|
||||
* 操作网关节点缓存
|
||||
* */
|
||||
@Autowired
|
||||
private GatewayNodeInfoCache gatewayNodeInfoCache;
|
||||
|
||||
/*
|
||||
* 操作负载节点IP缓存
|
||||
* */
|
||||
@Autowired
|
||||
private GatewayNodeIPCache gatewayNodeIpCache;
|
||||
|
||||
/*
|
||||
* 操作负载节点ID缓存
|
||||
* */
|
||||
@Autowired
|
||||
private GatewayNodeIDCache gatewayNodeIdCache;
|
||||
|
||||
/*
|
||||
* 操作实例IP和负载量缓存
|
||||
* */
|
||||
@Autowired
|
||||
private GatewayIpLoadCountKey gatewayIpLoadCountKey;
|
||||
|
||||
/*
|
||||
* 操作实例IP和权重缓存
|
||||
* */
|
||||
@Autowired
|
||||
private GatewayWeightCache gatewayWeightCache;
|
||||
|
||||
/*
|
||||
* 操作实例IP序列缓存
|
||||
* */
|
||||
@Autowired
|
||||
private GatewayOrderCache gatewayOrderCache;
|
||||
|
||||
// //刷新所有的缓存
|
||||
// @Scheduled(cron = "0/2 * * * * ?")
|
||||
// public void refreshAllCache() {
|
||||
// this.getNodeIDList();
|
||||
// this.getNodeInfos();
|
||||
// this.getNodeIPList();
|
||||
// this.getIpAndLoadCounts();
|
||||
// this.getIpAndWeights();
|
||||
// this.getLoadNodeOrderListByIpAndWeights();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -9,11 +9,7 @@ import com.loadCenter.aliyun.common.aliyun.config.Result;
|
|||
* @Date 22:30 2024/4/18
|
||||
*/
|
||||
public interface GatewayLoadService {
|
||||
/**
|
||||
* 负载节点
|
||||
* @return 返回负载节点
|
||||
*/
|
||||
String loadNode();
|
||||
|
||||
|
||||
Result<String> getAssignedServer();
|
||||
|
||||
|
|
|
@ -2,9 +2,6 @@ package com.loadCenter.aliyun.service.impl;
|
|||
|
||||
|
||||
import com.loadCenter.aliyun.common.aliyun.config.Result;
|
||||
import com.loadCenter.aliyun.gateway.cache.GatewayLoadNodeCache;
|
||||
import com.loadCenter.aliyun.gateway.cache.GatewayLoadSeriesCache;
|
||||
import com.loadCenter.aliyun.gateway.cache.GatewayNodeCache;
|
||||
import com.loadCenter.aliyun.gateway.model.GatewayNodeInfo;
|
||||
import com.loadCenter.aliyun.service.GatewayLoadService;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -16,38 +13,6 @@ public class GatewayLoadServiceImpl implements GatewayLoadService {
|
|||
private final Long nodeLength = 100L;
|
||||
|
||||
|
||||
/**
|
||||
* 负载信息
|
||||
*/
|
||||
private final GatewayLoadNodeCache gatewayLoadNodeCache;
|
||||
|
||||
/**
|
||||
* 负载序列
|
||||
*/
|
||||
private final GatewayLoadSeriesCache gatewayLoadSeriesCache;
|
||||
|
||||
/**
|
||||
* 节点信息
|
||||
*/
|
||||
private final GatewayNodeCache gatewayNodeCache;
|
||||
|
||||
/**
|
||||
* 获得负载节点外网地址
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String loadNode() {
|
||||
Long seriesLoad = gatewayLoadSeriesCache.incrementAndGet();
|
||||
|
||||
Long seriesLoadIndex= seriesLoad % nodeLength;
|
||||
|
||||
String loadNodeId = gatewayLoadNodeCache.getByIndex(seriesLoadIndex);
|
||||
|
||||
GatewayNodeInfo gatewayNodeInfo = gatewayNodeCache.get(loadNodeId);
|
||||
|
||||
//返回外网节点
|
||||
return gatewayNodeInfo.getPublicIdAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> getAssignedServer() {
|
||||
|
|
Loading…
Reference in New Issue