def __init__(self, paths, epochs, out_row_type, converters): src_func_clz_name = 'com.alibaba.flink.tensorflow.hadoop.io.TFRToRowSourceFunc' src_func_clz = TypesUtil.class_for_name(src_func_clz_name) j_paths = TypesUtil._convert_py_list_to_java_array('java.lang.String', paths) j_converters = [] for converter in converters: j_converters.append(converter.java_converter()) j_converters = TypesUtil._convert_py_list_to_java_array( 'com.alibaba.flink.tensorflow.hadoop.io.TFRExtractRowHelper$ScalarConverter', j_converters) j_row_type = TypesUtil.to_java_sql_type(out_row_type) super(TFRSourceFunc, self).__init__(src_func_clz(j_paths, epochs, j_row_type, j_converters))
def __init__(self, paths, epochs, out_row_type, converters): table_src_clz_name = 'org.flinkextended.flink.tensorflow.hadoop.io.TFRToRowTableSource' table_src_clz = TypesUtil.class_for_name(table_src_clz_name) j_paths = TypesUtil._convert_py_list_to_java_array( 'java.lang.String', paths) j_converters = [] for converter in converters: j_converters.append(converter.java_converter()) j_converters = TypesUtil._convert_py_list_to_java_array( 'org.flinkextended.flink.tensorflow.hadoop.io.TFRExtractRowHelper$ScalarConverter', j_converters) j_row_type = TypesUtil.to_java_sql_type(out_row_type) super(TFRTableSource, self).__init__( table_src_clz(j_paths, epochs, j_row_type, j_converters))
def __init__(self, sink_func=None): if sink_func is None: sink_func = LogSink()._j_sink_function sink_clz_name = 'com.alibaba.flink.tensorflow.flink_op.sink.LogTableStreamSink' sink_clz = TypesUtil.class_for_name(sink_clz_name) super(LogTableStreamSink, self).__init__(sink_clz(sink_func))
def java_inference_extract_func(): func_clz_name = 'com.alibaba.flink.tensorflow.client.MnistTFRExtractRowForJavaFunction' func_clz = TypesUtil.class_for_name(func_clz_name) return JavaTableFunction(func_clz())
def to_row_type_info(row_type): if row_type is None: return None return get_gateway( ).jvm.com.alibaba.flink.tensorflow.util.TypeUtil.rowTypeToRowTypeInfo( TypesUtil.to_java_sql_type(row_type))