private static String stageInputFiles(Cluster cluster, JobExecutionContext jobExecutionContext, String paramValue) throws IOException, GFacException { int i = paramValue.lastIndexOf(File.separator); String substring = paramValue.substring(i + 1); try { String targetFile = jobExecutionContext.getInputDir() + File.separator + substring; if (paramValue.startsWith("file")) { paramValue = paramValue.substring(paramValue.indexOf(":") + 1, paramValue.length()); } boolean success = false; int j = 1; while(!success){ try { cluster.scpTo(targetFile, paramValue); success = true; } catch (Exception e) { log.info(e.getLocalizedMessage()); Thread.sleep(2000); if(j==3) { throw new GFacHandlerException("Error while input File Staging", e, e.getLocalizedMessage()); } } j++; } return targetFile; } catch (Exception e) { throw new GFacHandlerException("Error while input File Staging", e, e.getLocalizedMessage()); } }
while(!success){ try { cluster.scpTo(targetFile, paramValue); success = true; } catch (Exception e) {
log.info(remoteFile); File runscript = createShellScript(jobExecutionContext); cluster.scpTo(remoteFile, runscript.getAbsolutePath()); } else { hpcType = true;
throw new GFacHandlerException("Empty Output returned from the application.." ); pbsCluster.scpTo(outputPath, downloadFile); String fileName = downloadFile.substring(downloadFile.lastIndexOf(File.separatorChar)+1, downloadFile.length()); OutputDataObjectType dataObjectType = new OutputDataObjectType(); }else if (outputDataObjectType.getType() == DataType.STDOUT) { stdoutPresent = true; pbsCluster.scpTo(outputPath, standardOutput); String fileName = standardOutput.substring(standardOutput.lastIndexOf(File.separatorChar)+1, standardOutput.length()); OutputDataObjectType dataObjectType = new OutputDataObjectType(); }else if (outputDataObjectType.getType() == DataType.STDERR) { stderrorPresent = true; pbsCluster.scpTo(outputPath, standardError); String fileName = standardError.substring(standardError.lastIndexOf(File.separatorChar)+1, standardError.length()); OutputDataObjectType dataObjectType = new OutputDataObjectType();