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


Java ReadFieldsFirst类代码示例

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


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

示例1: getSemanticPropsSingle

import org.apache.flink.api.java.functions.FunctionAnnotation.ReadFieldsFirst; //导入依赖的package包/类
public static SingleInputSemanticProperties getSemanticPropsSingle(
		Set<Annotation> set, TypeInformation<?> inType, TypeInformation<?> outType) {
	if (set == null) {
		return null;
	}
	Iterator<Annotation> it = set.iterator();

	String[] forwarded = null;
	String[] nonForwarded = null;
	String[] read = null;

	while (it.hasNext()) {

		Annotation ann = it.next();

		if (ann instanceof ForwardedFields) {
			forwarded = ((ForwardedFields) ann).value();
		} else if (ann instanceof NonForwardedFields) {
			nonForwarded = ((NonForwardedFields) ann).value();
		} else if (ann instanceof ReadFields) {
			read = ((ReadFields) ann).value();
		} else if (ann instanceof ForwardedFieldsFirst || ann instanceof ForwardedFieldsSecond ||
				ann instanceof NonForwardedFieldsFirst || ann instanceof NonForwardedFieldsSecond ||
				ann instanceof ReadFieldsFirst || ann instanceof ReadFieldsSecond) {
			throw new InvalidSemanticAnnotationException("Annotation " + ann.getClass() + " invalid for single input function.");
		}
	}

	if (forwarded != null || nonForwarded != null || read != null) {
		SingleInputSemanticProperties result = new SingleInputSemanticProperties();
		getSemanticPropsSingleFromString(result, forwarded, nonForwarded, read, inType, outType);
		return result;
	}
	return null;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:36,代码来源:SemanticPropUtil.java

示例2: getSemanticPropsDual

import org.apache.flink.api.java.functions.FunctionAnnotation.ReadFieldsFirst; //导入依赖的package包/类
public static DualInputSemanticProperties getSemanticPropsDual(
		Set<Annotation> set, TypeInformation<?> inType1, TypeInformation<?> inType2, TypeInformation<?> outType) {
	if (set == null) {
		return null;
	}
	Iterator<Annotation> it = set.iterator();

	String[] forwardedFirst = null;
	String[] forwardedSecond = null;
	String[] nonForwardedFirst = null;
	String[] nonForwardedSecond = null;
	String[] readFirst = null;
	String[] readSecond = null;

	while (it.hasNext()) {
		Annotation ann = it.next();

		if (ann instanceof ForwardedFieldsFirst) {
			forwardedFirst = ((ForwardedFieldsFirst) ann).value();
		} else if (ann instanceof ForwardedFieldsSecond) {
			forwardedSecond = ((ForwardedFieldsSecond) ann).value();
		} else if (ann instanceof NonForwardedFieldsFirst) {
			nonForwardedFirst = ((NonForwardedFieldsFirst) ann).value();
		} else if (ann instanceof NonForwardedFieldsSecond) {
			nonForwardedSecond = ((NonForwardedFieldsSecond) ann).value();
		} else if (ann instanceof ReadFieldsFirst) {
			readFirst = ((ReadFieldsFirst) ann).value();
		} else if (ann instanceof ReadFieldsSecond) {
			readSecond = ((ReadFieldsSecond) ann).value();
		} else if (ann instanceof ForwardedFields || ann instanceof NonForwardedFields || ann instanceof ReadFields) {
			throw new InvalidSemanticAnnotationException("Annotation " + ann.getClass() + " invalid for dual input function.");
		}
	}

	if (forwardedFirst != null || nonForwardedFirst != null || readFirst != null ||
			forwardedSecond != null || nonForwardedSecond != null || readSecond != null) {
		DualInputSemanticProperties result = new DualInputSemanticProperties();
		getSemanticPropsDualFromString(result, forwardedFirst, forwardedSecond,
			nonForwardedFirst, nonForwardedSecond, readFirst, readSecond, inType1, inType2, outType);
		return result;
	}
	return null;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:44,代码来源:SemanticPropUtil.java


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