@Test public void testInsertRedises() throws ResourceNotFoundException, DalException { List<RedisTbl> redises = redisService.findRedisesByDcClusterShard(dcName, clusterName, shardName); redisService.insertInstancesToDb(redises.get(0).getDcClusterShardId(), XPipeConsoleConstant.ROLE_REDIS, new Pair<>("127.0.0.1", randomInt()), new Pair<>("127.0.0.1", randomInt())); List<RedisTbl> newRedises = redisService.findRedisesByDcClusterShard(dcName, clusterName, shardName); Assert.assertEquals(redises.size() + 2, newRedises.size()); }
@Override public synchronized void insertRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses) throws DalException, ResourceNotFoundException { doInsertInstances(XPipeConsoleConstant.ROLE_REDIS, dcId, clusterId, shardId, redisAddresses); notifyClusterUpdate(dcId, clusterId); }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public synchronized void insertRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses) throws DalException, ResourceNotFoundException { doInsertInstances(XPipeConsoleConstant.ROLE_REDIS, dcId, clusterId, shardId, redisAddresses); notifyClusterUpdate(dcId, clusterId); } }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public synchronized void insertRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses) throws DalException, ResourceNotFoundException { doInsertInstances(XPipeConsoleConstant.ROLE_REDIS, dcId, clusterId, shardId, redisAddresses); notifyClusterUpdate(dcId, clusterId); }  }
RedisServiceImpl extends AbstractConsoleService<RedisTblDao> implements RedisService { @Override public synchronized void insertRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses) throws DalException, ResourceNotFoundException { doInsertInstances(XPipeConsoleConstant.ROLE_REDIS, dcId, clusterId, shardId, redisAddresses); notifyClusterUpdate(dcId, clusterId); }  @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 synchronized void insertRedises(String dcId, String clusterId, String shardId, List<Pair<String, Integer>> redisAddresses) throws DalException, ResourceNotFoundException { doInsertInstances(XPipeConsoleConstant.ROLE_REDIS, dcId, clusterId, shardId, redisAddresses); notifyClusterUpdate(dcId, clusterId); }  @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);  }