/** * @return the folder und which all REEF files are stored. */ public File getREEFFolder() { return new File(getREEFFolderName()); }
/** * @param errorHandlerRID the remoteID of the error handler. * @param nodeID the ID of the (fake) node this Container is instantiated on * @param containedID the ID used to identify this container uniquely * @param folder the folder in which logs etc. will be deposited */ ProcessContainer(final String errorHandlerRID, final String nodeID, final String containedID, final File folder, final int megaBytes, final int numberOfCores, final REEFFileNames fileNames, final ReefRunnableProcessObserver processObserver) { this.errorHandlerRID = errorHandlerRID; this.nodeID = nodeID; this.containedID = containedID; this.folder = folder; this.megaBytes = megaBytes; this.numberOfCores = numberOfCores; this.fileNames = fileNames; this.processObserver = processObserver; this.reefFolder = new File(folder, fileNames.getREEFFolderName()); this.localFolder = new File(reefFolder, fileNames.getLocalFolderName()); this.localFolder.mkdirs(); this.globalFolder = new File(reefFolder, fileNames.getGlobalFolderName()); this.globalFolder.mkdirs(); }
/** * Copies this set of files to the destination folder given. * * Will attempt to create symbolic links for the files to the destination * folder. If the filesystem does not support symbolic links or the user * does not have appropriate permissions, the entire file will be copied instead. * * @param destinationFolder the folder the files shall be copied to. * @throws IOException if one or more of the copies fail. */ public void copyTo(final File destinationFolder) throws IOException { destinationFolder.mkdirs(); final File reefFolder = new File(destinationFolder, fileNames.getREEFFolderName()); final File localFolder = new File(reefFolder, fileNames.getLocalFolderName()); final File globalFolder = new File(reefFolder, fileNames.getGlobalFolderName()); localFolder.mkdirs(); globalFolder.mkdirs(); try { this.localFiles.createSymbolicLinkTo(localFolder); this.localLibs.createSymbolicLinkTo(localFolder); this.globalLibs.createSymbolicLinkTo(globalFolder); this.globalFiles.createSymbolicLinkTo(globalFolder); } catch (IOException e) { this.localFiles.copyTo(localFolder); this.localLibs.copyTo(localFolder); this.globalLibs.copyTo(globalFolder); this.globalFiles.copyTo(globalFolder); } }
.setResource(getResource(jobSubmissionProto)) .setContainerInfo(new ContainerInfo() .addFileResource(this.filenames.getREEFFolderName(), uploadedFile) .addCommand(command));
resources.put(this.filenames.getREEFFolderName(), this.makeLocalResourceForJarFile(uploadedJobJarPath));