Beispiel #1
0
def build_custom_jar_step(parsed_step):
    name = _apply_default_value(arg=parsed_step.get("Name"), value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME)
    action_on_failure = _apply_default_value(
        arg=parsed_step.get("ActionOnFailure"), value=constants.DEFAULT_FAILURE_ACTION
    )
    emrutils.check_required_field(structure=constants.CUSTOM_JAR_STEP_CONFIG, name="Jar", value=parsed_step.get("Jar"))
    return emrutils.build_step(
        jar=parsed_step.get("Jar"),
        args=parsed_step.get("Args"),
        name=name,
        action_on_failure=action_on_failure,
        main_class=parsed_step.get("MainClass"),
        properties=emrutils.parse_key_value_string(parsed_step.get("Properties")),
    )
Beispiel #2
0
def build_custom_jar_step(parsed_step):
    name = _apply_default_value(arg=parsed_step.get('Name'),
                                value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME)
    action_on_failure = _apply_default_value(
        arg=parsed_step.get('ActionOnFailure'),
        value=constants.DEFAULT_FAILURE_ACTION)
    emrutils.check_required_field(structure=constants.CUSTOM_JAR_STEP_CONFIG,
                                  name='Jar',
                                  value=parsed_step.get('Jar'))
    return emrutils.build_step(jar=parsed_step.get('Jar'),
                               args=parsed_step.get('Args'),
                               name=name,
                               action_on_failure=action_on_failure,
                               main_class=parsed_step.get('MainClass'),
                               properties=emrutils.parse_key_value_string(
                                   parsed_step.get('Properties')))