...
|
...
|
@@ -44,11 +44,12 @@ public class RedisCtrl { |
|
|
List<TwemproxyVo> twemproxyVOList = new ArrayList<>();
|
|
|
|
|
|
try {
|
|
|
for (Map.Entry<String, TwemproxyInfo> entry : Constants.TWEMPROXY_INFO_MAP.entrySet()) {
|
|
|
|
|
|
TwemproxyVo twemproxyVO = buildTwemproxyVO(entry.getKey(), entry.getValue());
|
|
|
|
|
|
twemproxyVOList.add(twemproxyVO);
|
|
|
for (Map.Entry<String, Map<String,TwemproxyInfo>> entry : Constants.TWEMPROXY_INFO_MAP.entrySet()) {
|
|
|
Map<String,TwemproxyInfo> tmpMap=entry.getValue();
|
|
|
for(TwemproxyInfo tmp:tmpMap.values()){
|
|
|
TwemproxyVo twemproxyVO = buildTwemproxyVO(entry.getKey(), tmp);
|
|
|
twemproxyVOList.add(twemproxyVO);
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
|
...
|
...
|
@@ -135,26 +136,35 @@ public class RedisCtrl { |
|
|
List<RedisVo> redisInfoList = new ArrayList<>();
|
|
|
|
|
|
try {
|
|
|
TwemproxyInfo twemproxyInfo = Constants.TWEMPROXY_INFO_MAP.get(twemproxy);
|
|
|
Map<String,TwemproxyInfo> twemproxyInfoMap = Constants.TWEMPROXY_INFO_MAP.get(twemproxy);
|
|
|
|
|
|
DEBUG.info("Query twemproxyinfo {} by key {}", twemproxyInfo, twemproxy);
|
|
|
DEBUG.info("Query twemproxyinfo {} by key {}", twemproxyInfoMap, twemproxyInfoMap);
|
|
|
|
|
|
Iterator<String> relationRedis=twemproxyInfo.getRelationRedis().iterator();
|
|
|
if(twemproxyInfoMap!=null&&twemproxyInfoMap.size()>0){
|
|
|
for(String key:twemproxyInfoMap.keySet()){
|
|
|
TwemproxyInfo twemproxyInfo=twemproxyInfoMap.get(key);
|
|
|
Iterator<String> relationRedis=twemproxyInfo.getRelationRedis().iterator();
|
|
|
|
|
|
while (relationRedis.hasNext()) {
|
|
|
while (relationRedis.hasNext()) {
|
|
|
|
|
|
String redisUrl=relationRedis.next();
|
|
|
String redisUrl=relationRedis.next();
|
|
|
|
|
|
RedisInfo redisInfo = Constants.REDIS_INFO_MAP.get(redisUrl);
|
|
|
RedisInfo redisInfo = Constants.REDIS_INFO_MAP.get(redisUrl);
|
|
|
|
|
|
if (null != redisInfo) {
|
|
|
DEBUG.info("Twemproxy {} contains redis {} ", twemproxy, redisInfo);
|
|
|
if (null != redisInfo) {
|
|
|
DEBUG.info("Twemproxy {} contains redis {} ", twemproxy, redisInfo);
|
|
|
|
|
|
RedisVo redisVo = buildRedisVo(redisInfo);
|
|
|
RedisVo redisVo = buildRedisVo(redisInfo);
|
|
|
|
|
|
redisInfoList.add(redisVo);
|
|
|
redisInfoList.add(redisVo);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
DEBUG.error("Failed to query twemproxy info , erro {}", e);
|
|
|
}
|
...
|
...
|
|