[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-13 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/5443


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-12 Thread tillrohrmann
Github user tillrohrmann commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167502561
  
--- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/JobVertexBackPressureHandlerTest.java
 ---
@@ -57,7 +57,7 @@ public void testGetPaths() {
@Test
public void testResponseNoStatsAvailable() throws Exception {
ExecutionJobVertex jobVertex = mock(ExecutionJobVertex.class);
-   BackPressureStatsTracker statsTracker = 
mock(BackPressureStatsTracker.class);
+   BackPressureStatsTrackerImpl statsTracker = 
mock(BackPressureStatsTrackerImpl.class);
--- End diff --

No unfortunately not, because the `JobVertexBackPressureHandler` requires 
`BackPresureStatsTrackerImpl` because of some methods which are not part of the 
interface.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-12 Thread tillrohrmann
Github user tillrohrmann commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167501726
  
--- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/JobVertexBackPressureHandlerTest.java
 ---
@@ -57,7 +57,7 @@ public void testGetPaths() {
@Test
public void testResponseNoStatsAvailable() throws Exception {
ExecutionJobVertex jobVertex = mock(ExecutionJobVertex.class);
-   BackPressureStatsTracker statsTracker = 
mock(BackPressureStatsTracker.class);
+   BackPressureStatsTrackerImpl statsTracker = 
mock(BackPressureStatsTrackerImpl.class);
--- End diff --

Will change it.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-12 Thread tillrohrmann
Github user tillrohrmann commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167501690
  
--- Diff: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
 ---
@@ -143,7 +143,7 @@
 
private final StackTraceSampleCoordinator stackTraceSamples;
 
-   private final BackPressureStatsTracker backPressureStatsTracker;
+   private final BackPressureStatsTrackerImpl backPressureStatsTrackerImpl;
--- End diff --

True, this is changed in #5457.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-10 Thread zentol
Github user zentol commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167413109
  
--- Diff: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
 ---
@@ -143,7 +143,7 @@
 
private final StackTraceSampleCoordinator stackTraceSamples;
 
-   private final BackPressureStatsTracker backPressureStatsTracker;
+   private final BackPressureStatsTrackerImpl backPressureStatsTrackerImpl;
--- End diff --

Does this only apply to the legacy handler? (It appears the 
JobManagerServices also exposes the implementation instead of the interface.)


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-10 Thread zentol
Github user zentol commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167412925
  
--- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/JobVertexBackPressureHandlerTest.java
 ---
@@ -57,7 +57,7 @@ public void testGetPaths() {
@Test
public void testResponseNoStatsAvailable() throws Exception {
ExecutionJobVertex jobVertex = mock(ExecutionJobVertex.class);
-   BackPressureStatsTracker statsTracker = 
mock(BackPressureStatsTracker.class);
+   BackPressureStatsTrackerImpl statsTracker = 
mock(BackPressureStatsTrackerImpl.class);
--- End diff --

we could replace the mocks in this class with VoidBackPressureStatsTracker 
/ lambda implementations.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-10 Thread tillrohrmann
Github user tillrohrmann commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167412847
  
--- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/VoidBackPressureStatsTracker.java
 ---
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.rest.handler.legacy.backpressure;
+
+import org.apache.flink.runtime.executiongraph.ExecutionJobVertex;
+
+import java.util.Optional;
+
+/**
+ * {@link BackPressureStatsTracker} implementation which returns always no 
back pressure statistics.
--- End diff --

Will do.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-10 Thread tillrohrmann
Github user tillrohrmann commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167412844
  
--- Diff: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
 ---
@@ -143,7 +143,7 @@
 
private final StackTraceSampleCoordinator stackTraceSamples;
 
-   private final BackPressureStatsTracker backPressureStatsTracker;
+   private final BackPressureStatsTrackerImpl backPressureStatsTrackerImpl;
--- End diff --

Actually not, because the legacy `JobVertexBackPressureHandler` needs to 
call methods of the implementation which are not part of the interface.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-10 Thread tillrohrmann
Github user tillrohrmann commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167412781
  
--- Diff: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
 ---
@@ -143,7 +143,7 @@
 
private final StackTraceSampleCoordinator stackTraceSamples;
 
-   private final BackPressureStatsTracker backPressureStatsTracker;
+   private final BackPressureStatsTrackerImpl backPressureStatsTrackerImpl;
--- End diff --

True will change it.


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-09 Thread zentol
Github user zentol commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167267838
  
--- Diff: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
 ---
@@ -143,7 +143,7 @@
 
private final StackTraceSampleCoordinator stackTraceSamples;
 
-   private final BackPressureStatsTracker backPressureStatsTracker;
+   private final BackPressureStatsTrackerImpl backPressureStatsTrackerImpl;
--- End diff --

this should be typed to the interface, and the variable name should not end 
in "Impl".


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-09 Thread zentol
Github user zentol commented on a diff in the pull request:

https://github.com/apache/flink/pull/5443#discussion_r167268048
  
--- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/VoidBackPressureStatsTracker.java
 ---
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.rest.handler.legacy.backpressure;
+
+import org.apache.flink.runtime.executiongraph.ExecutionJobVertex;
+
+import java.util.Optional;
+
+/**
+ * {@link BackPressureStatsTracker} implementation which returns always no 
back pressure statistics.
--- End diff --

switch "returns" and "always"?


---


[GitHub] flink pull request #5443: [FLINK-8626] Introduce BackPressureStatsTracker in...

2018-02-09 Thread tillrohrmann
GitHub user tillrohrmann opened a pull request:

https://github.com/apache/flink/pull/5443

[FLINK-8626] Introduce BackPressureStatsTracker interface

## What is the purpose of the change

Renames BackPressureStatsTracker into BackPressureStatsTrackerImpl and 
introduce
a BackPressureStatsTracker interface. This will make testing easier when we 
don't
have to set up all the different components.

## Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

## Does this pull request potentially affect one of the following parts:

  - Dependencies (does it add or upgrade a dependency): (no)
  - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
  - The serializers: (no)
  - The runtime per-record code paths (performance sensitive): (no)
  - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
  - The S3 file system connector: (no)

## Documentation

  - Does this pull request introduce a new feature? (no)
  - If yes, how is the feature documented? (not applicable)


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/tillrohrmann/flink 
introduceBackPressureStatsTrackerInterface

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/5443.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #5443


commit 8e172aee75e9e0c81608ed7e6796bca1ea7d7544
Author: Till Rohrmann 
Date:   2018-02-09T13:07:31Z

[FLINK-8626] Introduce BackPressureStatsTracker interface

Renames BackPressureStatsTracker into BackPressureStatsTrackerImpl and 
introduce
a BackPressureStatsTracker interface. This will make testing easier when we 
don't
have to set up all the different components.




---