protected Resource createAppSubmissionContextResource( ApplicationSubmissionContextInfo newApp) throws BadRequestException { if (newApp.getResource().getvCores() > rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES)) { String msg = "Requested more cores than configured max"; throw new BadRequestException(msg); } if (newApp.getResource().getMemory() > rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB)) { String msg = "Requested more memory than configured max"; throw new BadRequestException(msg); } Resource r = Resource.newInstance(newApp.getResource().getMemory(), newApp .getResource().getvCores()); return r; }
/** * Create the actual Resource inside the ApplicationSubmissionContextInfo to * be submitted to the RM from the information provided by the user. * * @param newApp the information provided by the user * @param conf RM configuration * @return returns the constructed Resource inside the * ApplicationSubmissionContextInfo * @throws BadRequestException */ private static Resource createAppSubmissionContextResource( ApplicationSubmissionContextInfo newApp, Configuration conf) throws BadRequestException { if (newApp.getResource().getvCores() > conf.getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES)) { String msg = "Requested more cores than configured max"; throw new BadRequestException(msg); } if (newApp.getResource().getMemorySize() > conf.getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB)) { String msg = "Requested more memory than configured max"; throw new BadRequestException(msg); } Resource r = Resource.newInstance(newApp.getResource().getMemorySize(), newApp.getResource().getvCores()); return r; }
protected Resource createAppSubmissionContextResource( ApplicationSubmissionContextInfo newApp) throws BadRequestException { if (newApp.getResource().getvCores() > rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES)) { String msg = "Requested more cores than configured max"; throw new BadRequestException(msg); } if (newApp.getResource().getMemory() > rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB)) { String msg = "Requested more memory than configured max"; throw new BadRequestException(msg); } Resource r = Resource.newInstance(newApp.getResource().getMemory(), newApp .getResource().getvCores()); return r; }
appInfo.getResource().setMemory( rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB) + 1); appInfo.getResource().setvCores(1); response = this.constructWebResource(urlPath).accept(acceptMedia) appInfo.getResource().setvCores( rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES) + 1); appInfo.getResource().setMemory(CONTAINER_MB); response = this.constructWebResource(urlPath).accept(acceptMedia)
appInfo.getResource().setMemory( rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB) + 1); appInfo.getResource().setvCores(1); response = this.constructWebResource(urlPath).accept(acceptMedia) appInfo.getResource().setvCores( rm.getConfig().getInt( YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES, YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES) + 1); appInfo.getResource().setMemory(CONTAINER_MB); response = this.constructWebResource(urlPath).accept(acceptMedia)
.put("test", Base64.encodeBase64URLSafeString("value12".getBytes("UTF8"))); appInfo.getContainerLaunchContextInfo().setCredentials(credentials); appInfo.getResource().setMemory(1024); appInfo.getResource().setvCores(1); appInfo.setApplicationTags(tags);
lr.put("example", y); appInfo.getContainerLaunchContextInfo().setResources(lr); appInfo.getResource().setMemory(1024); appInfo.getResource().setvCores(1);
lr.put("example", y); appInfo.getContainerLaunchContextInfo().setResources(lr); appInfo.getResource().setMemory(1024); appInfo.getResource().setvCores(1);
.put("test", Base64.encodeBase64URLSafeString("value12".getBytes("UTF8"))); appInfo.getContainerLaunchContextInfo().setCredentials(credentials); appInfo.getResource().setMemory(1024); appInfo.getResource().setvCores(1); appInfo.setApplicationTags(tags);