[
https://issues.apache.org/jira/browse/BEAM-6062?focusedWorklogId=166413&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-166413
]
ASF GitHub Bot logged work on BEAM-6062:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Nov/18 12:42
Start Date: 15/Nov/18 12:42
Worklog Time Spent: 10m
Work Description: dmvk closed pull request #7037: [BEAM-6062] Spark
runner do not show Beam metrics in Spark Web Interface
URL: https://github.com/apache/beam/pull/7037
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/MetricsAccumulator.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/MetricsAccumulator.java
index 79569eec9d2..7188bdfc4a3 100644
---
a/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/MetricsAccumulator.java
+++
b/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/MetricsAccumulator.java
@@ -61,7 +61,7 @@ public static void init(SparkPipelineOptions opts,
JavaSparkContext jsc) {
Accumulator<MetricsContainerStepMap> accumulator =
jsc.sc()
.accumulator(
- new MetricsContainerStepMap(),
+ new SparkMetricsContainerStepMap(),
ACCUMULATOR_NAME,
new MetricsAccumulatorParam());
if (maybeCheckpointDir.isPresent()) {
diff --git
a/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/SparkMetricsContainerStepMap.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/SparkMetricsContainerStepMap.java
new file mode 100644
index 00000000000..e716b7c7fa9
--- /dev/null
+++
b/runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/SparkMetricsContainerStepMap.java
@@ -0,0 +1,42 @@
+/*
+ * 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.beam.runners.spark.metrics;
+
+import org.apache.beam.runners.core.metrics.MetricsContainerStepMap;
+
+/**
+ * Sole purpose of this class is to override {@link #toString()} of {@link
MetricsContainerStepMap}
+ * in order to show meaningful metrics in Spark Web Interface.
+ */
+public class SparkMetricsContainerStepMap extends MetricsContainerStepMap {
+
+ @Override
+ public String toString() {
+ return new SparkBeamMetric().renderAll().toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 166413)
Time Spent: 1h 50m (was: 1h 40m)
> Spark runner do not show Beam metrics in Spark Web Interface
> ------------------------------------------------------------
>
> Key: BEAM-6062
> URL: https://issues.apache.org/jira/browse/BEAM-6062
> Project: Beam
> Issue Type: Bug
> Components: runner-spark
> Reporter: Vaclav Plajt
> Assignee: Vaclav Plajt
> Priority: Major
> Attachments: Screen Shot 2018-11-07 at 13.15.28.png
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Spark's web interface do not show Beam metrics. There is only one
> `Accumulable` "Beam.Metrics" with value acquired from java
> `SparkMetricsContainerStepMap#toString()` which is default
> `Object#toString()` implementation.
> !Screen Shot 2018-11-07 at 13.15.28.png!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)