ShardDao extends AbstractXpipeConsoleDAO { public ShardTbl createShard(String clusterName, ShardTbl shard, Map<Long, SetinelTbl> sentinels) throws DalException{ shard.setSetinelMonitorName(shard.getShardName().trim()); validateShard(clusterName, shard); return insertShard(clusterName, shard, sentinels); }  ShardTbl createShard(String clusterName, ShardTbl shard, Map<Long, SetinelTbl> sentinels); List<ShardTbl> queryAllShardsByClusterName(String clusterName); Set<String> queryAllShardMonitorNames(); @DalTransaction void deleteShardsBatch(List<ShardTbl> shards); @DalTransaction void deleteShardsBatch(final ShardTbl shard); @DalTransaction ShardTbl insertShard(String clusterName, ShardTbl shard, Map<Long, SetinelTbl> sentinels);  }
@Test public void testAddShardThenSentinelNameShouldEqShardName() throws DalException { shardDao.createShard("cluster1", new ShardTbl().setShardName("cluster-test-1_1"), Maps.newHashMap()); }