@Test public void testNotExistDcDelay() { testAllDelayHealth(); Mockito.when(metaCache.getXpipeMeta()).thenReturn(new XpipeMeta()); sleep(delayDownMilli + 1); multiMasterDelayListener.checkAllHealthStatus(); Mockito.verify(alertManager, Mockito.times(0)).alert(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.anyString()); }
@VisibleForTesting protected void checkAllHealthStatus() { Set<DcClusterShard> toDeleteClusterShard = new HashSet<>(); for (DcClusterShard dcClusterShard : multiMasterHealthStatus.keySet()) { if (!isDcClusterShardExist(dcClusterShard.getDcId(), dcClusterShard.getClusterId(), dcClusterShard.getShardId())) { toDeleteClusterShard.add(dcClusterShard); continue; } multiMasterHealthStatus.get(dcClusterShard).refreshCurrentMasterHealthStatus(); } toDeleteClusterShard.forEach(dcClusterShard -> { logger.debug("[checkAllHealthStatus] remove not exist cluster shard {}", dcClusterShard); multiMasterHealthStatus.remove(dcClusterShard); }); }
MultiMasterDelayListener implements DelayActionListener, BiDirectionSupport { @VisibleForTesting protected void checkAllHealthStatus() { Set<DcClusterShard> toDeleteClusterShard = new HashSet<>(); for (DcClusterShard dcClusterShard : multiMasterHealthStatus.keySet()) { if (!isDcClusterShardExist(dcClusterShard.getDcId(), dcClusterShard.getClusterId(), dcClusterShard.getShardId())) { toDeleteClusterShard.add(dcClusterShard); continue; } multiMasterHealthStatus.get(dcClusterShard).refreshCurrentMasterHealthStatus(); } toDeleteClusterShard.forEach(dcClusterShard -> { logger.debug("[checkAllHealthStatus] remove not exist cluster shard {}", dcClusterShard); multiMasterHealthStatus.remove(dcClusterShard); }); } }
MultiMasterDelayListener implements DelayActionListener, BiDirectionSupport { @VisibleForTesting protected void checkAllHealthStatus() { Set<DcClusterShard> toDeleteClusterShard = new HashSet<>(); for (DcClusterShard dcClusterShard : multiMasterHealthStatus.keySet()) { if (!isDcClusterShardExist(dcClusterShard.getDcId(), dcClusterShard.getClusterId(), dcClusterShard.getShardId())) { toDeleteClusterShard.add(dcClusterShard); continue; } multiMasterHealthStatus.get(dcClusterShard).refreshCurrentMasterHealthStatus(); } toDeleteClusterShard.forEach(dcClusterShard -> { logger.debug("[checkAllHealthStatus] remove not exist cluster shard {}", dcClusterShard); multiMasterHealthStatus.remove(dcClusterShard); }); }  }
MultiMasterDelayListener implements DelayActionListener, BiDirectionSupport { @VisibleForTesting protected void checkAllHealthStatus() { Set<DcClusterShard> toDeleteClusterShard = new HashSet<>(); for (DcClusterShard dcClusterShard : multiMasterHealthStatus.keySet()) { if (!isDcClusterShardExist(dcClusterShard.getDcId(), dcClusterShard.getClusterId(), dcClusterShard.getShardId())) { toDeleteClusterShard.add(dcClusterShard); continue; } multiMasterHealthStatus.get(dcClusterShard).refreshCurrentMasterHealthStatus(); } toDeleteClusterShard.forEach(dcClusterShard -> { logger.debug("[checkAllHealthStatus] remove not exist cluster shard {}", dcClusterShard); multiMasterHealthStatus.remove(dcClusterShard); }); }  @PostConstruct void postConstruct(); @PreDestroy void preDestroy(); @Override void onAction(DelayActionContext delayActionContext); @Override void stopWatch(HealthCheckAction action); }
MultiMasterDelayListener implements DelayActionListener, BiDirectionSupport { @VisibleForTesting protected void checkAllHealthStatus() { Set<DcClusterShard> toDeleteClusterShard = new HashSet<>(); for (DcClusterShard dcClusterShard : multiMasterHealthStatus.keySet()) { if (!isDcClusterShardExist(dcClusterShard.getDcId(), dcClusterShard.getClusterId(), dcClusterShard.getShardId())) { toDeleteClusterShard.add(dcClusterShard); continue; } multiMasterHealthStatus.get(dcClusterShard).refreshCurrentMasterHealthStatus(); } toDeleteClusterShard.forEach(dcClusterShard -> { logger.debug("[checkAllHealthStatus] remove not exist cluster shard {}", dcClusterShard); multiMasterHealthStatus.remove(dcClusterShard); }); }  @PostConstruct void postConstruct(); @PreDestroy void preDestroy(); @Override void onAction(DelayActionContext delayActionContext); @Override void stopWatch(HealthCheckAction action);  }