Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/disable_db
Browse files Browse the repository at this point in the history
  • Loading branch information
qifanwang committed Sep 12, 2024
2 parents 5c9b5e8 + 8bb0887 commit db92336
Show file tree
Hide file tree
Showing 76 changed files with 174 additions and 1,386 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ public interface CheckerConsoleService {

Map<String, Date> loadAllClusterCreateTime(String console);

Map<String, OuterClientService.ClusterInfo> loadAllDcOneWayClusterInfo(String console, String dc);

Map<String, OuterClientService.ClusterInfo> loadCurrentDcOneWayClusterInfo(String console, String dc);
Map<String, OuterClientService.ClusterInfo> loadAllActiveDcOneWayClusterInfo(String console, String activeDc);

void bindShardSentinel(String console, String dc, String cluster, String shard, SentinelMeta sentinelMeta);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class AllInstanceHealthStatus extends HashMap<HostPort, HealthStatusDesc> {}

HEALTH_STATE getInstanceStatus(String ip, int port);

HEALTH_STATE getCrossRegionInstanceStatus(String ip, int port);

Map<HostPort, HealthStatusDesc> getAllInstanceHealthStatus();

Map<HostPort, HealthStatusDesc> getAllInstanceCrossRegionHealthStatus();

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public interface OuterClientCache {

OuterClientService.ClusterInfo getClusterInfo(String clusterName) throws Exception;

Map<String, OuterClientService.ClusterInfo> getAllDcClusters(String dc);

Map<String, OuterClientService.ClusterInfo> getAllCurrentDcClusters(String dc);
Map<String, OuterClientService.ClusterInfo> getAllActiveDcClusters(String activeDc);

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.ctrip.xpipe.redis.checker.controller.result.ActionContextRetMessage;
import com.ctrip.xpipe.redis.checker.healthcheck.*;
import com.ctrip.xpipe.redis.checker.healthcheck.actions.interaction.DefaultDelayPingActionCollector;
import com.ctrip.xpipe.redis.checker.healthcheck.actions.interaction.DefaultPsubPingActionCollector;
import com.ctrip.xpipe.redis.checker.healthcheck.actions.interaction.HEALTH_STATE;
import com.ctrip.xpipe.redis.checker.healthcheck.actions.interaction.HealthStatusDesc;
import com.ctrip.xpipe.redis.checker.healthcheck.actions.keeper.info.RedisUsedMemoryCollector;
Expand Down Expand Up @@ -37,9 +36,6 @@ public class CheckerHealthController {
@Autowired
private DefaultDelayPingActionCollector defaultDelayPingActionCollector;

@Autowired
private DefaultPsubPingActionCollector defaultPsubPingActionCollector;

@Autowired
private RedisUsedMemoryCollector redisUsedMemoryCollector;

Expand All @@ -61,12 +57,6 @@ public HEALTH_STATE getHealthState(@PathVariable String ip, @PathVariable int po
else return HEALTH_STATE.UNKNOWN;
}

@RequestMapping(value = "/health/cross/region/{ip}/{port}", method = RequestMethod.GET)
public HEALTH_STATE getCrossRegionHealthState(@PathVariable String ip, @PathVariable int port) {
if (siteStability.isSiteStable()) return defaultPsubPingActionCollector.getHealthState(new HostPort(ip, port));
else return HEALTH_STATE.UNKNOWN;
}

@RequestMapping(value = "/health/check/instance/{ip}/{port}", method = RequestMethod.GET)
public String getHealthCheckInstance(@PathVariable String ip, @PathVariable int port) {
RedisHealthCheckInstance instance = instanceManager.findRedisHealthCheckInstance(new HostPort(ip, port));
Expand All @@ -77,16 +67,6 @@ public String getHealthCheckInstance(@PathVariable String ip, @PathVariable int
return Codec.DEFAULT.encode(model);
}

@RequestMapping(value = "/health/check/cross/region//instance/{ip}/{port}", method = RequestMethod.GET)
public String getCrossRegionHealthCheckInstance(@PathVariable String ip, @PathVariable int port) {
RedisHealthCheckInstance instance = instanceManager.findRedisInstanceForPsubPingAction(new HostPort(ip, port));
if(instance == null) {
return "Not found";
}
HealthCheckInstanceModel model = buildHealthCheckInfo(instance);
return Codec.DEFAULT.encode(model);
}

@RequestMapping(value = "/health/check/cluster/{clusterId}", method = RequestMethod.GET)
public String getClusterHealthCheckInstance(@PathVariable String clusterId) {
ClusterHealthCheckInstance instance = instanceManager.findClusterHealthCheckInstance(clusterId);
Expand Down Expand Up @@ -117,16 +97,6 @@ public String getHealthCheckRedisInstanceForAssignedAction(@PathVariable String
return Codec.DEFAULT.encode(model);
}

@RequestMapping(value = "/health/check/redis-for-ping-action/{ip}/{port}", method = RequestMethod.GET)
public String getHealthCheckRedisInstanceForPingAction(@PathVariable String ip, @PathVariable int port) {
RedisHealthCheckInstance instance = instanceManager.findRedisInstanceForPsubPingAction(new HostPort(ip, port));
if(instance == null) {
return "Not found";
}
HealthCheckInstanceModel model = buildHealthCheckInfo(instance);
return Codec.DEFAULT.encode(model);
}

@RequestMapping(value = "/health/redis/info/{ip}/{port}", method = RequestMethod.GET)
public ActionContextRetMessage<Map<String, String>> getRedisInfo(@PathVariable String ip, @PathVariable int port) {
return ActionContextRetMessage.from(redisInfoManager.getInfoByHostPort(new HostPort(ip, port)));
Expand All @@ -143,12 +113,6 @@ public Map<HostPort, HealthStatusDesc> getAllHealthStatusDesc() {
else return Collections.emptyMap();
}

@GetMapping("/health/check/cross/region/status/all")
public Map<HostPort, HealthStatusDesc> getAllCrossRegionHealthStatusDesc() {
if (siteStability.isSiteStable()) return defaultPsubPingActionCollector.getAllHealthStatus();
else return Collections.emptyMap();
}

@GetMapping("/health/keeper/status/all")
public ConcurrentMap<String, Map<DcClusterShardKeeper, Long>> getAllKeeperFlows() {
return keeperFlowCollector.getHostPort2InputFlow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public interface HealthCheckInstanceManager {

RedisHealthCheckInstance getOrCreateRedisInstanceForAssignedAction(RedisMeta redis);

RedisHealthCheckInstance getOrCreateRedisInstanceForPsubPingAction(RedisMeta redis);

KeeperHealthCheckInstance getOrCreate(KeeperMeta keeper);

ClusterHealthCheckInstance getOrCreate(ClusterMeta cluster);
Expand All @@ -28,8 +26,6 @@ public interface HealthCheckInstanceManager {

RedisHealthCheckInstance findRedisInstanceForAssignedAction(HostPort hostPort);

RedisHealthCheckInstance findRedisInstanceForPsubPingAction(HostPort hostPort);

KeeperHealthCheckInstance findKeeperHealthCheckInstance(HostPort hostPort);

ClusterHealthCheckInstance findClusterHealthCheckInstance(String clusterId);
Expand All @@ -40,8 +36,6 @@ public interface HealthCheckInstanceManager {

RedisHealthCheckInstance removeRedisInstanceForAssignedAction(HostPort hostPort);

RedisHealthCheckInstance removeRedisInstanceForPingAction(HostPort hostPort);

ClusterHealthCheckInstance remove(String cluster);

List<RedisHealthCheckInstance> getAllRedisInstance();
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit db92336

Please sign in to comment.