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


Java CodeAnalysisMode类代码示例

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


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

示例1: TestEnvironment

import org.apache.flink.api.common.CodeAnalysisMode; //导入依赖的package包/类
public TestEnvironment(
		JobExecutor jobExecutor,
		int parallelism,
		boolean isObjectReuseEnabled,
		Collection<Path> jarFiles,
		Collection<URL> classPaths) {
	this.jobExecutor = Preconditions.checkNotNull(jobExecutor);
	this.jarFiles = Preconditions.checkNotNull(jarFiles);
	this.classPaths = Preconditions.checkNotNull(classPaths);

	setParallelism(parallelism);

	// disabled to improve build time
	getConfig().setCodeAnalysisMode(CodeAnalysisMode.DISABLE);

	if (isObjectReuseEnabled) {
		getConfig().enableObjectReuse();
	} else {
		getConfig().disableObjectReuse();
	}

	lastEnv = null;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:24,代码来源:TestEnvironment.java

示例2: testFunctionForwardedAnnotationPrecedence

import org.apache.flink.api.common.CodeAnalysisMode; //导入依赖的package包/类
@Test
public void testFunctionForwardedAnnotationPrecedence() {
	ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
	env.getConfig().setCodeAnalysisMode(CodeAnalysisMode.OPTIMIZE);

	@SuppressWarnings("unchecked")
	DataSet<Tuple3<Long, String, Integer>> input = env.fromElements(Tuple3.of(3L, "test", 42));
	input
			.map(new WildcardForwardedMapperWithForwardAnnotation<Tuple3<Long, String, Integer>>())
			.output(new DiscardingOutputFormat<Tuple3<Long, String, Integer>>());
	Plan plan = env.createProgramPlan();

	GenericDataSinkBase<?> sink = plan.getDataSinks().iterator().next();
	MapOperatorBase<?, ?, ?> mapper = (MapOperatorBase<?, ?, ?>) sink.getInput();

	SingleInputSemanticProperties semantics = mapper.getSemanticProperties();

	FieldSet fw1 = semantics.getForwardingTargetFields(0, 0);
	FieldSet fw2 = semantics.getForwardingTargetFields(0, 1);
	FieldSet fw3 = semantics.getForwardingTargetFields(0, 2);
	assertNotNull(fw1);
	assertNotNull(fw2);
	assertNotNull(fw3);
	assertTrue(fw1.contains(0));
	assertFalse(fw2.contains(1));
	assertFalse(fw3.contains(2));
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:SemanticPropertiesPrecedenceTest.java

示例3: testFunctionSkipCodeAnalysisAnnotationPrecedence

import org.apache.flink.api.common.CodeAnalysisMode; //导入依赖的package包/类
@Test
public void testFunctionSkipCodeAnalysisAnnotationPrecedence() {
	ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
	env.getConfig().setCodeAnalysisMode(CodeAnalysisMode.OPTIMIZE);

	@SuppressWarnings("unchecked")
	DataSet<Tuple3<Long, String, Integer>> input = env.fromElements(Tuple3.of(3L, "test", 42));
	input
			.map(new WildcardForwardedMapperWithSkipAnnotation<Tuple3<Long, String, Integer>>())
			.output(new DiscardingOutputFormat<Tuple3<Long, String, Integer>>());
	Plan plan = env.createProgramPlan();

	GenericDataSinkBase<?> sink = plan.getDataSinks().iterator().next();
	MapOperatorBase<?, ?, ?> mapper = (MapOperatorBase<?, ?, ?>) sink.getInput();

	SingleInputSemanticProperties semantics = mapper.getSemanticProperties();

	FieldSet fw1 = semantics.getForwardingTargetFields(0, 0);
	FieldSet fw2 = semantics.getForwardingTargetFields(0, 1);
	FieldSet fw3 = semantics.getForwardingTargetFields(0, 2);
	assertNotNull(fw1);
	assertNotNull(fw2);
	assertNotNull(fw3);
	assertFalse(fw1.contains(0));
	assertFalse(fw2.contains(1));
	assertFalse(fw3.contains(2));
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:SemanticPropertiesPrecedenceTest.java

示例4: testFunctionApiPrecedence

import org.apache.flink.api.common.CodeAnalysisMode; //导入依赖的package包/类
@Test
public void testFunctionApiPrecedence() {
	ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
	env.getConfig().setCodeAnalysisMode(CodeAnalysisMode.OPTIMIZE);

	@SuppressWarnings("unchecked")
	DataSet<Tuple3<Long, String, Integer>> input = env.fromElements(Tuple3.of(3L, "test", 42));
	input
			.map(new WildcardForwardedMapper<Tuple3<Long, String, Integer>>())
			.withForwardedFields("f0")
			.output(new DiscardingOutputFormat<Tuple3<Long, String, Integer>>());
	Plan plan = env.createProgramPlan();

	GenericDataSinkBase<?> sink = plan.getDataSinks().iterator().next();
	MapOperatorBase<?, ?, ?> mapper = (MapOperatorBase<?, ?, ?>) sink.getInput();

	SingleInputSemanticProperties semantics = mapper.getSemanticProperties();

	FieldSet fw1 = semantics.getForwardingTargetFields(0, 0);
	FieldSet fw2 = semantics.getForwardingTargetFields(0, 1);
	FieldSet fw3 = semantics.getForwardingTargetFields(0, 2);
	assertNotNull(fw1);
	assertNotNull(fw2);
	assertNotNull(fw3);
	assertTrue(fw1.contains(0));
	assertFalse(fw2.contains(1));
	assertFalse(fw3.contains(2));
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:29,代码来源:SemanticPropertiesPrecedenceTest.java

示例5: testFunctionAnalyzerPrecedence

import org.apache.flink.api.common.CodeAnalysisMode; //导入依赖的package包/类
@Test
public void testFunctionAnalyzerPrecedence() {
	ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
	env.getConfig().setCodeAnalysisMode(CodeAnalysisMode.OPTIMIZE);

	@SuppressWarnings("unchecked")
	DataSet<Tuple3<Long, String, Integer>> input = env.fromElements(Tuple3.of(3L, "test", 42));
	input
			.map(new WildcardForwardedMapper<Tuple3<Long, String, Integer>>())
			.output(new DiscardingOutputFormat<Tuple3<Long, String, Integer>>());
	Plan plan = env.createProgramPlan();

	GenericDataSinkBase<?> sink = plan.getDataSinks().iterator().next();
	MapOperatorBase<?, ?, ?> mapper = (MapOperatorBase<?, ?, ?>) sink.getInput();

	SingleInputSemanticProperties semantics = mapper.getSemanticProperties();

	FieldSet fw1 = semantics.getForwardingTargetFields(0, 0);
	FieldSet fw2 = semantics.getForwardingTargetFields(0, 1);
	FieldSet fw3 = semantics.getForwardingTargetFields(0, 2);
	assertNotNull(fw1);
	assertNotNull(fw2);
	assertNotNull(fw3);
	assertTrue(fw1.contains(0));
	assertTrue(fw2.contains(1));
	assertTrue(fw3.contains(2));
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:SemanticPropertiesPrecedenceTest.java


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