Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
2.0.3-alpha
-
None
-
None
Description
If you look at the API of ContainerLaunchContext, its got setter methods, such as for setResource, setCommands, etc…:
However, there's certain things broken in its use here that am trying to understand. Let me explain with some code context:
1. I initialize a proper CLC for an ApplicationSubmissionContext (appContext).
ContainerLaunchContext appMasterLaunchContext = Records.newRecord(ContainerLaunchContext.class); appContext.setAMContainerSpec(appMasterLaunchContext);
2. I create a resource request of 130 MB, as applicationMasterResource, and try to set it into the CLC via:
appContext.getAMContainerSpec().setResource(applicationMasterResource);
3. This works OK. If I query it back now, it returns 130 for a getMemory() call.
4. So I attempt to do the same with setCommands/setEnvironment/etc., all of which fail to mutate cause the check in CLC's implementation class disregards whatever I try to set for some reason.
Edit: It seems like the issue is that when I do a appContext.getAMContainerSpec().getLocalResources() or similar call to get existing initialized data structures to populate further on, what I really get underneath is a silently non-mutative data structure that I can call .put or .add on, but it won't really reflect it.
Attachments
Issue Links
- is duplicated by
-
YARN-489 Setter of xxxxPBImpl doesn't really set the collection, but append its items to an existing collection
- Resolved