Lemarais commented on a change in pull request #317:
URL: https://github.com/apache/incubator-nemo/pull/317#discussion_r702384596
##########
File path:
compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/GBKTransform.java
##########
@@ -166,6 +167,13 @@ public void onWatermark(final Watermark watermark) throws
RuntimeException {
checkAndFinishBundle();
}
+ @Override
+ public void onLatencymark(final Latencymark latencymark) {
+ checkAndInvokeBundle();
+ getOutputCollector().emitLatencymark(latencymark);
+ checkAndFinishBundle();
Review comment:
done
##########
File path:
compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/PushBackDoFnTransform.java
##########
@@ -160,6 +161,15 @@ public void onWatermark(final Watermark watermark) {
checkAndFinishBundle();
}
+
+ @Override
+ public void onLatencymark(final Latencymark latencymark) {
+ checkAndInvokeBundle();
Review comment:
done
##########
File path:
compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/PushBackDoFnTransform.java
##########
@@ -160,6 +161,15 @@ public void onWatermark(final Watermark watermark) {
checkAndFinishBundle();
}
+
+ @Override
+ public void onLatencymark(final Latencymark latencymark) {
+ checkAndInvokeBundle();
+ getOutputCollector().emitLatencymark(latencymark);
+ checkAndFinishBundle();
Review comment:
done
##########
File path:
compiler/frontend/spark/src/main/java/org/apache/nemo/compiler/frontend/spark/transform/FlatMapTransform.java
##########
@@ -61,6 +62,11 @@ public void onWatermark(final Watermark watermark) {
outputCollector.emitWatermark(watermark);
}
+ @Override
+ public void onLatencymark(final Latencymark latencymark) {
Review comment:
done
##########
File path:
compiler/frontend/spark/src/main/java/org/apache/nemo/compiler/frontend/spark/transform/MapToPairTransform.java
##########
@@ -64,6 +65,11 @@ public void onWatermark(final Watermark watermark) {
outputCollector.emitWatermark(watermark);
}
+ @Override
+ public void onLatencymark(final Latencymark latencymark) {
Review comment:
done
##########
File path: conf/src/main/java/org/apache/nemo/conf/JobConf.java
##########
@@ -250,6 +250,25 @@
public final class ExecutorJSONContents implements Name<String> {
}
+ ///////////////////////// Metric Configurations
+ /**
+ * Period how often stream metrics are recorded. the unit of period is
millisecond.
+ * -1 indicates that metrics are not recorded periodically.
+ */
+ @NamedParameter(doc = "Period how often stream-related metrics are recorded.
the unit of period is millisecond.",
Review comment:
done
##########
File path: conf/src/main/java/org/apache/nemo/conf/JobConf.java
##########
@@ -250,6 +250,25 @@
public final class ExecutorJSONContents implements Name<String> {
}
+ ///////////////////////// Metric Configurations
+ /**
+ * Period how often stream metrics are recorded. the unit of period is
millisecond.
+ * -1 indicates that metrics are not recorded periodically.
+ */
+ @NamedParameter(doc = "Period how often stream-related metrics are recorded.
the unit of period is millisecond.",
+ short_name = "stream_metric_period", default_value = "-1")
+ public final class StreamMetricPeriod implements Name<Integer> {
+ }
+
+ /**
+ * Period how often latencymarks are sent from source vertex. the unit of
period is millisecond.
+ * -1 indicates that latencymarks are not sent.
+ */
+ @NamedParameter(doc = "Period how often latencymarks are sent from source
vertex. the unit of period is millisecond.",
Review comment:
done
##########
File path:
runtime/common/src/main/java/org/apache/nemo/runtime/common/metric/LatencyMetric.java
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.nemo.runtime.common.metric;
+
+import org.apache.nemo.common.punctuation.Latencymark;
+
+import java.io.Serializable;
+
+/**
+ * Metric class for latency.
+ */
+public class LatencyMetric implements Serializable {
Review comment:
done
##########
File path:
runtime/common/src/main/java/org/apache/nemo/runtime/common/metric/LatencyMetric.java
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.nemo.runtime.common.metric;
+
+import org.apache.nemo.common.punctuation.Latencymark;
+
+import java.io.Serializable;
+
+/**
+ * Metric class for latency.
Review comment:
done
##########
File path:
runtime/common/src/main/java/org/apache/nemo/runtime/common/metric/StreamMetric.java
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.nemo.runtime.common.metric;
+
+import java.io.Serializable;
+
+/**
+ * Metric associated with stream. it is periodically recorded.
+ */
+public class StreamMetric implements Serializable {
Review comment:
done
##########
File path:
runtime/common/src/main/java/org/apache/nemo/runtime/common/metric/StreamMetric.java
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.nemo.runtime.common.metric;
+
+import java.io.Serializable;
+
+/**
+ * Metric associated with stream. it is periodically recorded.
Review comment:
done
##########
File path:
runtime/common/src/main/java/org/apache/nemo/runtime/common/metric/TaskMetric.java
##########
@@ -106,6 +110,33 @@ private void setTaskDuration(final long taskDuration) {
this.taskDuration = taskDuration;
}
+ /**
+ * Method related to stream metric.
+ */
+ public final Map<String, List<StreamMetric>> getStreamMetric() {
+ return this.streamMetrics;
+ }
+
+ private void setStreamMetric(final Map<String, StreamMetric>
streamMetricMap) {
+ for (String sourceVertexId : streamMetricMap.keySet()) {
+ StreamMetric streamMetric = streamMetricMap.get(sourceVertexId);
+ this.streamMetrics.putIfAbsent(sourceVertexId, new ArrayList<>());
+ this.streamMetrics.get(sourceVertexId).add(streamMetric);
+ }
+ }
+
+ /**
+ * Method related to latency.
+ */
+ public final Map<String, List<LatencyMetric>> getLatencymarks() {
+ return this.latencymarks;
+ }
+
+ private void addLatencymark(final LatencyMetric latencyMetric) {
+
this.latencymarks.putIfAbsent(latencyMetric.getLatencymark().getLastTaskId(),
new ArrayList<>());
Review comment:
done
##########
File path:
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/datatransfer/NemoEventDecoderFactory.java
##########
@@ -84,6 +85,9 @@ public Object decode() throws IOException {
final WatermarkWithIndex watermarkWithIndex =
(WatermarkWithIndex) SerializationUtils.deserialize(inputStream);
return watermarkWithIndex;
+ } else if (isWatermark == 0x02) {
Review comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]