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
[WIP] remove json4s from linkis #4368
Conversation
@jackxu2011 @rarexixi please help review |
...utation-client/src/main/scala/org/apache/linkis/ujes/client/response/JobProgressResult.scala
Outdated
Show resolved
Hide resolved
) | ||
def getYarnResource(resource: Option[Any]) = resource.map(r => { | ||
val value = | ||
JsonUtils.jackson.readValue(r.asInstanceOf[YarnResource].toJson, classOf[Map[String, Any]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the json is useless, just cast the resource to YarnResource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have given up this method, reduce json parse times.
...anager/src/main/scala/org/apache/linkis/manager/rm/external/yarn/YarnResourceRequester.scala
Outdated
Show resolved
Hide resolved
...anager/src/main/scala/org/apache/linkis/manager/rm/external/yarn/YarnResourceRequester.scala
Outdated
Show resolved
Hide resolved
linkis-computation-governance/linkis-manager/linkis-application-manager/pom.xml
Outdated
Show resolved
Hide resolved
@@ -298,9 +297,9 @@ class DefaultEngineCreateService | |||
resource, | |||
timeout | |||
) match { | |||
case AvailableResource(ticketId) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to return Json here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems it is used for getting resource [resourceTicketId, resource] info if we got enough resource, or we will throw not enough resource.
val emNode = choseNode.get.asInstanceOf[EMNode]
// 4. 请求资源
val (resourceTicketId, resource) =
requestResource(engineCreateRequest, labelFilter.choseEngineLabel(labelList), emNode, timeout)
// 5. 封装engineBuildRequest对象,并发送给EM进行执行
val engineBuildRequest = EngineConnBuildRequestImpl(
resourceTicketId,
labelFilter.choseEngineLabel(labelList),
resource,
EngineConnCreationDescImpl(
engineCreateRequest.getCreateService,
engineCreateRequest.getDescription,
engineCreateRequest.getProperties
)
)
0d | ||
val absoluteCapacity = JsonPath.read(r, "$.absoluteCapacity") | ||
|
||
if (absoluteCapacity.isInstanceOf[BigDecimal]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The judgment here is not assigned a value in the end. Is it necessary to judge BigDecimal here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have changed to assign the value while judging datatype.
val app = ctx.read("$.apps.app") | ||
|
||
val queueValue = ctx.read("$.apps.app.queue").asInstanceOf[String] | ||
val stateValue = ctx.read("$.apps.app.state").asInstanceOf[String] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it should iterate
} | ||
|
||
def serializeResource(resource: Resource): String = { | ||
write(resource) | ||
JsonUtils.jackson.writeValueAsString(resource, classOf[Map[String, Any]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to specify the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is the purpose of the change
use jackson to replace json4s, we can reduce the linkis dependency
Related issues/PRs
Related issues: #4186
Related pr:#4368
Brief change log
Checklist