本文整理匯總了Java中org.apache.flink.test.util.MultipleProgramsTestBase類的典型用法代碼示例。如果您正苦於以下問題:Java MultipleProgramsTestBase類的具體用法?Java MultipleProgramsTestBase怎麽用?Java MultipleProgramsTestBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MultipleProgramsTestBase類屬於org.apache.flink.test.util包,在下文中一共展示了MultipleProgramsTestBase類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: executeTask
import org.apache.flink.test.util.MultipleProgramsTestBase; //導入依賴的package包/類
private void executeTask(MapFunction<Long, Long> mapper, int retries) throws Exception {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setRestartStrategy(RestartStrategies.fixedDelayRestart(retries, 0));
List<Long> result = env.generateSequence(1, 9)
.map(mapper)
.collect();
MultipleProgramsTestBase.compareResultAsText(result, "1\n2\n3\n4\n5\n6\n7\n8\n9");
}
示例2: setup
import org.apache.flink.test.util.MultipleProgramsTestBase; //導入依賴的package包/類
@BeforeClass
public static void setup() throws Exception {
MultipleProgramsTestBase.setup();
File clusterDir = tmpFolder.newFolder(CLUSTER_1);
System.clearProperty(MiniDFSCluster.PROP_TEST_BUILD_DATA);
conf = new HdfsConfiguration();
conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, clusterDir.getAbsolutePath());
cluster = new MiniDFSCluster.Builder(conf).build();
fs = FileSystem.get(conf);
String fromPath = LDBCToFlinkTest.class.getResource("/data").getPath();
fs.copyFromLocalFile(new Path(fromPath), new Path(HDFS_DATA_PATH));
}
示例3: tearDown
import org.apache.flink.test.util.MultipleProgramsTestBase; //導入依賴的package包/類
@AfterClass
public static void tearDown() throws Exception {
cluster.shutdown();
MultipleProgramsTestBase.teardown();
}