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


Java NirvanaOutputList类代码示例

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


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

示例1: testFailingHashFirstMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashFirstMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED);
	getTaskConfig().setRelativeMemoryDriver(1.0f);
	
	BuildFirstCachedJoinDriver<Record, Record, Record> testTask = new BuildFirstCachedJoinDriver<Record, Record, Record>();
	
	try {
		testResettableDriver(testTask, MockFailingMatchStub.class, 3);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:30,代码来源:CachedMatchTaskTest.java

示例2: testFailingHashSecondMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashSecondMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED);
	getTaskConfig().setRelativeMemoryDriver(1.0f);
	
	BuildSecondCachedJoinDriver<Record, Record, Record> testTask = new BuildSecondCachedJoinDriver<Record, Record, Record>();
	
	try {
		testResettableDriver(testTask, MockFailingMatchStub.class, 3);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:30,代码来源:CachedMatchTaskTest.java

示例3: testFailingHashFirstMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashFirstMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_FIRST);
	getTaskConfig().setRelativeMemoryDriver(hash_frac);
	
	JoinDriver<Record, Record, Record> testTask = new JoinDriver<>();
	
	try {
		testDriver(testTask, MockFailingMatchStub.class);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:30,代码来源:JoinTaskTest.java

示例4: testFailingHashSecondMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashSecondMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_SECOND);
	getTaskConfig().setRelativeMemoryDriver(hash_frac);
	
	JoinDriver<Record, Record, Record> testTask = new JoinDriver<>();
	
	try {
		testDriver(testTask, MockFailingMatchStub.class);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:30,代码来源:JoinTaskTest.java

示例5: testFailingDataSourceTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingDataSourceTask() {
	int keyCnt = 20;
	int valCnt = 10;
	
	this.outList = new NirvanaOutputList();
	
	try {
		InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false), 
			this.tempTestPath, false);
	} catch (IOException e1) {
		Assert.fail("Unable to set-up test input file");
	}

	super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE);
	super.addOutput(this.outList);
	
	DataSourceTask<Record> testTask = new DataSourceTask<>(this.mockEnv);

	super.registerFileInputTask(testTask, MockFailingInputFormat.class, new File(tempTestPath).toURI().toString(), "\n");
	
	boolean stubFailed = false;

	try {
		testTask.invoke();
	} catch (Exception e) {
		stubFailed = true;
	}
	Assert.assertTrue("Function exception was not forwarded.", stubFailed);
	
	// assert that temp file was created
	File tempTestFile = new File(this.tempTestPath);
	Assert.assertTrue("Temp output file does not exist",tempTestFile.exists());
	
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:36,代码来源:DataSourceTaskTest.java

示例6: testFailingHashFirstMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashFirstMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED);
	getTaskConfig().setRelativeMemoryDriver(1.0f);
	
	BuildFirstCachedMatchDriver<Record, Record, Record> testTask = new BuildFirstCachedMatchDriver<Record, Record, Record>();
	
	try {
		testResettableDriver(testTask, MockFailingMatchStub.class, 3);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:30,代码来源:CachedMatchTaskTest.java

示例7: testFailingHashSecondMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashSecondMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED);
	getTaskConfig().setRelativeMemoryDriver(1.0f);
	
	BuildSecondCachedMatchDriver<Record, Record, Record> testTask = new BuildSecondCachedMatchDriver<Record, Record, Record>();
	
	try {
		testResettableDriver(testTask, MockFailingMatchStub.class, 3);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:30,代码来源:CachedMatchTaskTest.java

示例8: testFailingDataSourceTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingDataSourceTask() {
	int keyCnt = 20;
	int valCnt = 10;
	
	this.outList = new NirvanaOutputList();
	
	try {
		InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false), 
			this.tempTestPath, false);
	} catch (IOException e1) {
		Assert.fail("Unable to set-up test input file");
	}

	super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE);
	super.addOutput(this.outList);
	
	DataSourceTask<Record> testTask = new DataSourceTask<Record>();

	super.registerFileInputTask(testTask, MockFailingInputFormat.class, new File(tempTestPath).toURI().toString(), "\n");
	
	boolean stubFailed = false;

	try {
		testTask.invoke();
	} catch (Exception e) {
		stubFailed = true;
	}
	Assert.assertTrue("Function exception was not forwarded.", stubFailed);
	
	// assert that temp file was created
	File tempTestFile = new File(this.tempTestPath);
	Assert.assertTrue("Temp output file does not exist",tempTestFile.exists());
	
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:36,代码来源:DataSourceTaskTest.java

示例9: testFailingHashFirstMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashFirstMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_FIRST);
	getTaskConfig().setRelativeMemoryDriver(hash_frac);
	
	MatchDriver<Record, Record, Record> testTask = new MatchDriver<Record, Record, Record>();
	
	try {
		testDriver(testTask, MockFailingMatchStub.class);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:30,代码来源:MatchTaskTest.java

示例10: testFailingHashSecondMatchTask

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testFailingHashSecondMatchTask() {
	int keyCnt1 = 20;
	int valCnt1 = 20;
	
	int keyCnt2 = 20;
	int valCnt2 = 20;
	
	addInput(new UniformRecordGenerator(keyCnt1, valCnt1, false));
	addInput(new UniformRecordGenerator(keyCnt2, valCnt2, false));
	addDriverComparator(this.comparator1);
	addDriverComparator(this.comparator2);
	getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
	setOutput(new NirvanaOutputList());
	getTaskConfig().setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_SECOND);
	getTaskConfig().setRelativeMemoryDriver(hash_frac);
	
	MatchDriver<Record, Record, Record> testTask = new MatchDriver<Record, Record, Record>();
	
	try {
		testDriver(testTask, MockFailingMatchStub.class);
		Assert.fail("Function exception was not forwarded.");
	} catch (ExpectedTestException etex) {
		// good!
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Test caused an exception.");
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:30,代码来源:MatchTaskTest.java

示例11: testCancelMatchTaskWhileMatching

import org.apache.flink.runtime.operators.testutils.NirvanaOutputList; //导入依赖的package包/类
@Test
public void testCancelMatchTaskWhileMatching() {
	final int keyCnt = 20;
	final int valCnt = 20;
	
	try {
		setOutput(new NirvanaOutputList());
		addDriverComparator(this.comparator1);
		addDriverComparator(this.comparator2);
		getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
		getTaskConfig().setDriverStrategy(DriverStrategy.INNER_MERGE);
		getTaskConfig().setRelativeMemoryDriver(bnljn_frac);
		setNumFileHandlesForSort(4);
		
		final JoinDriver<Record, Record, Record> testTask = new JoinDriver<>();
		
		addInput(new UniformRecordGenerator(keyCnt, valCnt, true));
		addInput(new UniformRecordGenerator(keyCnt, valCnt, true));
		
		final AtomicReference<Throwable> error = new AtomicReference<>();
		
		Thread taskRunner = new Thread("Task runner for testCancelMatchTaskWhileMatching()") {
			@Override
			public void run() {
				try {
					testDriver(testTask, MockDelayingMatchStub.class);
				}
				catch (Throwable t) {
					error.set(t);
				}
			}
		};
		taskRunner.start();
		
		Thread.sleep(1000);
		
		cancel();
		taskRunner.interrupt();
		
		taskRunner.join(60000);
		
		assertFalse("Task thread did not finish within 60 seconds", taskRunner.isAlive());
		
		Throwable taskError = error.get();
		if (taskError != null) {
			taskError.printStackTrace();
			fail("Error in task while canceling: " + taskError.getMessage());
		}
	}
	catch (Exception e) {
		e.printStackTrace();
		fail(e.getMessage());
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:55,代码来源:JoinTaskTest.java


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