List<GlobalPartitionId> ret = new ArrayList();
for(String host: new TreeMap<String, List>(partitions).keySet()) {
List info = partitions.get(host);
long port = (Long) info.get(0);
long numPartitions = (Long) info.get(1);
HostPort hp = new HostPort(host, (int) port);
for(int i=0; i<numPartitions; i++) {
ret.add(new GlobalPartitionId(hp, i));
}
}
return ret;