RemoteMetaServer extends AbstractRemoteClusterServer implements MetaServer { @Override public MetaServerConsoleService.PreviousPrimaryDcMessage makeMasterReadOnly(String clusterId, String shardId, boolean readOnly, ForwardInfo forwardInfo) { HttpHeaders headers = checkCircularAndGetHttpHeaders(forwardInfo, META_SERVER_SERVICE.MAKE_MASTER_READONLY.getForwardType()); logger.info("[makeMasterReadOnly][forward]{},{},{}, {}--> {}", clusterId, shardId, readOnly, forwardInfo, this); HttpEntity<ClusterMeta> entity = new HttpEntity<>(headers); ResponseEntity<MetaServerConsoleService.PreviousPrimaryDcMessage> result = restTemplate.exchange(makeMasterReadonlyPath, HttpMethod.PUT, entity, MetaServerConsoleService.PreviousPrimaryDcMessage.class, clusterId, shardId, readOnly); return result.getBody(); } RemoteMetaServer(int currentServerId, int serverId);  RemoteMetaServer(int currentServerId, int serverId, ClusterServerInfo clusterServerInfo); @Override KeeperMeta getActiveKeeper(String clusterId, String shardId, ForwardInfo forwardInfo); @Override RedisMeta getCurrentCRDTMaster(String clusterId, String shardId, ForwardInfo forwardInfo); @Override RedisMeta getCurrentMaster(String clusterId, String shardId, ForwardInfo forwardInfo); @Override RedisMeta getRedisMaster(String clusterId, String shardId); @Override void clusterAdded(ClusterMeta clusterMeta, ForwardInfo forwardInfo); @Override void clusterModified(ClusterMeta clusterMeta, ForwardInfo forwardInfo); @Override void clusterDeleted(String clusterId, ForwardInfo forwardInfo); @Override void updateUpstream(String clusterId, String shardId, String ip, int port, ForwardInfo forwardInfo); @Override void upstreamPeerChange(String upstreamDcId, String clusterId, String shardId, ForwardInfo forwardInfo); @Override PrimaryDcCheckMessage changePrimaryDcCheck(String clusterId, String shardId, String newPrimaryDc,
			ForwardInfo forwardInfo); @Override MetaServerConsoleService.PreviousPrimaryDcMessage makeMasterReadOnly(String clusterId, String shardId, boolean readOnly, ForwardInfo forwardInfo); @Override PrimaryDcChangeMessage doChangePrimaryDc(String clusterId, String shardId, String newPrimaryDc
			, MetaServerConsoleService.PrimaryDcChangeRequest request, ForwardInfo forwardInfo); @Override String getCurrentMeta();  }
@Test public void testMakeMasterReadOnly() throws Exception { Server server = startServer(randomPort(), new IoActionFactory() { @Override public IoAction createIoAction(Socket socket) { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } return new IoAction() { @Override public Object read() throws IOException { return null; } @Override public void write(Object readResult) throws IOException { } @Override public Socket getSocket() { return null; } }; } }); remoteMetaServer = new RemoteMetaServer(1, 2, new ClusterServerInfo("127.0.0.1", server.getPort())); remoteMetaServer.makeMasterReadOnly("cluster", "shard", false, new ForwardInfo(META_SERVER_SERVICE.MAKE_MASTER_READONLY.getForwardType())); Thread.sleep(10000); }