flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GJL <...@git.apache.org>
Subject [GitHub] flink pull request #5236: [FLINK-8322] support getting number of existing ti...
Date Wed, 03 Jan 2018 16:24:44 GMT
Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5236#discussion_r159465985
  
    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/HeapInternalTimerService.java
---
    @@ -442,23 +458,15 @@ public int numEventTimeTimers() {
     	}
     
     	public int numProcessingTimeTimers(N namespace) {
    -		int count = 0;
    -		for (InternalTimer<K, N> timer : processingTimeTimersQueue) {
    -			if (timer.getNamespace().equals(namespace)) {
    -				count++;
    -			}
    -		}
    -		return count;
    +		return processingTimeNumberTimers.column(namespace).keySet().stream()
    +				.mapToInt(k -> processingTimeNumberTimers.get(k, namespace))
    +				.sum();
     	}
     
     	public int numEventTimeTimers(N namespace) {
    --- End diff --
    
    `@Override` annotation is missing
      


---

Mime
View raw message