CRedisService extends AbstractOuterClientService { @Override public MigrationPublishResult doMigrationPublish(String clusterName, String primaryDcName, List<InetSocketAddress> newMasters) throws OuterClientException { try { return catTransactionMonitor.logTransaction(TYPE, String.format("doMigrationPublish-%s-%s", clusterName, primaryDcName), new Callable<MigrationPublishResult>() { @Override public MigrationPublishResult call() throws Exception { logger.info("[doMigrationPublish]Cluster:{}, NewPrimaryDc:{} -> ConvertedDcName:{} , NewMasters:{}", clusterName, primaryDcName,convertDcName(primaryDcName), newMasters); String credisAddress = CREDIS_SERVICE.MIGRATION_PUBLISH.getRealPath(credisConfig.getCredisServiceAddress()); String startTime = DateTimeUtils.currentTimeAsString(); MigrationPublishResult res = restOperations.postForObject(credisAddress, newMasters, MigrationPublishResult.class, clusterName, convertDcName(primaryDcName)); String endTime = DateTimeUtils.currentTimeAsString(); res.setPublishAddress(credisAddress); res.setClusterName(clusterName); res.setPrimaryDcName(primaryDcName); res.setNewMasters(newMasters); res.setStartTime(startTime); res.setEndTime(endTime); return res; } }); } catch (Exception e) { throw new OuterClientException(String.format("%s:%s,%s", clusterName, primaryDcName, newMasters), e); } }  @Override int getOrder(); @Override String serviceName(); @Override void markInstanceUp(ClusterShardHostPort clusterShardHostPort); @Override boolean isInstanceUp(ClusterShardHostPort clusterShardHostPort); @Override void markInstanceDown(ClusterShardHostPort clusterShardHostPort); @Override MigrationPublishResult doMigrationPublish(String clusterName, String primaryDcName, List<InetSocketAddress> newMasters); @Override MigrationPublishResult doMigrationPublish(String clusterName, String shardName, String primaryDcName,
			InetSocketAddress newMaster); @Override ClusterInfo getClusterInfo(String clusterName); GetInstanceResult getInstance(ClusterShardHostPort clusterShardHostPort);  }
@Test public void testCredisMigrationPublishService() throws Exception { Assert.assertTrue(outerClientService instanceof CRedisService); List<InetSocketAddress> newMasters = new LinkedList<>(); newMasters.add(new InetSocketAddress("10.3.2.23", 6379)); newMasters.add(new InetSocketAddress("10.3.2.23", 6389)); MigrationPublishResult result = outerClientService.doMigrationPublish("cluster_shyin", "SHAOY", newMasters); logger.info("[testCredisMigrationPublishService]{}", result); }