Search in sources :

Example 6 with EmrHadoopJarStepAddRequest

use of org.finra.herd.model.api.xml.EmrHadoopJarStepAddRequest in project herd by FINRAOS.

the class EmrHadoopJarStepHelper method buildResponseFromRequest.

@Override
public Object buildResponseFromRequest(Object stepRequest) {
    EmrHadoopJarStepAddRequest emrHadoopJarStepAddRequest = (EmrHadoopJarStepAddRequest) stepRequest;
    EmrHadoopJarStep step = new EmrHadoopJarStep();
    step.setNamespace(emrHadoopJarStepAddRequest.getNamespace());
    step.setEmrClusterDefinitionName(emrHadoopJarStepAddRequest.getEmrClusterDefinitionName());
    step.setEmrClusterName(emrHadoopJarStepAddRequest.getEmrClusterName());
    step.setStepName(emrHadoopJarStepAddRequest.getStepName().trim());
    step.setJarLocation(emrHadoopJarStepAddRequest.getJarLocation().trim().replaceAll(getS3ManagedReplaceString(), emrHelper.getS3StagingLocation()));
    if (emrHadoopJarStepAddRequest.getMainClass() != null) {
        step.setMainClass(emrHadoopJarStepAddRequest.getMainClass().trim());
    }
    // Add the script arguments
    if (!CollectionUtils.isEmpty(emrHadoopJarStepAddRequest.getScriptArguments())) {
        List<String> scriptArguments = new ArrayList<>();
        step.setScriptArguments(scriptArguments);
        for (String argument : emrHadoopJarStepAddRequest.getScriptArguments()) {
            scriptArguments.add(argument.trim());
        }
    }
    step.setContinueOnError(emrHadoopJarStepAddRequest.isContinueOnError());
    return step;
}
Also used : EmrHadoopJarStep(org.finra.herd.model.api.xml.EmrHadoopJarStep) EmrHadoopJarStepAddRequest(org.finra.herd.model.api.xml.EmrHadoopJarStepAddRequest) ArrayList(java.util.ArrayList)

Example 7 with EmrHadoopJarStepAddRequest

use of org.finra.herd.model.api.xml.EmrHadoopJarStepAddRequest in project herd by FINRAOS.

the class EmrHadoopJarStepHelper method validateAddStepRequest.

@Override
public void validateAddStepRequest(Object step) {
    EmrHadoopJarStepAddRequest hadoopJarStep = (EmrHadoopJarStepAddRequest) step;
    validateStepName(hadoopJarStep.getStepName());
    validateJarLocation(hadoopJarStep.getJarLocation());
}
Also used : EmrHadoopJarStepAddRequest(org.finra.herd.model.api.xml.EmrHadoopJarStepAddRequest)

Aggregations

EmrHadoopJarStepAddRequest (org.finra.herd.model.api.xml.EmrHadoopJarStepAddRequest)7 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 EmrClusterCreateRequest (org.finra.herd.model.api.xml.EmrClusterCreateRequest)3 EmrHadoopJarStep (org.finra.herd.model.api.xml.EmrHadoopJarStep)3 NamespaceEntity (org.finra.herd.model.jpa.NamespaceEntity)3 Method (java.lang.reflect.Method)2 EmrHiveStepAddRequest (org.finra.herd.model.api.xml.EmrHiveStepAddRequest)2 EmrPigStepAddRequest (org.finra.herd.model.api.xml.EmrPigStepAddRequest)2 EmrShellStepAddRequest (org.finra.herd.model.api.xml.EmrShellStepAddRequest)2 EmrStepHelper (org.finra.herd.service.helper.EmrStepHelper)2 Serializable (java.io.Serializable)1