private boolean isInputDataDirectoryLocal(ApplicationDeploymentDescriptionType appDepDesc){ String inputDataDirectoryPath = appDepDesc.getInputDataDirectory(); File inputDataDirectory = new File(inputDataDirectoryPath); if(inputDataDirectory.exists() && FileUtils.listFiles(inputDataDirectory, null, null).size() > 0){ return true; } return false; }
builder.environment().put(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDataDirectory()); builder.environment().put(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDataDirectory());
private void handleInPath(JobExecutionContext jobExecutionContext) throws GFacHandlerException, IOException { ApplicationDeploymentDescriptionType appDepDesc = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType(); HadoopApplicationDeploymentDescriptionType hadoopAppDesc = (HadoopApplicationDeploymentDescriptionType)appDepDesc; if(appDepDesc.isSetInputDataDirectory() && isInputDataDirectoryLocal(appDepDesc)){ Configuration hadoopConf = HadoopUtils.createHadoopConfiguration(jobExecutionContext, isWhirrBasedDeployment, hadoopConfigDir); FileSystem hdfs = FileSystem.get(hadoopConf); hdfs.copyFromLocalFile(new Path(appDepDesc.getInputDataDirectory()), new Path(hadoopAppDesc.getHadoopJobConfiguration().getHdfsInputDirectory())); } }
public void makeDirectory(InvocationContext context) throws ProviderException { ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType(); Session session = null; try { session = getSession(context); StringBuilder commandString = new StringBuilder(); commandString.append("mkdir -p "); commandString.append(app.getScratchWorkingDirectory()); commandString.append(" ; "); commandString.append("mkdir -p "); commandString.append(app.getStaticWorkingDirectory()); commandString.append(" ; "); commandString.append("mkdir -p "); commandString.append(app.getInputDataDirectory()); commandString.append(" ; "); commandString.append("mkdir -p "); commandString.append(app.getOutputDataDirectory()); Command cmd = session.exec(commandString.toString()); cmd.join(COMMAND_EXECUTION_TIMEOUT, TimeUnit.SECONDS); } catch (ConnectionException e) { throw new ProviderException(e.getMessage(), e); } catch (TransportException e) { throw new ProviderException(e.getMessage(), e); } catch (IOException e) { throw new ProviderException(e.getMessage(), e); } finally { closeSession(session); } }
public void makeDirectory(InvocationContext invocationContext) throws ProviderException { ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType(); log.info("working diectroy = " + app.getStaticWorkingDirectory()); log.info("temp directory = " + app.getScratchWorkingDirectory()); makeFileSystemDir(app.getStaticWorkingDirectory()); makeFileSystemDir(app.getScratchWorkingDirectory()); makeFileSystemDir(app.getInputDataDirectory()); makeFileSystemDir(app.getOutputDataDirectory()); }
nv.put(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDataDirectory()); nv.put(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDataDirectory());
URI inputURI = GramProviderUtils.createGsiftpURI(endpoint, app.getInputDataDirectory()); String fileName = new File(gridftpURL.getPath()).getName(); fileName = ftp.gridFTPFileExist(inputURI, fileName,gssCred);
destFilePath = app.getInputDataDirectory() + File.separator + destFilePath;
destFilePath = app.getInputDataDirectory() + File.separator + destFilePath;
URI inputURI = GfacUtils.createGsiftpURI(endpoint, app.getInputDataDirectory()); URI outputURI = GfacUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());
URI inputURI = GramProviderUtils.createGsiftpURI(endpoint, app.getInputDataDirectory()); URI outputURI = GramProviderUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());
if (appDesc.getInputDataDirectory() == null) { appDesc.setInputDataDirectory(appDesc.getStaticWorkingDirectory() + File.separator + "inputData");
applicationDescriptor.setWorkingDir(applicationDescription.getType().getScratchWorkingDirectory()); if (applicationDescription.getType().getInputDataDirectory() != null && !applicationDescription.getType().getInputDataDirectory().equals("") ){ applicationDescriptor.setInputDir(applicationDescription.getType().getInputDataDirectory());