org.apache.flink.util.UnionIterator Java Examples
The following examples show how to use
org.apache.flink.util.UnionIterator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AggregatingSubtasksMetricsHandler.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
private Iterable<Integer> getIntegerRangeFromString(Collection<String> ranges) { UnionIterator<Integer> iterators = new UnionIterator<>(); for (String rawRange : ranges) { try { Iterator<Integer> rangeIterator; String range = rawRange.trim(); int dashIdx = range.indexOf('-'); if (dashIdx == -1) { // only one value in range: rangeIterator = Collections.singleton(Integer.valueOf(range)).iterator(); } else { // evaluate range final int start = Integer.valueOf(range.substring(0, dashIdx)); final int end = Integer.valueOf(range.substring(dashIdx + 1, range.length())); rangeIterator = IntStream.rangeClosed(start, end).iterator(); } iterators.add(rangeIterator); } catch (NumberFormatException nfe) { log.warn("Invalid value {} specified for integer range. Not a number.", rawRange, nfe); } } return iterators; }
Example #2
Source File: AggregatingSubtasksMetricsHandler.java From flink with Apache License 2.0 | 6 votes |
private Iterable<Integer> getIntegerRangeFromString(Collection<String> ranges) { UnionIterator<Integer> iterators = new UnionIterator<>(); for (String rawRange : ranges) { try { Iterator<Integer> rangeIterator; String range = rawRange.trim(); int dashIdx = range.indexOf('-'); if (dashIdx == -1) { // only one value in range: rangeIterator = Collections.singleton(Integer.valueOf(range)).iterator(); } else { // evaluate range final int start = Integer.valueOf(range.substring(0, dashIdx)); final int end = Integer.valueOf(range.substring(dashIdx + 1, range.length())); rangeIterator = IntStream.rangeClosed(start, end).iterator(); } iterators.add(rangeIterator); } catch (NumberFormatException nfe) { log.warn("Invalid value {} specified for integer range. Not a number.", rawRange, nfe); } } return iterators; }
Example #3
Source File: AggregatingSubtasksMetricsHandler.java From flink with Apache License 2.0 | 6 votes |
private Iterable<Integer> getIntegerRangeFromString(Collection<String> ranges) { UnionIterator<Integer> iterators = new UnionIterator<>(); for (String rawRange : ranges) { try { Iterator<Integer> rangeIterator; String range = rawRange.trim(); int dashIdx = range.indexOf('-'); if (dashIdx == -1) { // only one value in range: rangeIterator = Collections.singleton(Integer.valueOf(range)).iterator(); } else { // evaluate range final int start = Integer.valueOf(range.substring(0, dashIdx)); final int end = Integer.valueOf(range.substring(dashIdx + 1, range.length())); rangeIterator = IntStream.rangeClosed(start, end).iterator(); } iterators.add(rangeIterator); } catch (NumberFormatException nfe) { log.warn("Invalid value {} specified for integer range. Not a number.", rawRange, nfe); } } return iterators; }