use of org.apache.mesos.v1.Protos.Value.Range in project Singularity by HubSpot.
the class MesosUtils method getAllPorts.
public static List<Long> getAllPorts(List<Resource> resources) {
Ranges ranges = getRanges(resources, PORTS);
final List<Long> ports = Lists.newArrayList();
if (ranges != null) {
for (Range range : ranges.getRangeList()) {
for (long port = range.getBegin(); port <= range.getEnd(); port++) {
ports.add(port);
}
}
}
return ports;
}