Examples of GFacHandlerException


Examples of org.apache.airavata.gfac.core.handler.GFacHandlerException

              detail.setTransferDescription("Output: " + stringMap.get(paramName).toString());
                        registry.add(ChildDataType.DATA_TRANSFER_DETAIL,detail, jobExecutionContext.getTaskData().getTaskID());
                     
                    }
                    if (outputArray == null || outputArray.isEmpty()) {
                        throw new GFacHandlerException("Empty Output returned from the Application, Double check the application" +
                                "and ApplicationDescriptor output Parameter Names");
                    }
                    // If users has given an output Data path to download the output files this will download the file on machine where GFac is installed
                    TaskDetails taskData =  jobExecutionContext.getTaskData();
                    if(taskData != null && taskData.getAdvancedOutputDataHandling() != null){
                      String outputDataDirectory = taskData.getAdvancedOutputDataHandling().getOutputDataDir();
                            if(outputDataDirectory != null && !"".equals(outputDataDirectory)){
                                stageOutputFiles(jobExecutionContext,outputDataDirectory);
                            }
                    }
                } catch (ToolsException e) {
                    log.error(e.getMessage());
                    throw new GFacHandlerException(e.getMessage() + "\n StdError Data: \n" +readLastLinesofStdOut(localStdErrFile.getPath(), 20),e);
                } catch (URISyntaxException e) {
                    log.error(e.getMessage());
                    throw new GFacHandlerException("URI is malformatted:" + e.getMessage(), e, readLastLinesofStdOut(localStdErrFile.getPath(), 20));
                }
            }
        } catch (Exception e) {
           try {
              status.setTransferState(TransferState.FAILED);
        detail.setTransferStatus(status);
        registry.add(ChildDataType.DATA_TRANSFER_DETAIL,detail, jobExecutionContext.getTaskData().getTaskID());
        GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.FILE_SYSTEM_FAILURE);
       } catch (Exception e1) {
           throw new GFacHandlerException("Error persisting status", e1, e1.getLocalizedMessage());
        }
          log.error(e.getMessage());
            throw new GFacHandlerException(e.getMessage(), e, readLastLinesofStdOut(localStdErrFile.getPath(), 20));
        }

    }
View Full Code Here

Examples of org.apache.airavata.gfac.core.handler.GFacHandlerException

    private static String regexPattern = "\\s*=\\s*(.*)\\r?\\n";

  public static void fillOutputFromStdout(Map<String, Object> output, String stdout, String stderr, List<DataObjectType> outputArray) throws Exception {

    if (stdout == null || stdout.equals("")) {
      throw new GFacHandlerException("Standard output is empty.");
    }

    Set<String> keys = output.keySet();
    for (String paramName : keys) {
      ActualParameter actual = (ActualParameter) output.get(paramName);
View Full Code Here

Examples of org.apache.airavata.gfac.handler.GFacHandlerException

            isWhirrBasedDeployment = true;
        } else {
            String hadoopConfigDirPath = (String)inMessageContext.getParameter("HADOOP_CONFIG_DIR");
            File hadoopConfigDir = new File(hadoopConfigDirPath);
            if (!hadoopConfigDir.exists()){
                throw new GFacHandlerException("Specified hadoop configuration directory doesn't exist.");
            } else if (FileUtils.listFiles(hadoopConfigDir, null, null).size() <= 0){
                throw new GFacHandlerException("Cannot find any hadoop configuration files inside specified directory.");
            }

            this.hadoopConfigDir = hadoopConfigDir;
        }

        if(jobExecutionContext.isInPath()){
            try {
                handleInPath(jobExecutionContext);
            } catch (IOException e) {
                throw new GFacHandlerException("Error while copying input data from local file system to HDFS.",e);
            }
        } else {
            handleOutPath(jobExecutionContext);
        }
    }
View Full Code Here

Examples of org.apache.airavata.gfac.handler.GFacHandlerException

    private static String regexPattern = "\\s*=\\s*([^\\[\\s'\"][^\\s]*|\"[^\"]*\"|'[^']*'|\\[[^\\[]*\\])";

    public static Map<String, ActualParameter> fillOutputFromStdout(Map<String, Object> output, String stdout, String stderr) throws Exception {

        if (stdout == null || stdout.equals("")){
            throw new GFacHandlerException("Standard output is empty.");
        }

        Map<String, ActualParameter> result = new HashMap<String, ActualParameter>();
        Set<String> keys = output.keySet();
        for (String paramName : keys) {
View Full Code Here

Examples of org.apache.airavata.gfac.handler.GFacHandlerException

    private static String regexPattern = "\\s*=\\s*(.*)\\r?\\n";

    public static Map<String, ActualParameter> fillOutputFromStdout(Map<String, Object> output, String stdout, String stderr) throws Exception {

        if (stdout == null || stdout.equals("")){
            throw new GFacHandlerException("Standard output is empty.");
        }

        Map<String, ActualParameter> result = new HashMap<String, ActualParameter>();
        Set<String> keys = output.keySet();
        for (String paramName : keys) {
View Full Code Here

Examples of org.apache.airavata.gfac.handler.GFacHandlerException

            isWhirrBasedDeployment = true;
        } else {
            String hadoopConfigDirPath = (String)inMessageContext.getParameter("HADOOP_CONFIG_DIR");
            File hadoopConfigDir = new File(hadoopConfigDirPath);
            if (!hadoopConfigDir.exists()){
                throw new GFacHandlerException("Specified hadoop configuration directory doesn't exist.");
            } else if (FileUtils.listFiles(hadoopConfigDir, null, null).size() <= 0){
                throw new GFacHandlerException("Cannot find any hadoop configuration files inside specified directory.");
            }

            this.hadoopConfigDir = hadoopConfigDir;
        }

        if(jobExecutionContext.isInPath()){
            try {
                handleInPath(jobExecutionContext);
            } catch (IOException e) {
                throw new GFacHandlerException("Error while copying input data from local file system to HDFS.",e);
            }
        } else {
            handleOutPath(jobExecutionContext);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.