当前位置: 首页>>代码示例>>Java>>正文


Java InputTypeConfigurable类代码示例

本文整理汇总了Java中org.apache.flink.api.java.typeutils.InputTypeConfigurable的典型用法代码示例。如果您正苦于以下问题:Java InputTypeConfigurable类的具体用法?Java InputTypeConfigurable怎么用?Java InputTypeConfigurable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InputTypeConfigurable类属于org.apache.flink.api.java.typeutils包,在下文中一共展示了InputTypeConfigurable类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSink

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
/**
 * Adds the given sink to this DataStream. Only streams with sinks added
 * will be executed once the {@link StreamExecutionEnvironment#execute()}
 * method is called.
 *
 * @param sinkFunction
 *            The object containing the sink's invoke function.
 * @return The closed DataStream.
 */
public DataStreamSink<T> addSink(SinkFunction<T> sinkFunction) {

	// read the output type of the input Transform to coax out errors about MissingTypeInfo
	transformation.getOutputType();

	// configure the type if needed
	if (sinkFunction instanceof InputTypeConfigurable) {
		((InputTypeConfigurable) sinkFunction).setInputType(getType(), getExecutionConfig());
	}

	StreamSink<T> sinkOperator = new StreamSink<>(clean(sinkFunction));

	DataStreamSink<T> sink = new DataStreamSink<>(this, sinkOperator);

	getExecutionEnvironment().addOperator(sink.getTransformation());
	return sink;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:27,代码来源:DataStream.java

示例2: setInputType

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig) {
    if (this.writerTemplate instanceof InputTypeConfigurable) {
        ((InputTypeConfigurable) writerTemplate).setInputType(type, executionConfig);
    }
}
 
开发者ID:breakEval13,项目名称:rocketmq-flink-plugin,代码行数:8,代码来源:TODBucketingSink.java

示例3: setInputType

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig) {
	if (this.writerTemplate instanceof InputTypeConfigurable) {
		((InputTypeConfigurable) writerTemplate).setInputType(type, executionConfig);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:RollingSink.java

示例4: output

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
/**
 * Emits a DataSet using an {@link OutputFormat}. This method adds a data sink to the program.
 * Programs may have multiple data sinks. A DataSet may also have multiple consumers (data sinks
 * or transformations) at the same time.
 *
 * @param outputFormat The OutputFormat to process the DataSet.
 * @return The DataSink that processes the DataSet.
 *
 * @see OutputFormat
 * @see DataSink
 */
public DataSink<T> output(OutputFormat<T> outputFormat) {
	Preconditions.checkNotNull(outputFormat);

	// configure the type if needed
	if (outputFormat instanceof InputTypeConfigurable) {
		((InputTypeConfigurable) outputFormat).setInputType(getType(), context.getConfig());
	}

	DataSink<T> sink = new DataSink<>(this, outputFormat, getType());
	this.context.registerDataSink(sink);
	return sink;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:24,代码来源:DataSet.java

示例5: setInputType

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
@Override
public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig) {
	if (format instanceof InputTypeConfigurable) {
		InputTypeConfigurable itc = (InputTypeConfigurable) format;
		itc.setInputType(type, executionConfig);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:OutputFormatSinkFunction.java

示例6: addOperator

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
public <IN, OUT> void addOperator(
		Integer vertexID,
		String slotSharingGroup,
		StreamOperator<OUT> operatorObject,
		TypeInformation<IN> inTypeInfo,
		TypeInformation<OUT> outTypeInfo,
		String operatorName) {

	if (operatorObject instanceof StoppableStreamSource) {
		addNode(vertexID, slotSharingGroup, StoppableSourceStreamTask.class, operatorObject, operatorName);
	} else if (operatorObject instanceof StreamSource) {
		addNode(vertexID, slotSharingGroup, SourceStreamTask.class, operatorObject, operatorName);
	} else {
		addNode(vertexID, slotSharingGroup, OneInputStreamTask.class, operatorObject, operatorName);
	}

	TypeSerializer<IN> inSerializer = inTypeInfo != null && !(inTypeInfo instanceof MissingTypeInfo) ? inTypeInfo.createSerializer(executionConfig) : null;

	TypeSerializer<OUT> outSerializer = outTypeInfo != null && !(outTypeInfo instanceof MissingTypeInfo) ? outTypeInfo.createSerializer(executionConfig) : null;

	setSerializers(vertexID, inSerializer, null, outSerializer);

	if (operatorObject instanceof OutputTypeConfigurable && outTypeInfo != null) {
		@SuppressWarnings("unchecked")
		OutputTypeConfigurable<OUT> outputTypeConfigurable = (OutputTypeConfigurable<OUT>) operatorObject;
		// sets the output type which must be know at StreamGraph creation time
		outputTypeConfigurable.setOutputType(outTypeInfo, executionConfig);
	}

	if (operatorObject instanceof InputTypeConfigurable) {
		InputTypeConfigurable inputTypeConfigurable = (InputTypeConfigurable) operatorObject;
		inputTypeConfigurable.setInputType(inTypeInfo, executionConfig);
	}

	if (LOG.isDebugEnabled()) {
		LOG.debug("Vertex: {}", vertexID);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:39,代码来源:StreamGraph.java

示例7: output

import org.apache.flink.api.java.typeutils.InputTypeConfigurable; //导入依赖的package包/类
/**
 * Emits a DataSet using an {@link OutputFormat}. This method adds a data sink to the program.
 * Programs may have multiple data sinks. A DataSet may also have multiple consumers (data sinks
 * or transformations) at the same time.
 * 
 * @param outputFormat The OutputFormat to process the DataSet.
 * @return The DataSink that processes the DataSet.
 * 
 * @see OutputFormat
 * @see DataSink
 */
public DataSink<T> output(OutputFormat<T> outputFormat) {
	Validate.notNull(outputFormat);
	
	// configure the type if needed
	if (outputFormat instanceof InputTypeConfigurable) {
		((InputTypeConfigurable) outputFormat).setInputType(this.type);
	}
	
	DataSink<T> sink = new DataSink<T>(this, outputFormat, this.type);
	this.context.registerDataSink(sink);
	return sink;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:24,代码来源:DataSet.java


注:本文中的org.apache.flink.api.java.typeutils.InputTypeConfigurable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。