本文整理汇总了Java中org.apache.pig.tools.pigstats.PigStats.getPigProperties方法的典型用法代码示例。如果您正苦于以下问题:Java PigStats.getPigProperties方法的具体用法?Java PigStats.getPigProperties怎么用?Java PigStats.getPigProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.pig.tools.pigstats.PigStats
的用法示例。
在下文中一共展示了PigStats.getPigProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testErrorLogFile
import org.apache.pig.tools.pigstats.PigStats; //导入方法依赖的package包/类
@Test
public void testErrorLogFile() throws Exception {
PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE));
w.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
w.println("B = foreach A generate StringSize(a0);");
w.println("store B into '" + OUTPUT_FILE + "';");
w.close();
try {
String[] args = { "-x", "local", PIG_FILE };
PigStats stats = PigRunner.run(args, null);
assertTrue(!stats.isSuccessful());
Properties props = stats.getPigProperties();
String logfile = props.getProperty("pig.logfile");
File f = new File(logfile);
assertTrue(f.exists());
} finally {
new File(PIG_FILE).delete();
}
}
示例2: testErrorLogFile
import org.apache.pig.tools.pigstats.PigStats; //导入方法依赖的package包/类
@Test
public void testErrorLogFile() throws Exception {
PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE));
w.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
w.println("B = foreach A generate StringSize(a0);");
w.println("store B into '" + OUTPUT_FILE + "';");
w.close();
try {
String[] args = { "-x", "local", PIG_FILE };
PigStats stats = PigRunner.run(args, null);
assertTrue(!stats.isSuccessful());
Properties props = stats.getPigProperties();
String logfile = props.getProperty("pig.logfile");
File f = new File(logfile);
assertTrue(f.exists());
} finally {
new File(PIG_FILE).delete();
}
}
示例3: testErrorLogFile2
import org.apache.pig.tools.pigstats.PigStats; //导入方法依赖的package包/类
@Test
public void testErrorLogFile2() throws Exception {
PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE));
w.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
w.println("B = foreach A generate StringSize(a0);");
w.println("store B into '" + OUTPUT_FILE + "';");
w.close();
try {
String[] args = { "-M", "-x", "local", PIG_FILE };
PigStats stats = PigRunner.run(args, null);
assertTrue(!stats.isSuccessful());
Properties props = stats.getPigProperties();
// If test on nfs, the pig script complaining "output" exists
// and does not actually launch the job. This could due to a mapreduce
// bug which removing file before closing it.
// If this happens, props is null because we only set pigContext before
// launching job.
if (props!=null) {
String logfile = props.getProperty("pig.logfile");
File f = new File(logfile);
assertTrue(f.exists());
}
} finally {
new File(PIG_FILE).delete();
}
}
示例4: testErrorLogFile2
import org.apache.pig.tools.pigstats.PigStats; //导入方法依赖的package包/类
@Test
public void testErrorLogFile2() throws Exception {
PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE));
w.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
w.println("B = foreach A generate StringSize(a0);");
w.println("store B into '" + OUTPUT_FILE + "';");
w.close();
try {
String[] args = { "-M", "-x", "local", PIG_FILE };
PigStats stats = PigRunner.run(args, null);
assertTrue(!stats.isSuccessful());
Properties props = stats.getPigProperties();
// If test on nfs, the pig script complaining "output" exists
// and does not actually launch the job. This could due to a mapreduce
// bug which removing file before closing it.
// If this happens, props is null because we only set pigContext before
// launching job.
if (props!=null) {
String logfile = props.getProperty("pig.logfile");
File f = new File(logfile);
assertTrue(f.exists());
}
} finally {
new File(PIG_FILE).delete();
}
}