public File createJobSubmissionJAR(
final ClientRuntimeProtocol.JobSubmissionProto jobSubmissionProto,
final Configuration driverConfiguration) throws IOException {
final File jobSubmissionFolder = makejobSubmissionFolder();
LOG.log(Level.FINE, "Staging submission in {0}", jobSubmissionFolder);
final File localFolder = new File(jobSubmissionFolder, this.fileNames.getLocalFolderName());
final File globalFolder = new File(jobSubmissionFolder, this.fileNames.getGlobalFolderName());
this.copy(jobSubmissionProto.getGlobalFileList(), globalFolder);
this.copy(jobSubmissionProto.getLocalFileList(), localFolder);
this.configurationSerializer.toFile(
driverConfiguration, new File(localFolder, this.fileNames.getDriverConfigurationName()));
final File jarFile = File.createTempFile(this.fileNames.getJobFolderPrefix(), this.fileNames.getJarFileSuffix());
LOG.log(Level.FINE, "Creating job submission jar file: {0}", jarFile);
new JARFileMaker(jarFile).addChildren(jobSubmissionFolder).close();
if (this.deleteTempFilesOnExit) {
LOG.log(Level.FINE,
"Deleting the temporary job folder [{0}] and marking the jar file [{1}] for deletion after the JVM exits.",
new Object[]{jobSubmissionFolder.getAbsolutePath(), jarFile.getAbsolutePath()});
jobSubmissionFolder.delete();
jarFile.deleteOnExit();
} else {
LOG.log(Level.FINE, "Keeping the temporary job folder [{0}] and jar file [{1}] available after job submission.",
new Object[]{jobSubmissionFolder.getAbsolutePath(), jarFile.getAbsolutePath()});
}
return jarFile;
}