@Test public void testFindAllRedisesByDcClusterName(){ List<RedisTbl> dc1 = redisService.findAllRedisesByDcClusterName(dcNames[0], clusterName); Assert.assertTrue(dc1.size() > 0); Set<Long> dc1Ids = new HashSet<>(); dc1.forEach(redisTbl -> dc1Ids.add(redisTbl.getId())); List<RedisTbl> dc2 = redisService.findAllRedisesByDcClusterName(dcNames[1], clusterName); Assert.assertTrue(dc2.size() > 0); dc2.forEach(redisTbl -> Assert.assertFalse(dc1Ids.contains(redisTbl.getId()))); }
@Override public List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId) { return queryHandler.handleQuery(new DalQuery<List<RedisTbl>>() { @Override public List<RedisTbl> doQuery() throws DalException { return dao.findAllByDcClusterName(dcId, clusterId, XPipeConsoleConstant.ROLE_REDIS, RedisTblEntity.READSET_FULL); } }); }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId) { return queryHandler.handleQuery(new DalQuery<List<RedisTbl>>() { @Override public List<RedisTbl> doQuery() throws DalException { return dao.findAllByDcClusterName(dcId, clusterId, XPipeConsoleConstant.ROLE_REDIS, RedisTblEntity.READSET_FULL); } }); } }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId) { return queryHandler.handleQuery(new DalQuery<List<RedisTbl>>() { @Override public List<RedisTbl> doQuery() throws DalException { return dao.findAllByDcClusterName(dcId, clusterId, XPipeConsoleConstant.ROLE_REDIS, RedisTblEntity.READSET_FULL); } }); }  }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId) { return queryHandler.handleQuery(new DalQuery<List<RedisTbl>>() { @Override public List<RedisTbl> doQuery() throws DalException { return dao.findAllByDcClusterName(dcId, clusterId, XPipeConsoleConstant.ROLE_REDIS, RedisTblEntity.READSET_FULL); } }); }  @Override RedisTbl find(final long id); @Override List<RedisTbl> findAllRedisWithSameIP(String ip); @Override List<RedisTbl> findAllByDcClusterShard(final long dcClusterShardId); @Override List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId); @Override List<RedisTbl> findAllByDcClusterShard(String dcId, String clusterId, String shardId); @Override List<RedisTbl> findRedisesByDcClusterShard(String dcId, String clusterId, String shardId); @Override List<RedisTbl> findKeepersByDcClusterShard(String dcId, String clusterId, String shardId); @Override synchronized void insertRedises(String dcId, String clusterId, String shardId,
                                           List<Pair<String, Integer>> redisAddresses); @Override synchronized int insertKeepers(String dcId, String clusterId, String shardId,
                                          List<KeeperBasicInfo> keepers); @Override List<RedisTbl> deleteKeepers(String dcId, String clusterId, String shardId); @Override void deleteRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses); @Override void updateByPK(final RedisTbl redis); @Override void updateBatchMaster(List<RedisTbl> redises); @Override void updateBatchKeeperActive(List<RedisTbl> redises); @Override void updateRedises(String dcName, String clusterName, String shardName, ShardModel shardModel); @Override List<RedisTbl> findAllKeeperContainerCountInfo(); @Override List<Long> findClusterIdsByKeeperContainer(long keeperContainerId); void insertInstancesToDb(long dcClusterShardId, String role, Pair<String, Integer>... addrs); }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId) { return queryHandler.handleQuery(new DalQuery<List<RedisTbl>>() { @Override public List<RedisTbl> doQuery() throws DalException { return dao.findAllByDcClusterName(dcId, clusterId, XPipeConsoleConstant.ROLE_REDIS, RedisTblEntity.READSET_FULL); } }); }  @Override RedisTbl find(final long id); @Override List<RedisTbl> findAllRedisWithSameIP(String ip); @Override List<RedisTbl> findAllByDcClusterShard(final long dcClusterShardId); @Override List<RedisTbl> findAllRedisesByDcClusterName(String dcId, String clusterId); @Override List<RedisTbl> findAllByDcClusterShard(String dcId, String clusterId, String shardId); @Override List<RedisTbl> findRedisesByDcClusterShard(String dcId, String clusterId, String shardId); @Override List<RedisTbl> findKeepersByDcClusterShard(String dcId, String clusterId, String shardId); @Override synchronized void insertRedises(String dcId, String clusterId, String shardId,
                                           List<Pair<String, Integer>> redisAddresses); @Override synchronized int insertKeepers(String dcId, String clusterId, String shardId,
                                          List<KeeperBasicInfo> keepers); @Override List<RedisTbl> deleteKeepers(String dcId, String clusterId, String shardId); @Override void deleteRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses); @Override void updateByPK(final RedisTbl redis); @Override void updateBatchMaster(List<RedisTbl> redises); @Override void updateBatchKeeperActive(List<RedisTbl> redises); @Override void updateRedises(String dcName, String clusterName, String shardName, ShardModel shardModel); @Override List<RedisTbl> findAllKeeperContainerCountInfo(); @Override List<Long> findClusterIdsByKeeperContainer(long keeperContainerId); void insertInstancesToDb(long dcClusterShardId, String role, Pair<String, Integer>... addrs);  }