&& hasAvailablePorts(Configuration.getInt(Constants.WORKER_WEB_PORT), ranges)
&& hasAvailablePorts(Configuration.getInt(Constants.WORKER_RPC_PORT), ranges)
&& hasAvailablePorts(Configuration.getInt(Constants.WORKER_DATA_PORT), ranges);
}
private static boolean hasAvailablePorts(int port, Protos.Value.Ranges ranges) {
<BUG>for (Protos.Value.Range range : ranges.getRangeList()) {
if (port >= range.getBegin() && port <= range.getEnd()) {</BUG>
return true;
}
}

&& hasAvailablePorts(Configuration.getInt(Constants.WORKER_WEB_PORT), ranges)
&& hasAvailablePorts(Configuration.getInt(Constants.WORKER_RPC_PORT), ranges)
&& hasAvailablePorts(Configuration.getInt(Constants.WORKER_DATA_PORT), ranges);
}
private static boolean hasAvailablePorts(int port, Protos.Value.Ranges ranges) {
for (Protos.Value.Range range : ranges.getRangeList()) {
LOG.debug(String.format("Port range %s", range));
if (port >= range.getBegin() && port <= range.getEnd()) {
return true;
}
}
