@Test public void testLegacyPartitionRangesConfig() { PropertiesConfiguration config = new PropertiesConfiguration(); config.setProperty("partitionRanges", LEGACY_PARTITION_RANGES_STRING); Set<Integer> actual = ColumnPartitionMetadata.extractPartitions(config.getList("partitionRanges")); assertEquals(actual, PARTITIONS); }
public static Set<Integer> extractPartitions(List partitionList) { Set<Integer> partitions = new HashSet<>(); for (Object o : partitionList) { String partitionString = o.toString(); if (partitionString.charAt(0) == '[') { addRangeToPartitions(partitionString, partitions); } else { partitions.add(Integer.parseInt(partitionString)); } } return partitions; }
ColumnPartitionMetadata { public static Set<Integer> extractPartitions(List partitionList) { Set<Integer> partitions = new HashSet<>(); for (Object o : partitionList) { String partitionString = o.toString(); if (partitionString.charAt(0) == '[') { addRangeToPartitions(partitionString, partitions); } else { partitions.add(Integer.parseInt(partitionString)); } } return partitions; } }
ColumnPartitionMetadata { public static Set<Integer> extractPartitions(List partitionList) { Set<Integer> partitions = new HashSet<>(); for (Object o : partitionList) { String partitionString = o.toString(); if (partitionString.charAt(0) == '[') { addRangeToPartitions(partitionString, partitions); } else { partitions.add(Integer.parseInt(partitionString)); } } return partitions; } ColumnPartitionMetadata(String functionName, int numPartitions, Set<Integer> partitions); }
ColumnPartitionMetadata { public static Set<Integer> extractPartitions(List partitionList) { Set<Integer> partitions = new HashSet<>(); for (Object o : partitionList) { String partitionString = o.toString(); if (partitionString.charAt(0) == '[') { addRangeToPartitions(partitionString, partitions); } else { partitions.add(Integer.parseInt(partitionString)); } } return partitions; } ColumnPartitionMetadata(String functionName, int numPartitions, Set<Integer> partitions); String getFunctionName(); int getNumPartitions(); Set<Integer> getPartitions(); @Override boolean equals(Object obj); @Override int hashCode(); static Set<Integer> extractPartitions(List partitionList); }
ColumnPartitionMetadata { public static Set<Integer> extractPartitions(List partitionList) { Set<Integer> partitions = new HashSet<>(); for (Object o : partitionList) { String partitionString = o.toString(); if (partitionString.charAt(0) == '[') { addRangeToPartitions(partitionString, partitions); } else { partitions.add(Integer.parseInt(partitionString)); } } return partitions; } ColumnPartitionMetadata(String functionName, int numPartitions, Set<Integer> partitions); String getFunctionName(); int getNumPartitions(); Set<Integer> getPartitions(); @Override boolean equals(Object obj); @Override int hashCode(); static Set<Integer> extractPartitions(List partitionList);  }