use of org.apache.kudu.client.Partition in project presto by prestodb.
the class KuduTableProperties method getRangePartitionList.
private static List<RangePartition> getRangePartitionList(KuduTable table, long deadline) {
List<RangePartition> rangePartitions = new ArrayList<>();
if (!table.getPartitionSchema().getRangeSchema().getColumns().isEmpty()) {
try {
Iterator var4 = table.getTabletsLocations(deadline).iterator();
while (var4.hasNext()) {
LocatedTablet tablet = (LocatedTablet) var4.next();
Partition partition = tablet.getPartition();
if (Iterators.all(partition.getHashBuckets().iterator(), Predicates.equalTo(0))) {
RangePartition rangePartition = buildRangePartition(table, partition);
rangePartitions.add(rangePartition);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return rangePartitions;
}
Aggregations