private Stream mapHostRangeToHosts()

in src/main/java/com/epam/grid/engine/provider/queue/slurm/SlurmQueueProvider.java [316:328]


    private Stream<String> mapHostRangeToHosts(final String hosts) {
        final Matcher matcher = NODES_RANGE_REGEX.matcher(hosts);
        if (matcher.find()) {
            final String hostName = matcher.group(1);
            final int fromNodeIndex = Integer.parseInt(matcher.group(2));
            final int toNodeIndex = Integer.parseInt(matcher.group(3));
            return IntStream.rangeClosed(fromNodeIndex, toNodeIndex)
                    .mapToObj(hostNumber -> hostName.concat(String.valueOf(hostNumber)));
        } else {
            return Stream.of(hosts.trim());
        }

    }