hit-lacus commented on a change in pull request #1538:
URL: https://github.com/apache/kylin/pull/1538#discussion_r551960205



##########
File path: 
core-metrics/src/main/java/org/apache/kylin/metrics/property/QuerySparkStageEnum.java
##########
@@ -0,0 +1,51 @@
+package org.apache.kylin.metrics.property;
+
+import org.apache.kylin.shaded.com.google.common.base.Strings;
+
+/**
+ * Definition of Metrics dimension and measure for Spark stage
+ */
+public enum QuerySparkStageEnum {
+    PROJECT("PROJECT"),
+    QUERY_ID("QUERY_ID"),
+    EXECUTION_ID("EXECUTION_ID"),
+    JOB_ID("JOB_ID"),
+    STAGE_ID("STAGE_ID"),
+    REALIZATION("REALIZATION"),
+    IF_SUCCESS("IF_SUCCESS"),
+
+    RESULT_SIZE("RESULT_SIZE"),
+    EXECUTOR_DESERIALIZE_TIME("EXECUTOR_DESERIALIZE_TIME"),
+    EXECUTOR_DESERIALIZE_CPU_TIME("EXECUTOR_DESERIALIZE_CPU_TIME"),
+    EXECUTOR_RUN_TIME("EXECUTOR_RUN_TIME"),
+    EXECUTOR_CPU_TIME("EXECUTOR_CPU_TIME"),
+    JVM_GC_TIME("JVM_GC_TIME"),
+    RESULT_SERIALIZATION_TIME("RESULT_SERIALIZATION_TIME"),
+    MEMORY_BYTE_SPILLED("MEMORY_BYTE_SPILLED"),
+    DISK_BYTES_SPILLED("DISK_BYTES_SPILLED"),
+    PEAK_EXECUTION_MEMORY("PEAK_EXECUTION_MEMORY");
+
+    private final String propertyName;
+
+    QuerySparkStageEnum(String name) {
+        this.propertyName = name;
+    }
+
+    public static QuerySparkStageEnum getByName(String name) {
+        if (Strings.isNullOrEmpty(name)) {
+            return null;

Review comment:
       I guess it is better to throw a IllegalArgumentException.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to