CrossMasterDelayService implements DelayActionListener, BiDirectionSupport { public Map<String, Pair<HostPort, Long>> getPeerMasterDelayFromSourceDc(String sourceDcId, String clusterId, String shardId) { if (currentDcId.equalsIgnoreCase(sourceDcId)) { return getPeerMasterDelayFromCurrentDc(clusterId, shardId); } else { try { return consoleServiceManager.getCrossMasterDelay(sourceDcId, clusterId, shardId); } catch (Exception e) { return Collections.emptyMap(); } } }  @Override void onAction(DelayActionContext context); @Override void stopWatch(HealthCheckAction action); Map<String, Pair<HostPort, Long>> getPeerMasterDelayFromCurrentDc(String clusterId, String shardId); Map<String, Pair<HostPort, Long>> getPeerMasterDelayFromSourceDc(String sourceDcId, String clusterId, String shardId); Map<String, Pair<HostPort, Long>> getPeerMasterDelayFromSourceDc(ClusterType clusterType, String sourceDcId, String clusterId, String shardId); UnhealthyInfoModel getCurrentDcUnhealthyMasters();  }
@Test public void testGetMasterDelayFromRemoteDc() { Assert.assertEquals(Collections.singletonMap(dcId, Pair.of(new HostPort(), 10L)), service.getPeerMasterDelayFromSourceDc(remoteDcId, clusterId, shardId)); }