本文整理汇总了Java中org.apache.pig.pigunit.Cluster类的典型用法代码示例。如果您正苦于以下问题:Java Cluster类的具体用法?Java Cluster怎么用?Java Cluster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cluster类属于org.apache.pig.pigunit包,在下文中一共展示了Cluster类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWithMock
import org.apache.pig.pigunit.Cluster; //导入依赖的package包/类
@Ignore("Not ready yet")
@Test
public void testWithMock() throws ParseException, IOException {
String[] args = {
"n=3",
"reducers=1",
"input=top_queries_input_data.txt",
"output=top_3_queries",
};
PigServer mockServer = null;
Cluster mockCluster = null;
test = new PigTest(PIG_SCRIPT, args, mockServer, mockCluster);
test.assertOutput(new File("data/top_queries_expected_top_3.txt"));
}
示例2: testWithMock
import org.apache.pig.pigunit.Cluster; //导入依赖的package包/类
@Ignore("Not ready yet")
@Test
public void testWithMock() throws ParseException, IOException {
String[] args = {
"n=3",
"reducers=1",
"input=top_queries_input_data.txt",
"output=top_3_queries",
};
PigServer mockServer = null;
Cluster mockCluster = null;
test = new PigTest(PIG_SCRIPT, args, mockServer, mockCluster);
test.assertOutput(new File("data/top_queries_expected_top_3.txt"));
}
示例3: createPigTest
import org.apache.pig.pigunit.Cluster; //导入依赖的package包/类
public static PigTest createPigTest(String scriptFile, String[] args) throws PigException {
try {
PigServer pigServer = new PigServer(ExecType.LOCAL);
Cluster pigCluster = new Cluster(pigServer.getPigContext());
return new PigTest(scriptFile, args, pigServer, pigCluster);
} catch (Exception ex) {
throw new PigException("Failed to create PigTest instance. ", ex);
}
}
示例4: setupDataFilesForPigServer
import org.apache.pig.pigunit.Cluster; //导入依赖的package包/类
@Before
public void setupDataFilesForPigServer() throws Exception {
System.getProperties().setProperty("pigunit.exectype",
Util.getLocalTestMode().toString());
Cluster cluster = PigTest.getCluster();
// Put the data files in target/ so they don't dirty the local git checkout
cluster.update(
new Path(getFullPathForTestDataFile("data.txt")),
new Path("target/data.txt"));
cluster.update(
new Path(getFullPathForTestDataFile("data2.txt")),
new Path("target/data2.txt"));
}