/** * Extract the desired driver memory from jobSubmissionProto. * <p/> * returns maxMemory if that desired amount is more than maxMemory */ private int getMemory(final ClientRuntimeProtocol.JobSubmissionProto jobSubmissionProto, final int maxMemory) { final int amMemory; final int requestedMemory = jobSubmissionProto.getDriverMemory(); if (requestedMemory <= maxMemory) { amMemory = requestedMemory; } else { LOG.log(Level.WARNING, "Requested {0}MB of memory for the driver. " + "The max on this YARN installation is {1}. " + "Using {1} as the memory for the driver.", new Object[]{requestedMemory, maxMemory}); amMemory = maxMemory; } return amMemory; }
/** * Extracts the resource demands from the jobSubmissionProto. */ private final Resource getResource( final ClientRuntimeProtocol.JobSubmissionProto jobSubmissionProto) { return new Resource() .setMemory(String.valueOf(jobSubmissionProto.getDriverMemory())) .setvCores("1"); }
hash = (53 * hash) + getDriverMemory();
setDriverMemory(other.getDriverMemory());
result = result && (getDriverMemory() == other.getDriverMemory());
/** * Assembles the command to execute the Driver in list form. */ private List<String> getCommandList( final ClientRuntimeProtocol.JobSubmissionProto jobSubmissionProto) { return new JavaLaunchCommandBuilder() .setJavaPath("%JAVA_HOME%/bin/java") .setErrorHandlerRID(jobSubmissionProto.getRemoteId()) .setLaunchID(jobSubmissionProto.getIdentifier()) .setConfigurationFileName(this.filenames.getDriverConfigurationPath()) .setClassPath(this.classpath.getDriverClasspath()) .setMemory(jobSubmissionProto.getDriverMemory()) .setStandardErr(ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/" + this.filenames.getDriverStderrFileName()) .setStandardOut(ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/" + this.filenames.getDriverStdoutFileName()) .build(); }