Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-3750]Fix ec history list query results are inaccurate #3752

Merged
merged 2 commits into from Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -60,7 +60,7 @@ import org.springframework.web.bind.annotation._

import javax.servlet.http.HttpServletRequest

import java.text.SimpleDateFormat
import java.text.{MessageFormat, SimpleDateFormat}
import java.util
import java.util.{Comparator, TimeZone}

Expand Down Expand Up @@ -277,8 +277,10 @@ class RMMonitorRest extends Logging {
val searchUsername = if (StringUtils.isEmpty(username)) "" else username
val searchCreator = if (StringUtils.isEmpty(creator)) "" else creator
val searchEngineType = if (StringUtils.isEmpty(engineType)) "" else engineType
// label value in db as :{"creator":"nodeexecution","user":"hadoop","engineType":"appconn","version":"1"}
val labelValuePattern =
"%" + searchCreator + "%" + "," + "%" + searchUsername + "%" + "," + "%" + searchEngineType + "%" + "," + "%"
MessageFormat.format("%{0}%,%{1}%,%{2}%,%", searchCreator, searchUsername, searchEngineType)

if (COMBINED_USERCREATOR_ENGINETYPE == null) {
val userCreatorLabel = labelFactory.createLabel(classOf[UserCreatorLabel])
val engineTypeLabel = labelFactory.createLabel(classOf[EngineTypeLabel])
Expand Down
Expand Up @@ -43,8 +43,6 @@ object EngineType extends Enumeration with Logging {

val PIPELINE = Value("pipeline")

val ES = Value("es")

val PRESTO = Value("presto")

val FLINK = Value("flink")
Expand Down Expand Up @@ -86,7 +84,6 @@ object EngineType extends Enumeration with Logging {
case _ if IO_ENGINE_FILE.toString.equalsIgnoreCase(str) => IO_ENGINE_FILE
case _ if IO_ENGINE_HDFS.toString.equalsIgnoreCase(str) => IO_ENGINE_HDFS
case _ if PIPELINE.toString.equalsIgnoreCase(str) => PIPELINE
case _ if ES.toString.equalsIgnoreCase(str) => ES
case _ if PRESTO.toString.equalsIgnoreCase(str) => PRESTO
case _ if FLINK.toString.equalsIgnoreCase(str) => FLINK
case _ if APPCONN.toString.equals(str) => APPCONN
Expand Down
Expand Up @@ -71,7 +71,8 @@
<where>
<if test="instance != null"> service_instance = #{instance}</if>
<if test="username != null"> and create_user = #{username}</if>
<if test="engineType !=null">and label_value like concat('%',#{engineType},'%')</if>
<!-- label_value in db eg:`hadoop-spark,spark-2.4.3`-->
<if test="engineType !=null">and label_value like concat('%,',#{engineType},'%')</if>
<if test="startDate != null">and create_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
ORDER BY linkis_cg_ec_resource_info_record.create_time DESC
Expand Down