assertEquals(clusterprops.getBanned(), new TreeSet<URI>());
}
public static void verifyPartitionProperties(String cluster, Map<String, Object>propertiesMap) throws IOException, URISyntaxException, PropertyStoreException
{
final ClusterProperties clusterprops = getClusterProperties(_zkclient, cluster);
if (propertiesMap.get("partitionProperties") != null)
{
@SuppressWarnings("unchecked")
Map<String, Object> properties = (Map<String, Object>)propertiesMap.get("partitionProperties");
PartitionProperties.PartitionType partitionType = PartitionProperties.PartitionType.valueOf(
(String)properties.get("partitionType"));
switch (partitionType)
{
case RANGE:
{
long keyRangeStart = ((Number)properties.get("keyRangeStart")).longValue();
long partitionSize = ((Number)properties.get("partitionSize")).longValue();
int partitionCount = ((Number)properties.get("partitionCount")).intValue();
String regex = (String)properties.get("partitionKeyRegex");
RangeBasedPartitionProperties rbp = (RangeBasedPartitionProperties) clusterprops.getPartitionProperties();
assertEquals(keyRangeStart, rbp.getKeyRangeStart());
assertEquals(partitionSize, rbp.getPartitionSize());
assertEquals(partitionCount, rbp.getPartitionCount());
assertEquals(regex, rbp.getPartitionKeyRegex());
}
break;
case HASH:
{
int partitionCount = ((Number)properties.get("partitionCount")).intValue();
String regex = (String)properties.get("partitionKeyRegex");
String algorithm = (String)properties.get("hashAlgorithm");
HashBasedPartitionProperties.HashAlgorithm hashAlgorithm = HashBasedPartitionProperties.HashAlgorithm.valueOf(algorithm.toUpperCase());
HashBasedPartitionProperties hbp = (HashBasedPartitionProperties) clusterprops.getPartitionProperties();
assertEquals(partitionCount, hbp.getPartitionCount());
assertEquals(regex, hbp.getPartitionKeyRegex());
assertEquals(hashAlgorithm, hbp.getHashAlgorithm());
}
break;