int nodeId = 0;
for(int zoneId = 0; zoneId < zoneToHostNames.size(); zoneId++) {
List<String> hostNames = zoneToHostNames.get(zoneId);
for(int i = 0; i < cluster.getNumberOfNodes(); i++) {
Node node = cluster.getNodeById(nodeId);
String hostName = hostNames.get(i);
List<Integer> partitions = node.getPartitionIds();
ClusterNodeDescriptor cnd = new ClusterNodeDescriptor();
cnd.setHostName(hostName);
cnd.setId(nodeId);
cnd.setSocketPort(node.getSocketPort());
cnd.setHttpPort(node.getHttpPort());
cnd.setAdminPort(node.getAdminPort());
cnd.setPartitions(partitions);
cnd.setZoneId(zoneId);
nodeId++;
list.add(cnd);