DcClusterShardServiceImpl extends AbstractConsoleService<DcClusterShardTblDao> implements DcClusterShardService { @Override public List<DcClusterShardTbl> findAllByDcId(long dcId) { return queryHandler.handleQuery(new DalQuery<List<DcClusterShardTbl>>() { @Override public List<DcClusterShardTbl> doQuery() throws DalException { return dao.findAllByDcId(dcId, DcClusterShardTblEntity.READSET_DC_CLUSTER_SHARD_META_INFO); } }); }  @Override DcClusterShardTbl find(final long dcClusterId, final long shardId); @Override DcClusterShardTbl find(final String dcName, final String clusterName, final String shardName); @Override List<DcClusterShardTbl> findAllByDcCluster(final long dcClusterId); @Override List<DcClusterShardTbl> findAllByDcCluster(final String dcName, final String clusterName); @Override void updateDcClusterShard(DcClusterShardTbl dcClusterShardTbl); @Override List<DcClusterShardTbl> findAllByDcId(long dcId); @Override List<DcClusterShardTbl> findAllByDcIdAndInClusterTypes(long dcId, Set<String> clusterTypes);  }
@Test public void testFindAllByDcId() throws Exception { List<DcClusterShardTbl> dcClusterShards = service.findAllByDcId(1L); for(DcClusterShardTbl dcClusterShard : dcClusterShards) { Assert.assertEquals(1L, dcClusterShard.getDcClusterInfo().getDcId()); Assert.assertNotEquals(0, dcClusterShard.getShardId()); Assert.assertNotNull(dcClusterShard.getRedisInfo()); } logger.info("{}", dcClusterShards); }