You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2017/09/28 11:00:59 UTC

[1/7] flink git commit: [FLINK-7645] [docs][metrics] Add system-metrics subsections to ToC

Repository: flink
Updated Branches:
  refs/heads/master 278989c7f -> 426137f51


[FLINK-7645] [docs][metrics] Add system-metrics subsections to ToC

This closes #4693.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a0df5e1c
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a0df5e1c
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a0df5e1c

Branch: refs/heads/master
Commit: a0df5e1ccff64910fcd09957304a750711f073fc
Parents: 3d2f4cb
Author: yew1eb <ye...@gmail.com>
Authored: Thu Sep 21 14:17:10 2017 +0800
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:32 2017 +0200

----------------------------------------------------------------------
 docs/monitoring/metrics.md | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a0df5e1c/docs/monitoring/metrics.md
----------------------------------------------------------------------
diff --git a/docs/monitoring/metrics.md b/docs/monitoring/metrics.md
index abf80f5..595051c 100644
--- a/docs/monitoring/metrics.md
+++ b/docs/monitoring/metrics.md
@@ -515,7 +515,7 @@ Thus, in order to infer the metric identifier:
 2. Append the value in the "Infix" column if present, and account for the "metrics.delimiter" setting
 3. Append metric name.
 
-#### CPU:
+### CPU
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -539,7 +539,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### Memory:
+### Memory
 <table class="table table-bordered">                               
   <thead>                                                          
     <tr>                                                           
@@ -603,7 +603,7 @@ Thus, in order to infer the metric identifier:
   </tbody>                                                         
 </table>
 
-#### Threads:
+### Threads
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -623,7 +623,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### GarbageCollection:
+### GarbageCollection
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -647,7 +647,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### ClassLoader:
+### ClassLoader
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -671,7 +671,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### Network:
+### Network
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -731,7 +731,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### Cluster:
+### Cluster
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -761,7 +761,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### Availability:
+### Availability
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -797,7 +797,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### Checkpointing:
+### Checkpointing
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -852,7 +852,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### IO:
+### IO
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -920,9 +920,9 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-#### Connectors:
+### Connectors
 
-##### Kafka Connectors
+#### Kafka Connectors
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -945,7 +945,7 @@ Thus, in order to infer the metric identifier:
   </tbody>
 </table>
 
-### Latency tracking
+## Latency tracking
 
 Flink allows to track the latency of records traveling through the system. To enable the latency tracking
 a `latencyTrackingInterval` (in milliseconds) has to be set to a positive value in the `ExecutionConfig`.
@@ -968,7 +968,7 @@ latency issues caused by individual machines.
 Currently, Flink assumes that the clocks of all machines in the cluster are in sync. We recommend setting
 up an automated clock synchronisation service (like NTP) to avoid false latency results.
 
-### Dashboard integration
+## Dashboard integration
 
 Metrics that were gathered for each task or operator can also be visualized in the Dashboard. On the main page for a
 job, select the `Metrics` tab. After selecting one of the tasks in the top graph you can select metrics to display using


[4/7] flink git commit: [FLINK-4664] [webUI] Show uploaded-jars descending by upload time

Posted by ch...@apache.org.
[FLINK-4664] [webUI] Show uploaded-jars descending by upload time

This closes #4664.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/01b30515
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/01b30515
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/01b30515

Branch: refs/heads/master
Commit: 01b30515cd2a09ac228dd53e9905932f2eadd1f7
Parents: 1b71040
Author: yew1eb <ye...@gmail.com>
Authored: Sat Sep 9 15:40:08 2017 +0800
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:33 2017 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/webmonitor/handlers/JarListHandler.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/01b30515/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
index 746870b..f620cd1 100644
--- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
@@ -31,6 +31,7 @@ import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.util.Arrays;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CompletionException;
@@ -76,6 +77,9 @@ public class JarListHandler extends AbstractJsonRequestHandler {
 						}
 					});
 
+					// last modified ascending order
+					Arrays.sort(list, (f1, f2) -> Long.compare(f2.lastModified(), f1.lastModified()));
+
 					for (File f : list) {
 						// separate the uuid and the name parts.
 						String id = f.getName();


[6/7] flink git commit: [FLINK-7725] [REST] Add testbase for requests / allow exceptions

Posted by ch...@apache.org.
[FLINK-7725] [REST] Add testbase for requests / allow exceptions


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/426137f5
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/426137f5
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/426137f5

Branch: refs/heads/master
Commit: 426137f5100d213c9c9c2f05c81f63f1f52ed33e
Parents: 40948d3
Author: zentol <ch...@apache.org>
Authored: Thu Sep 28 10:25:58 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:33 2017 +0200

----------------------------------------------------------------------
 .../RestRequestMarshallingTestBase.java         | 63 ++++++++++++++++++++
 .../RestResponseMarshallingTestBase.java        |  6 +-
 2 files changed, 65 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/426137f5/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestRequestMarshallingTestBase.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestRequestMarshallingTestBase.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestRequestMarshallingTestBase.java
new file mode 100644
index 0000000..2eb37cb
--- /dev/null
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestRequestMarshallingTestBase.java
@@ -0,0 +1,63 @@
+/*
+ * 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.messages;
+
+import org.apache.flink.runtime.rest.messages.RequestBody;
+import org.apache.flink.runtime.rest.util.RestMapperUtils;
+import org.apache.flink.util.TestLogger;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test base for verifying that marshalling / unmarshalling REST {@link RequestBody}s work properly.
+ */
+public abstract class RestRequestMarshallingTestBase<R extends RequestBody> extends TestLogger {
+
+	/**
+	 * Returns the class of the test response.
+	 *
+	 * @return class of the test response type
+	 */
+	protected abstract Class<R> getTestRequestClass();
+
+	/**
+	 * Returns an instance of a response to be tested.
+	 *
+	 * @return instance of the expected test response
+	 */
+	protected abstract R getTestRequestInstance() throws Exception;
+
+	/**
+	 * Tests that we can marshal and unmarshal the response.
+	 */
+	@Test
+	public void testJsonMarshalling() throws Exception {
+		final R expected = getTestRequestInstance();
+
+		ObjectMapper objectMapper = RestMapperUtils.getStrictObjectMapper();
+		JsonNode json = objectMapper.valueToTree(expected);
+
+		final R unmarshalled = objectMapper.treeToValue(json, getTestRequestClass());
+		Assert.assertEquals(expected, unmarshalled);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/426137f5/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestResponseMarshallingTestBase.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestResponseMarshallingTestBase.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestResponseMarshallingTestBase.java
index fce60ac..db44b08 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestResponseMarshallingTestBase.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/messages/RestResponseMarshallingTestBase.java
@@ -22,10 +22,8 @@ import org.apache.flink.runtime.rest.messages.ResponseBody;
 import org.apache.flink.runtime.rest.util.RestMapperUtils;
 import org.apache.flink.util.TestLogger;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
-
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -46,13 +44,13 @@ public abstract class RestResponseMarshallingTestBase<R extends ResponseBody> ex
 	 *
 	 * @return instance of the expected test response
 	 */
-	protected abstract R getTestResponseInstance();
+	protected abstract R getTestResponseInstance() throws Exception;
 
 	/**
 	 * Tests that we can marshal and unmarshal the response.
 	 */
 	@Test
-	public void testJsonMarshalling() throws JsonProcessingException {
+	public void testJsonMarshalling() throws Exception {
 		final R expected = getTestResponseInstance();
 
 		ObjectMapper objectMapper = RestMapperUtils.getStrictObjectMapper();


[7/7] flink git commit: [FLINK-7659] Fix unprotected access to inProgress in JobCancellationWithSavepointHandlers#handleNewRequest

Posted by ch...@apache.org.
[FLINK-7659] Fix unprotected access to inProgress in JobCancellationWithSavepointHandlers#handleNewRequest

This closes #4703.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/1b710403
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/1b710403
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/1b710403

Branch: refs/heads/master
Commit: 1b71040384785623fcd9369dae1241914bb5b7b1
Parents: a0df5e1
Author: Bowen Li <bo...@gmail.com>
Authored: Thu Sep 21 22:33:17 2017 -0700
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:33 2017 +0200

----------------------------------------------------------------------
 .../handler/legacy/JobCancellationWithSavepointHandlers.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/1b710403/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/JobCancellationWithSavepointHandlers.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/JobCancellationWithSavepointHandlers.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/JobCancellationWithSavepointHandlers.java
index fe71a52..da4f20b 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/JobCancellationWithSavepointHandlers.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/JobCancellationWithSavepointHandlers.java
@@ -219,7 +219,9 @@ public class JobCancellationWithSavepointHandlers {
 									completed.put(requestId, path);
 								}
 							} finally {
-								inProgress.remove(jobId);
+								synchronized (lock) {
+									inProgress.remove(jobId);
+								}
 							}
 						}, executor);
 


[3/7] flink git commit: [FLINK-7724] [metrics] Add extra metrics to MetricStoreTest.setupStore

Posted by ch...@apache.org.
[FLINK-7724] [metrics] Add extra metrics to MetricStoreTest.setupStore

This closes #4739.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/f85bbf30
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/f85bbf30
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/f85bbf30

Branch: refs/heads/master
Commit: f85bbf309ab95bbbea38d03094b74682f5dbc63a
Parents: 278989c
Author: Bowen Li <bo...@gmail.com>
Authored: Wed Sep 27 15:30:02 2017 -0700
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:32 2017 +0200

----------------------------------------------------------------------
 .../legacy/metrics/AbstractMetricsHandlerTest.java   | 15 ++++++++-------
 .../legacy/metrics/JobMetricsHandlerTest.java        |  1 +
 .../legacy/metrics/JobVertexMetricsHandlerTest.java  |  6 +++---
 .../rest/handler/legacy/metrics/MetricStoreTest.java | 14 ++++++++++----
 4 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
index 7cbbdc1..8c38e79 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
@@ -61,30 +61,31 @@ public class AbstractMetricsHandlerTest extends TestLogger {
 		String availableList = handler.handleJsonRequest(pathParams, queryParams, null).get();
 
 		assertEquals("[" +
-				"{\"id\":\"8.opname.abc.metric5\"}," +
-				"{\"id\":\"8.abc.metric4\"}" +
+				"{\"id\":\"8.opname.abc.metric6\"}," +
+				"{\"id\":\"8.opname.abc.metric7\"}," +
+				"{\"id\":\"8.abc.metric5\"}" +
 				"]",
 			availableList);
 
 		// get value for a single metric
-		queryParams.put("get", "8.opname.abc.metric5");
+		queryParams.put("get", "8.opname.abc.metric6");
 
 		String metricValue = handler.handleJsonRequest(pathParams, queryParams, null).get();
 
 		assertEquals("[" +
-				"{\"id\":\"8.opname.abc.metric5\",\"value\":\"4\"}" +
+				"{\"id\":\"8.opname.abc.metric6\",\"value\":\"5\"}" +
 				"]"
 			, metricValue
 		);
 
 		// get values for multiple metrics
-		queryParams.put("get", "8.opname.abc.metric5,8.abc.metric4");
+		queryParams.put("get", "8.opname.abc.metric6,8.abc.metric5");
 
 		String metricValues = handler.handleJsonRequest(pathParams, queryParams, null).get();
 
 		assertEquals("[" +
-				"{\"id\":\"8.opname.abc.metric5\",\"value\":\"4\"}," +
-				"{\"id\":\"8.abc.metric4\",\"value\":\"3\"}" +
+				"{\"id\":\"8.opname.abc.metric6\",\"value\":\"5\"}," +
+				"{\"id\":\"8.abc.metric5\",\"value\":\"4\"}" +
 				"]",
 			metricValues
 		);

http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
index 4b28e65..97ccd07 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
@@ -64,6 +64,7 @@ public class JobMetricsHandlerTest extends TestLogger {
 		Map<String, String> metrics = handler.getMapFor(pathParams, store);
 
 		assertEquals("2", metrics.get("abc.metric3"));
+		assertEquals("3", metrics.get("abc.metric4"));
 	}
 
 	@Test

http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
index c1304c4..1dee996 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
@@ -65,9 +65,9 @@ public class JobVertexMetricsHandlerTest extends TestLogger {
 
 		Map<String, String> metrics = handler.getMapFor(pathParams, store);
 
-		assertEquals("3", metrics.get("8.abc.metric4"));
-
-		assertEquals("4", metrics.get("8.opname.abc.metric5"));
+		assertEquals("4", metrics.get("8.abc.metric5"));
+		assertEquals("5", metrics.get("8.opname.abc.metric6"));
+		assertEquals("6", metrics.get("8.opname.abc.metric7"));
 	}
 
 	@Test

http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
index 2e83e08..31225ad 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
@@ -39,8 +39,10 @@ public class MetricStoreTest extends TestLogger {
 		assertEquals("0", store.getJobManagerMetricStore().getMetric("abc.metric1", "-1"));
 		assertEquals("1", store.getTaskManagerMetricStore("tmid").getMetric("abc.metric2", "-1"));
 		assertEquals("2", store.getJobMetricStore("jobid").getMetric("abc.metric3", "-1"));
-		assertEquals("3", store.getTaskMetricStore("jobid", "taskid").getMetric("8.abc.metric4", "-1"));
-		assertEquals("4", store.getTaskMetricStore("jobid", "taskid").getMetric("8.opname.abc.metric5", "-1"));
+		assertEquals("3", store.getJobMetricStore("jobid").getMetric("abc.metric4", "-1"));
+		assertEquals("4", store.getTaskMetricStore("jobid", "taskid").getMetric("8.abc.metric5", "-1"));
+		assertEquals("5", store.getTaskMetricStore("jobid", "taskid").getMetric("8.opname.abc.metric6", "-1"));
+		assertEquals("6", store.getTaskMetricStore("jobid", "taskid").getMetric("8.opname.abc.metric7", "-1"));
 	}
 
 	@Test
@@ -70,18 +72,22 @@ public class MetricStoreTest extends TestLogger {
 
 		QueryScopeInfo.JobQueryScopeInfo job = new QueryScopeInfo.JobQueryScopeInfo("jobid", "abc");
 		MetricDump.CounterDump cd3 = new MetricDump.CounterDump(job, "metric3", 2);
+		MetricDump.CounterDump cd4 = new MetricDump.CounterDump(job, "metric4", 3);
 
 		QueryScopeInfo.TaskQueryScopeInfo task = new QueryScopeInfo.TaskQueryScopeInfo("jobid", "taskid", 8, "abc");
-		MetricDump.CounterDump cd4 = new MetricDump.CounterDump(task, "metric4", 3);
+		MetricDump.CounterDump cd5 = new MetricDump.CounterDump(task, "metric5", 4);
 
 		QueryScopeInfo.OperatorQueryScopeInfo operator = new QueryScopeInfo.OperatorQueryScopeInfo("jobid", "taskid", 8, "opname", "abc");
-		MetricDump.CounterDump cd5 = new MetricDump.CounterDump(operator, "metric5", 4);
+		MetricDump.CounterDump cd6 = new MetricDump.CounterDump(operator, "metric6", 5);
+		MetricDump.CounterDump cd7 = new MetricDump.CounterDump(operator, "metric7", 6);
 
 		store.add(cd1);
 		store.add(cd2);
 		store.add(cd3);
 		store.add(cd4);
 		store.add(cd5);
+		store.add(cd6);
+		store.add(cd7);
 
 		return store;
 	}


[5/7] flink git commit: [hotfix] [REST] Add note about placement of FileServerHandler

Posted by ch...@apache.org.
[hotfix] [REST] Add note about placement of FileServerHandler


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/40948d33
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/40948d33
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/40948d33

Branch: refs/heads/master
Commit: 40948d332489081572258a6c4cf7cc043f97c645
Parents: 01b3051
Author: zentol <ch...@apache.org>
Authored: Thu Sep 28 10:45:00 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:33 2017 +0200

----------------------------------------------------------------------
 .../org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/40948d33/flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java b/flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java
index 46df37e..c092ea0 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DispatcherRestEndpoint.java
@@ -152,6 +152,7 @@ public class DispatcherRestEndpoint extends RestServerEndpoint {
 		handlers.add(Tuple2.of(CurrentJobsOverviewHandlerHeaders.getInstance(), currentJobsOverviewHandler));
 		handlers.add(Tuple2.of(JobTerminationHeaders.getInstance(), jobTerminationHandler));
 
+		// This handler MUST be added last, as it otherwise masks all subsequent GET handlers
 		optWebContent.ifPresent(
 			webContent -> handlers.add(Tuple2.of(WebContentHandlerSpecification.getInstance(), webContent)));
 


[2/7] flink git commit: [FLINK-7675] [metrics] LatestCompletedCheckpointExternalPathGauge should check if external path is exist

Posted by ch...@apache.org.
[FLINK-7675] [metrics] LatestCompletedCheckpointExternalPathGauge should check if external path is exist

This closes #4709.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/3d2f4cb0
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/3d2f4cb0
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/3d2f4cb0

Branch: refs/heads/master
Commit: 3d2f4cb09d0ead0454523c1a95643a118cc36457
Parents: f85bbf3
Author: Tony Wei <to...@gmail.com>
Authored: Sat Sep 23 18:49:32 2017 +0800
Committer: zentol <ch...@apache.org>
Committed: Thu Sep 28 11:28:32 2017 +0200

----------------------------------------------------------------------
 docs/monitoring/metrics.md                              |  2 +-
 .../runtime/checkpoint/CheckpointStatsTracker.java      |  2 +-
 .../runtime/checkpoint/CheckpointStatsTrackerTest.java  | 12 ++++++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/3d2f4cb0/docs/monitoring/metrics.md
----------------------------------------------------------------------
diff --git a/docs/monitoring/metrics.md b/docs/monitoring/metrics.md
index 267c0c0..abf80f5 100644
--- a/docs/monitoring/metrics.md
+++ b/docs/monitoring/metrics.md
@@ -818,7 +818,7 @@ Thus, in order to infer the metric identifier:
     </tr>
     <tr>
       <td>lastCheckpointExternalPath</td>
-      <td>The path where the last checkpoint was stored.</td>
+      <td>The path where the last external checkpoint was stored.</td>
     </tr>
     <tr>
       <td>lastCheckpointRestoreTimestamp</td>

http://git-wip-us.apache.org/repos/asf/flink/blob/3d2f4cb0/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java b/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java
index fc9dd94..09b8c78 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java
@@ -442,7 +442,7 @@ public class CheckpointStatsTracker {
 		@Override
 		public String getValue() {
 			CompletedCheckpointStats completed = latestCompletedCheckpoint;
-			if (completed != null) {
+			if (completed != null && completed.getExternalPath() != null) {
 				return completed.getExternalPath();
 			} else {
 				return "n/a";

http://git-wip-us.apache.org/repos/asf/flink/blob/3d2f4cb0/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTrackerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTrackerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTrackerTest.java
index d66d0be..10e897a 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTrackerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTrackerTest.java
@@ -507,6 +507,18 @@ public class CheckpointStatsTrackerTest {
 		assertEquals(Long.valueOf(1), numFailedCheckpoints.getValue());
 
 		assertEquals(Long.valueOf(restoreTimestamp), latestRestoreTimestamp.getValue());
+
+		// Check Internal Checkpoint Configuration
+		PendingCheckpointStats thirdPending = stats.reportPendingCheckpoint(
+			2,
+			5000,
+			CheckpointProperties.forStandardCheckpoint());
+
+		thirdPending.reportSubtaskStats(jobVertex.getJobVertexId(), subtaskStats);
+		thirdPending.reportCompletedCheckpoint(null);
+
+		// Verify external path is "n/a", because internal checkpoint won't generate external path.
+		assertEquals("n/a", latestCompletedExternalPath.getValue());
 	}
 
 	// ------------------------------------------------------------------------