DefaultSentinelManager implements SentinelManager { @VisibleForTesting protected List<Sentinel> getRealSentinels(List<InetSocketAddress> sentinels, String sentinelMonitorName) { List<Sentinel> realSentinels = null; for(InetSocketAddress sentinelAddress: sentinels){ SimpleObjectPool<NettyClient> clientPool = keyedClientPool.getKeyPool(new DefaultEndPoint(sentinelAddress)); AbstractSentinelCommand.Sentinels sentinelsCommand = new AbstractSentinelCommand .Sentinels(clientPool, sentinelMonitorName, scheduled); silentCommand(sentinelsCommand); try { realSentinels = sentinelsCommand.execute().get(); logger.info("[getRealSentinels]findRedisHealthCheckInstance sentinels from {} : {}", sentinelAddress, realSentinels); if(null != realSentinels){ realSentinels.add( new Sentinel(sentinelAddress.toString(), sentinelAddress.getHostString(), sentinelAddress.getPort() )); logger.info("[getRealSentinels]sentinels for monitor {}, list as: {}", sentinelMonitorName, realSentinels); break; } } catch (Exception e) { logger.warn("[getRealSentinels]findRedisHealthCheckInstance sentinels from " + sentinelAddress, e); } } return realSentinels; }  @Override void removeShardSentinelMonitors(ShardEvent shardEvent); @Override HostPort getMasterOfMonitor(Sentinel sentinel, String sentinelMonitorName); @Override void removeSentinelMonitor(Sentinel sentinel, String sentinelMonitorName); @Override String infoSentinel(Sentinel sentinel); @Override void monitorMaster(Sentinel sentinel, String sentinelMonitorName, HostPort master, int quorum); @Override List<HostPort> slaves(Sentinel sentinel, String sentinelMonitorName); @Override void reset(Sentinel sentinel, String sentinelMonitorName); @VisibleForTesting DefaultSentinelManager setScheduled(ScheduledExecutorService scheduled); @VisibleForTesting DefaultSentinelManager setKeyedClientPool(XpipeNettyClientKeyedObjectPool keyedClientPool);  }
@Test public void getRealSentinels() throws Exception { List<Sentinel> sentinelList = manager .getRealSentinels(Lists.newArrayList(new InetSocketAddress("127.0.0.1", port)), "sitemon-xpipegroup0"); logger.info("{}", sentinelList); }