DefaultMetaCache implements MetaCache { @Override public boolean isCrossRegion(String activeDc, String backupDc) { XpipeMetaManager xpipeMetaManager = meta.getValue(); return !xpipeMetaManager.getDcZone(activeDc) .equalsIgnoreCase(xpipeMetaManager.getDcZone(backupDc)); } DefaultMetaCache(); @PostConstruct void postConstruct(); @PreDestroy void shutdown(); @Override XpipeMeta getXpipeMeta(); @Override boolean inBackupDc(HostPort hostPort); @Override HostPort findMasterInSameShard(HostPort hostPort); @Override Pair<String, String> findClusterShard(HostPort hostPort); @Override String getActiveDc(HostPort hostPort); @Override long getLastUpdateTime(); @Override RouteMeta getRouteIfPossible(HostPort hostPort); @Override boolean isCrossRegion(String activeDc, String backupDc); @Override List<HostPort> getAllActiveRedisOfDc(String activeDc, String dcId); @Override Set<HostPort> getAllKeepers(); @Override String getSentinelMonitorName(String clusterId, String shardId); @Override Set<HostPort> getActiveDcSentinels(String clusterId, String shardId); @Override HostPort findMaster(String clusterId, String shardId); @Override String getDc(HostPort hostPort); @Override Pair<String, String> findClusterShardBySentinelMonitor(String monitor); @Override String getActiveDc(String clusterId, String shardId); @Override ClusterType getClusterType(String clusterId);  }
@Test public void testIsCrossRegion() { Map<String, DcMeta> dcs = getXpipeMeta().getDcs(); Assert.assertFalse(dcs.get("jq").getZone().equalsIgnoreCase(dcs.get("fra-aws").getZone())); }