Package org.apache.airavata.gfac.core.handler

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


    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

TOP

Related Classes of org.apache.airavata.gfac.core.handler.GFacHandlerException

Copyright © 2018 www.massapicom. 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.