Beispiel #1
0
def view_jobstep(context, request):
    jobtype = get_context_data(context, 'jobflow', ['jobtype'])
    attr_names = _JOBTYPE_PARAMS.get(jobtype)
    return {
        'api': template_api(context, request),
        'attr_names': attr_names,
        'resource_models': [JobStep],
    }
Beispiel #2
0
def deferred_jobstep_widget(node, kw):
    jobtype = get_context_data(kw['request'].context, 'jobflow', ['jobtype'])
    if (jobtype == u'hive' and node.name in _HIVE_PARAMS) or \
       (jobtype == u'streaming' and node.name in _STREAMING_PARAMS) or \
       (jobtype == u'custom-jar' and node.name in _CUSTOM_JAR_PARAMS):
        if node.name in _TEXT_AREA_WIDGET_PARAMS:
            return TextAreaWidget(cols=40, rows=5)
        else:
            return TextInputWidget()
    else:
        return HiddenWidget()
Beispiel #3
0
def deferred_default_step_args(node, kw):
    jobtype = get_context_data(kw['request'].context, 'jobflow', ['jobtype'])
    if jobtype == u'hive':
        resource = get_resource(kw['request'].context)
        args = _DEFAULT_HIVE_STEP_ARGS
        if resource.hive_versions:
            args += u'--hive-versions\n{0}\n'.format(resource.hive_versions)
        return args
    elif jobtype == u'custom-jar':
        return _DEFAULT_CUSTOM_JAR_STEP_ARGS
    else:
        return u''