Hean-Chhinling opened a new pull request, #8227:
URL: https://github.com/apache/hadoop/pull/8227
… upgrade
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
Retrieving the logs for a running application fails as the logs CLI expects
a JSON object as a response when calling the NM REST API, and it provides a
JSON Array
Actual response with Jersey 2:
```
[
{
"containerLogsInfo": {
"containerLogInfo": [
{
"fileName": "stderr",
"fileSize": "0",
"lastModifiedTime": "Wed Nov 12 13:26:19 +0000 2025"
},
...
],
"logAggregationType": "LOCAL",
"containerId": "container_e80_1762940127665_0015_01_000003",
"nodeId": "ccycloud-2.native-moxy4.root.comops.site:8041"
}
}
]
```
Expected response with Jersey 1:
```
{
"containerLogsInfo": [
{
"containerLogInfo": {
"fileName": "logfile1",
"fileSize": "12",
"lastModifiedTime": "Thu Nov 13 13:11:14 +0100 2025"
},
"logAggregationType": "LOCAL",
"containerId": "container_0_0000_00_000000",
"nodeId": "testhost.foo.com:8042"
},
{
"containerLogInfo": {
"fileName": "logfile1-aggregated",
"fileSize": "23",
"lastModifiedTime": "Thu Nov 13 13:11:14 +0100 2025"
},
"logAggregationType": "AGGREGATED",
"containerId": "container_0_0000_00_000000",
"nodeId": "testhost.foo.com_8042"
}
]
}
```
### How was this patch tested?
Tested on a cluster:
- Logs CLI works for running/finished applications
- UI v2 works when loading containers for a node
Response format for `/ws/v1/node/containers/{container-id}/logs` endpoint
seems compatible with the Jersey 1 format comparing them with a nightly version:
**JSON**:
```
{
"containerLogsInfo": [
{
"containerLogInfo": [
{
"fileName": "stderr",
"fileSize": "0",
"lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
},
{
"fileName": "prelaunch.err",
"fileSize": "0",
"lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
},
{
"fileName": "prelaunch.out",
"fileSize": "70",
"lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
},
{
"fileName": "stdout",
"fileSize": "0",
"lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
}
],
"logAggregationType": "LOCAL",
"containerId": "container_e87_1763463022925_0008_01_000003",
"nodeId": "ccycloud-2.native-moxy4.root.comops.site:8041"
}
]
}
```
**XML**:
```
<containerLogsInfoes>
<containerLogsInfo>
<containerLogInfo>
<fileName>stderr</fileName>
<fileSize>0</fileSize>
<lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
</containerLogInfo>
<containerLogInfo>
<fileName>prelaunch.err</fileName>
<fileSize>0</fileSize>
<lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
</containerLogInfo>
<containerLogInfo>
<fileName>prelaunch.out</fileName>
<fileSize>70</fileSize>
<lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
</containerLogInfo>
<containerLogInfo>
<fileName>stdout</fileName>
<fileSize>0</fileSize>
<lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
</containerLogInfo>
<logAggregationType>LOCAL</logAggregationType>
<containerId>container_e88_1763555032540_0004_01_000003</containerId>
<nodeId>ccycloud-2.native-moxy4.root.comops.site:8041</nodeId>
</containerLogsInfo>
</containerLogsInfoes>
```
### For code changes:
- [ ] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
### AI Tooling
If an AI tool was used:
- [ ] The PR includes the phrase "Contains content generated by <tool>"
where <tool> is the name of the AI tool used.
- [ ] My use of AI contributions follows the ASF legal policy
https://www.apache.org/legal/generative-tooling.html
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]