Authored by qinchao

redis监控

... ... @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
... ... @@ -38,7 +39,9 @@ public class OneTask implements Callable {
//Job 列表
jobList = new ArrayList<>();
HashSet<String> relastionRedis = new HashSet<>();
List<OneClusterJob> jobClusterList = new ArrayList<>();
HashSet<String> relastionRedis = new LinkedHashSet<>();
for (MObjectInfo mo : moList) {
... ... @@ -59,6 +62,7 @@ public class OneTask implements Callable {
OneClusterJob clusterJob = new OneClusterJob(mo);
jobList.add(clusterJob);
jobClusterList.add(clusterJob);
relastionRedis.add(clusterJob.getJedisUrl());
}
... ... @@ -75,6 +79,11 @@ public class OneTask implements Callable {
}
}
//设置Cluster的相关集群node
for(OneClusterJob clusterJob:jobClusterList){
clusterJob.setClusterRelationRedis(relastionRedis);
}
}
@Override
... ...
... ... @@ -4,11 +4,14 @@ import com.model.MObjectInfo;
import com.monitor.common.util.SpringContextUtils;
import com.monitor.middleware.redis.constants.Constants;
import com.monitor.middleware.redis.model.RedisInfo;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang.StringUtils;
import redis.clients.jedis.Jedis;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
... ... @@ -18,6 +21,9 @@ import java.util.Map;
*/
public class OneClusterJob extends OneJob {
@Setter
private HashSet<String> clusterRelationRedis;
public OneClusterJob(MObjectInfo mObjectInfo) {
super(mObjectInfo);
}
... ...