[
https://issues.apache.org/jira/browse/YARN-2546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146900#comment-14146900
]
Zhijie Shen commented on YARN-2546:
-----------------------------------
[~vvasudev], LGTM overall. Some minor comments:
1. Make the app Id consistent?
{code}
Response Body:
+---+
{
"application-id":"application_1410870995658_0001",
"maximum-resource-capability":
{
"memory":8192,
"vCores":32
}
}
+---+
{code}
{code}
Response Body:
+---+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<NewApplication>
<application-id>application_1404198295326_0003</application-id>
<maximum-resource-capability>
<memory>8192</memory>
<vCores>32</vCores>
</maximum-resource-capability>
</NewApplication>
+---+
{code}
2. Maybe this change is not necessary? JAXBContextResolver can be added in
another place.
{code}
- WebResource r = resource();
+ ClientConfig cfg = new DefaultClientConfig();
+ cfg.getClasses().add(JAXBContextResolver.class);
+ Client client = Client.create(cfg);
+ client.addFilter(new LoggingFilter(System.out));
+ WebResource r = client.resource(resource().getURI());
{code}
This is what I did before in TestTimelineWebServices:
{code}
public TestTimelineWebServices() {
super(new WebAppDescriptor.Builder(
"org.apache.hadoop.yarn.server.applicationhistoryservice.webapp")
.contextListenerClass(GuiceServletConfig.class)
.filterClass(com.google.inject.servlet.GuiceFilter.class)
.contextPath("jersey-guice-filter")
.servletPath("/")
.clientConfig(
new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class))
.build());
}
{code}
> REST API for application creation/submission is using strings for numeric &
> boolean values
> ------------------------------------------------------------------------------------------
>
> Key: YARN-2546
> URL: https://issues.apache.org/jira/browse/YARN-2546
> Project: Hadoop YARN
> Issue Type: Bug
> Components: api
> Affects Versions: 2.5.1
> Reporter: Doug Haigh
> Assignee: Varun Vasudev
> Attachments: apache-yarn-2546.0.patch
>
>
> When YARN responds with or accepts JSON, numbers & booleans are being
> represented as strings which can cause parsing problems.
> Resource values look like
> {
> "application-id":"application_1404198295326_0001",
> "maximum-resource-capability":
> {
> "memory":"8192",
> "vCores":"32"
> }
> }
> Instead of
> {
> "application-id":"application_1404198295326_0001",
> "maximum-resource-capability":
> {
> "memory":8192,
> "vCores":32
> }
> }
> When I POST to start a job, numeric values are represented as numbers:
> "local-resources":
> {
> "entry":
> [
> {
> "key":"AppMaster.jar",
> "value":
> {
>
> "resource":"hdfs://hdfs-namenode:9000/user/testuser/DistributedShell/demo-app/AppMaster.jar",
> "type":"FILE",
> "visibility":"APPLICATION",
> "size": "43004",
> "timestamp": "1405452071209"
> }
> }
> ]
> },
> Instead of
> "local-resources":
> {
> "entry":
> [
> {
> "key":"AppMaster.jar",
> "value":
> {
>
> "resource":"hdfs://hdfs-namenode:9000/user/testuser/DistributedShell/demo-app/AppMaster.jar",
> "type":"FILE",
> "visibility":"APPLICATION",
> "size": 43004,
> "timestamp": 1405452071209
> }
> }
> ]
> },
> Similarly, Boolean values are also represented as strings:
> "keep-containers-across-application-attempts":"false"
> Instead of
> "keep-containers-across-application-attempts":false
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)