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


Java PigStats.getPigProperties方法代码示例

本文整理汇总了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(); 
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:23,代码来源:TestPigRunner.java

示例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();
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:23,代码来源:TestPigRunner.java

示例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();
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:30,代码来源:TestPigRunner.java

示例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();
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:30,代码来源:TestPigRunner.java


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