TSF全链路灰度发布流程图
2021-07-16 15:11:43 7 举报
TSF全链路灰度发布流程图
作者其他创作
大纲/内容
return serverList;
LaneGroup: private String laneGroupId; private String laneId; private String groupId; private String groupName; private String applicationId; private String applicationName; private String namespaceId; private String namespaceName; private boolean entrance; private Integer status; private Timestamp createTime; private Timestamp updateTime;
TsfUnitCoreUtil.isTransToOtherNamespace()判断是否跨命名空间
LaneRule: private String ruleId; private String ruleName; private Integer priority; private String remark; private List<LaneRuleTag> ruleTagList; private RuleTagRelationship ruleTagRelationship; private String laneId; private boolean enable; private Timestamp createTime; private Timestamp updateTime;
String laneId = TsfLaneIdHolder.getLaneId();
serverList.add(server);
为空
Server
遍历originServerList判断if (server instanceof ConsulServer)
if (!TSF_LANE_PRIMARY.getLaneIdList().isEmpty())
空
laneInfoList 空
false
TsfLaneRuleManager.stopScheduleTask();
true
laneInfo 有不为空
beforeContextToHeader
TsfLaneContextToHeaderInterceptor()
TsfLaneRuleManager.clearLaneRuleList();LANE_RULE_LIST.clear()
laneRuleList排序,优先级>创建时间遍历laneRuleListcheckRuleHit(laneRule)TsfLaneIdHolder.setLaneId(laneRule.getLaneId());
200
TSF_LANE_PRIMARY
TsfLaneRuleManager.startScheduleTask(true);
TsfLaneRuleManager.refreshLaneRuleList(this.parseResponse(response));LANE_RULE_LIST=parseResponse(response)
LaneInfo laneInfo = TsfLaneInfoKVLoader.getLaneInfo(laneId);LANE_INFO_MAP.get(laneId)
ConsulServer
TsfLaneInfoKVLoader.getTsfLanePrimary()
filterServerList(List<Server> originServerList):
获取所有泳道信息集合laneInfoListCollection<LaneInfo> laneInfoList = LANE_INFO_MAP.values()
class TsfLaneRuleManager private static ScheduledFuture<?> SCHEDULED_FUTURE = null; private static final Logger logger = LoggerFactory.getLogger(TsfLaneRuleManager.class); private static TaskScheduler taskScheduler; private static List<LaneRule> LANE_RULE_LIST = Collections.emptyList();//泳道规则集合 private static TsfConsulClient client;
遍历泳道入口primaryLaneIdList 和泳道规则allLaneRuleList把泳道id相同的泳道规则放入新创建laneRuleList
primaryLaneIdList为空
404
List<String> primaryLaneIdList = this.getPrimaryLaneIdList();
遍历所有泳道信息结合laneInfoList中的每个getLaneGroupList()的groupId都不等于consulServer.metadata.get(\"TSF_GROUP_ID\")
直接返回入参return originServerList;
遍历原始服务列表originServerList和laneInfo.getLaneGroupList()类型属于ConsulServer&applicationId&namespaceId&groupId都相等的都放入新创建serverList并返回
TsfRibbonLoadbalancer
List<LaneRule> allLaneRuleList = this.getLaneRuleList();LANE_RULE_LIST
servers[0] = tsfZoneAwareLoadBalancer.filterAllServer(servers[0]);
ribbon源码的allServerListList<Server>[] servers = new List[]{super.getAllServers()};
获取上游泳道id,并把上游泳道id放入自己的泳道id
primaryLaneIdList不为空
makeGetRequest()url=\"/v1/kv/lane/info/\"List<LaneInfo> laneInfoList = this.parseResponse(response);获取所有泳道信息给 LANE_INFO_MAP筛选出融到入口信息给TSF_LANE_PRIMARY
return servers[0];
laneInfoList 不为空
LaneInfo: private String laneId; private String laneName; private String remark; private Timestamp createTime; private Timestamp updateTime; private List<LaneGroup> laneGroupList;
checkAndRecordLane:
LaneService laneServiceLaneService.getInstance(); laneService.checkAndRecordLane();
收藏
0 条评论
下一页
为你推荐
查看更多