• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OutputStats类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getJobs

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
/**
 * Retrieves a list of Job objects from the PigStats object
 * @param stats
 * @return A list of ExecJob objects
 */
protected List<ExecJob> getJobs(PigStats stats) {
    LinkedList<ExecJob> jobs = new LinkedList<ExecJob>();
    JobGraph jGraph = stats.getJobGraph();
    Iterator<JobStats> iter = jGraph.iterator();
    while (iter.hasNext()) {
        JobStats js = iter.next();
        for (OutputStats output : js.getOutputs()) {
            if (js.isSuccessful()) {
                jobs.add(new HJob(HJob.JOB_STATUS.COMPLETED, pigContext, output
                        .getPOStore(), output.getAlias(), stats));
            } else {
                HJob hjob = new HJob(HJob.JOB_STATUS.FAILED, pigContext, output
                        .getPOStore(), output.getAlias(), stats);
                hjob.setException(js.getException());
                jobs.add(hjob);
            }
        }
    }
    return jobs;
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:26,代码来源:PigServer.java


示例2: addOneOutputStats

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
private void addOneOutputStats(POStore sto) {
    long records = -1;
    if (sto.isMultiStore()) {
        Long n = multiStoreCounters.get(MRPigStatsUtil.getMultiStoreCounterName(sto));
        if (n != null) records = n;
    } else {
        records = mapOutputRecords;
    }

    long bytes = getOutputSize(sto, conf);
    String location = sto.getSFile().getFileName();
    OutputStats ds = new OutputStats(location, bytes, records,
            (state == JobState.SUCCESS));
    ds.setPOStore(sto);
    ds.setConf(conf);
    outputs.add(ds);

    if (state == JobState.SUCCESS) {
         MRScriptState.get().emitOutputCompletedNotification(ds);
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:22,代码来源:MRJobStats.java


示例3: accumulateStats

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
/**
 * Updates the statistics after a DAG is finished.
 */
public void accumulateStats(TezJob tezJob) throws IOException {
    DAGStatus dagStatus = tezJob.getDAGStatus();
    TezDAGStats tezDAGStats = tezDAGStatsMap.get(tezJob.getName());
    if (dagStatus == null) {
        tezDAGStats.setSuccessful(false);
        tezScriptState.emitJobFailedNotification(tezDAGStats);
        return;
    } else {
        tezDAGStats.accumulateStats(tezJob);
        for(OutputStats output: tezDAGStats.getOutputs()) {
            tezScriptState.emitOutputCompletedNotification(output);
        }
        if (dagStatus.getState() == DAGStatus.State.SUCCEEDED) {
            tezDAGStats.setSuccessful(true);
            tezScriptState.emitjobFinishedNotification(tezDAGStats);
        } else if (dagStatus.getState() == DAGStatus.State.FAILED) {
            tezDAGStats.setSuccessful(false);
            tezDAGStats.setErrorMsg(tezJob.getDiagnostics());
            tezScriptState.emitJobFailedNotification(tezDAGStats);
        }
        tezScriptState.dagCompletedNotification(tezJob.getName(), tezDAGStats);
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:27,代码来源:TezPigScriptStats.java


示例4: outputCompletedNotification

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Override
public void outputCompletedNotification(String scriptId,
        OutputStats outputStats) {
    synchronized (listeners) {
        for (PigProgressNotificationListener listener : listeners) {
            listener.outputCompletedNotification(scriptId, outputStats);
        }
    }        
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:10,代码来源:SyncProgressNotificationAdaptor.java


示例5: testDuplicateCounterName2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test
public void testDuplicateCounterName2() throws Exception {
    
    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = filter A by a0 > 3;");
    w1.println("store A into 'output';");
    w1.println("store B into 'tmp/output';");
    w1.close();
    
    try {
        String[] args = { PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener());
 
        assertTrue(stats.isSuccessful());
        
        assertEquals(1, stats.getNumberJobs());
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(2, outputs.size());
        for (OutputStats outstats : outputs) {
            if (outstats.getLocation().endsWith("tmp/output")) {
                assertEquals(2, outstats.getNumberRecords());
            } else {
                assertEquals(5, outstats.getNumberRecords());
            }
        }
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
        Util.deleteFile(cluster, "tmp/output");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:33,代码来源:TestPigRunner.java


示例6: testEmptyFileCounter2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test //PIG-1893
public void testEmptyFileCounter2() throws Exception {

    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = filter A by a0 < 0;");
    w1.println("store A into '" + OUTPUT_FILE + "';");
    w1.println("store B into 'output2';");
    w1.close();
    
    try {
        String[] args = { PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener());
 
        assertTrue(stats.isSuccessful());
        
        assertEquals(1, stats.getNumberJobs());
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(2, outputs.size());
        for (OutputStats outstats : outputs) {
            if (outstats.getLocation().endsWith("output2")) {
                assertEquals(0, outstats.getNumberRecords());
            } else {
                assertEquals(5, outstats.getNumberRecords());
            }
        }
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
        Util.deleteFile(cluster, "output2");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:33,代码来源:TestPigRunner.java


示例7: testDisablePigCounters

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test // PIG-2208: Restrict number of PIG generated Haddop counters
public void testDisablePigCounters() throws Exception {        
    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("C = join A by a0, B by a0;");
    w1.println("store C into '" + OUTPUT_FILE + "';");
    w1.close();
    
    try {
        String[] args = { "-Dpig.disable.counter=true", PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener());
 
        assertTrue(stats.isSuccessful());
        
        assertEquals(1, stats.getNumberJobs());
        List<InputStats> inputs = stats.getInputStats();
        assertEquals(2, inputs.size());
        for (InputStats instats : inputs) {
            // the multi-input counters are disabled
            assertEquals(-1, instats.getNumberRecords());
        }
        
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(1, outputs.size());
        OutputStats outstats = outputs.get(0);
        assertEquals(9, outstats.getNumberRecords());
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:33,代码来源:TestPigRunner.java


示例8: testDisablePigCounters2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test // PIG-2208: Restrict number of PIG generated Haddop counters
public void testDisablePigCounters2() throws Exception {
    
    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = filter A by a0 > 3;");
    w1.println("store A into 'output';");
    w1.println("store B into 'tmp/output';");
    w1.close();
    
    try {
        String[] args = { "-Dpig.disable.counter=true", PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener());
 
        assertTrue(stats.isSuccessful());
        
        assertEquals(1, stats.getNumberJobs());
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(2, outputs.size());
        for (OutputStats outstats : outputs) {
            // the multi-output counters are disabled
            assertEquals(-1, outstats.getNumberRecords());
        }
        
        List<InputStats> inputs = stats.getInputStats();
        assertEquals(1, inputs.size());
        InputStats instats = inputs.get(0);
        assertEquals(5, instats.getNumberRecords());
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
        Util.deleteFile(cluster, "tmp/output");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:35,代码来源:TestPigRunner.java


示例9: outputCompletedNotification

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Override
public void outputCompletedNotification(String scriptId,
        OutputStats outputStats) {
    synchronized (listeners) {
        for (PigProgressNotificationListener listener : listeners) {
            listener.outputCompletedNotification(scriptId, outputStats);
        }
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:10,代码来源:SyncProgressNotificationAdaptor.java


示例10: getDisplayString

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Override
public String getDisplayString() {
    StringBuilder sb = new StringBuilder();
    String id = (jobId == null) ? "N/A" : jobId.toString();
    if (state == JobState.FAILED) {
        sb.append(id).append("\t")
            .append(getAlias()).append("\t")
            .append(getFeature()).append("\t");
        if (state == JobState.FAILED) {
            sb.append("Message: ").append(getErrorMessage()).append("\t");
        }
    } else if (state == JobState.SUCCESS) {
        sb.append(id).append("\t")
            .append(numberMaps).append("\t")
            .append(numberReduces).append("\t");
        appendStat(maxMapTime, sb);
        appendStat(minMapTime, sb);
        appendStat(avgMapTime, sb);
        appendStat(medianMapTime, sb);
        appendStat(maxReduceTime, sb);
        appendStat(minReduceTime, sb);
        appendStat(avgReduceTime, sb);
        appendStat(medianReduceTime, sb);

        sb.append(getAlias()).append("\t")
            .append(getFeature()).append("\t");
    }
    for (OutputStats os : outputs) {
        sb.append(os.getLocation()).append(",");
    }
    sb.append("\n");
    return sb.toString();
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:34,代码来源:MRJobStats.java


示例11: getJobs

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
/**
 * Retrieves a list of Job objects from the PigStats object
 * @param stats
 * @return A list of ExecJob objects
 */
protected List<ExecJob> getJobs(PigStats stats) {
    LinkedList<ExecJob> jobs = new LinkedList<ExecJob>();
    if (stats instanceof EmptyPigStats) {
        HJob job = new HJob(HJob.JOB_STATUS.COMPLETED, pigContext, stats.result(null)
                .getPOStore(), null);
        jobs.add(job);
        return jobs;
    }
    JobGraph jGraph = stats.getJobGraph();
    Iterator<JobStats> iter = jGraph.iterator();
    while (iter.hasNext()) {
        JobStats js = iter.next();
        for (OutputStats output : js.getOutputs()) {
            if (js.isSuccessful()) {
                jobs.add(new HJob(HJob.JOB_STATUS.COMPLETED, pigContext, output
                        .getPOStore(), output.getAlias(), stats));
            } else {
                HJob hjob = new HJob(HJob.JOB_STATUS.FAILED, pigContext, output
                        .getPOStore(), output.getAlias(), stats);
                hjob.setException(js.getException());
                jobs.add(hjob);
            }
        }
    }
    return jobs;
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:32,代码来源:PigServer.java


示例12: testDuplicateCounterName2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test
public void testDuplicateCounterName2() throws Exception {

    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = filter A by a0 > 3;");
    w1.println("store A into 'output';");
    w1.println("store B into 'tmp/output';");
    w1.close();

    try {
        String[] args = { "-x", execType, PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener(execType));

        assertTrue(stats.isSuccessful());

        assertEquals(1, stats.getNumberJobs());
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(2, outputs.size());
        for (OutputStats outstats : outputs) {
            if (outstats.getLocation().endsWith("tmp/output")) {
                assertEquals(2, outstats.getNumberRecords());
            } else {
                assertEquals(5, outstats.getNumberRecords());
            }
        }
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
        Util.deleteFile(cluster, "tmp/output");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:33,代码来源:TestPigRunner.java


示例13: testEmptyFileCounter2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test //PIG-1893
public void testEmptyFileCounter2() throws Exception {

    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = filter A by a0 < 0;");
    w1.println("store A into '" + OUTPUT_FILE + "';");
    w1.println("store B into 'output2';");
    w1.close();

    try {
        String[] args = { "-x", execType, PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener(execType));

        assertTrue(stats.isSuccessful());

        assertEquals(1, stats.getNumberJobs());
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(2, outputs.size());
        for (OutputStats outstats : outputs) {
            if (outstats.getLocation().endsWith("output2")) {
                assertEquals(0, outstats.getNumberRecords());
            } else {
                assertEquals(5, outstats.getNumberRecords());
            }
        }
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
        Util.deleteFile(cluster, "output2");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:33,代码来源:TestPigRunner.java


示例14: testDisablePigCounters

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test // PIG-2208: Restrict number of PIG generated Haddop counters
public void testDisablePigCounters() throws Exception {
    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("C = join A by a0, B by a0;");
    w1.println("store C into '" + OUTPUT_FILE + "';");
    w1.close();

    try {
        String[] args = {"-Dpig.disable.counter=true", "-x", execType, PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener(execType));

        assertTrue(stats.isSuccessful());

        assertEquals(1, stats.getNumberJobs());
        List<InputStats> inputs = stats.getInputStats();
        assertEquals(2, inputs.size());
        if (execType.equals("tez")) {
            assertEquals(5, inputs.get(0).getNumberRecords());
            assertEquals(5, inputs.get(1).getNumberRecords());
        } else {
            for (InputStats instats : inputs) {
                // the multi-input counters are disabled
                assertEquals(-1, instats.getNumberRecords());
            }
        }

        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(1, outputs.size());
        OutputStats outstats = outputs.get(0);
        assertEquals(9, outstats.getNumberRecords());
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:38,代码来源:TestPigRunner.java


示例15: testDisablePigCounters2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test // PIG-2208: Restrict number of PIG generated Haddop counters
public void testDisablePigCounters2() throws Exception {

    PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE));
    w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);");
    w1.println("B = filter A by a0 > 3;");
    w1.println("store A into 'output';");
    w1.println("store B into 'tmp/output';");
    w1.close();

    try {
        String[] args = { "-Dpig.disable.counter=true", "-x", execType, PIG_FILE };
        PigStats stats = PigRunner.run(args, new TestNotificationListener(execType));

        assertTrue(stats.isSuccessful());

        assertEquals(1, stats.getNumberJobs());
        List<OutputStats> outputs = stats.getOutputStats();
        assertEquals(2, outputs.size());
        if (execType.equals("tez")) {
            assertEquals(outputs.get(0).getNumberRecords(), 5);
            assertEquals(outputs.get(1).getNumberRecords(), 2);
        } else {
            for (OutputStats outstats : outputs) {
                // the multi-output counters are disabled
                assertEquals(-1, outstats.getNumberRecords());
            }
        }

        List<InputStats> inputs = stats.getInputStats();
        assertEquals(1, inputs.size());
        InputStats instats = inputs.get(0);
        assertEquals(5, instats.getNumberRecords());
    } finally {
        new File(PIG_FILE).delete();
        Util.deleteFile(cluster, OUTPUT_FILE);
        Util.deleteFile(cluster, "tmp/output");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:40,代码来源:TestPigRunner.java


示例16: outputCompletedNotification

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Override
public void outputCompletedNotification(String arg0, OutputStats arg1) {
  logger.info("outputCompletedNotification");
  logger.info("The script id is " + arg0);
  logger.info("The output stat name is " + arg1.getName());
  logger.info("You can get a lot more useful information here.");
}
 
开发者ID:azkaban,项目名称:azkaban-plugins,代码行数:8,代码来源:AzkabanPigListener.java


示例17: testTFileRecordReader

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test
public void testTFileRecordReader() throws Exception {
    PrintWriter w = new PrintWriter(new FileWriter("1.txt"));
    for (int i = 0; i < 30; i++) {
        w.println("1\tthis is a test for compression of temp files");
    }
    w.close();
    
    Util.copyFromLocalToCluster(cluster, "1.txt", "1.txt");
    
    PrintWriter w1 = new PrintWriter(new FileWriter("tfile.pig"));
    w1.println("A = load '1.txt' as (a0:int, a1:chararray);");
    w1.println("B = group A by a0;");
    w1.println("store B into 'tfile' using org.apache.pig.impl.io.TFileStorage();");
    w1.close();
    
    PrintWriter w2 = new PrintWriter(new FileWriter("tfile2.pig"));
    w2.println("A = load 'tfile' using org.apache.pig.impl.io.TFileStorage() as (a:int, b:bag{(b0:int, b1:chararray)});");
    w2.println("B = foreach A generate flatten($1);");
    w2.println("store B into '2.txt';");
    w2.close();
    
    try {
        String[] args = { "-Dpig.tmpfilecompression.codec=gz",
                "-Dtfile.io.chunk.size=100", "tfile.pig" };
        PigStats stats = PigRunner.run(args, null);
 
        assertTrue(stats.isSuccessful());
 
        String[] args2 = { "-Dpig.tmpfilecompression.codec=gz",
                "-Dtfile.io.chunk.size=100", "tfile2.pig" };
        PigStats stats2 = PigRunner.run(args2, null);

        assertTrue(stats2.isSuccessful());
        
        OutputStats os = stats2.result("B");
        Iterator<Tuple> iter = os.iterator();
        int count = 0;
        String expected = "(1,this is a test for compression of temp files)";
        while (iter.hasNext()) {
            count++;
            assertEquals(expected, iter.next().toString());
        }
        assertEquals(30, count);
        
    } finally {
        new File("tfile.pig").delete(); 
        new File("tfile2.pig").delete(); 
        new File("1.txt").delete(); 
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:52,代码来源:TestTmpFileCompression.java


示例18: outputCompletedNotification

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Override
public void outputCompletedNotification(String id, OutputStats outputStats) {
    System.out.println("id: " + id + " output done: " + outputStats.getLocation());
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:5,代码来源:TestPigRunner.java


示例19: runParallelTest2

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
@Test
public void runParallelTest2() throws Exception {
    String[] script = {
            "#!/usr/bin/python",
            "from org.apache.pig.scripting import *",
            "input = 'simple_table_7'",
            "Pig.fs(\"rmr simple_out\")",
            "Pig.fs(\"rmr simple_out2\")",
            "output1 = 'simple_out'",
            "output2 = 'simple_out2'",
            "P = Pig.compile(\"mypipeline\", \"\"\"a = load '$input';",
            "b = foreach a generate $0, org.apache.pig.test.utils.UDFContextTestEvalFunc3($0);",
            "store b into '$output';\"\"\")",
            "Q = P.bind([{'input':input, 'output':output1}, {'input':input, 'output':output2}])",
            "stats = Q.run()"
    };
    String[] input = {
            "1\t3"
    };

    Util.createInputFile(cluster, "simple_table_7", input);
    PigStats mainStats = runPigRunner("runParallelTest2", script);

    Map<String, List<PigStats>> statsMap = mainStats.getAllStats();
    assertEquals(1, statsMap.size());
    assertEquals("mypipeline", statsMap.keySet().iterator().next());
    List<PigStats> lst = statsMap.get("mypipeline");
    assertEquals(2, lst.size());
    String[] results = new String[2];
    int i = 0;
    for (PigStats stats : lst) {
        assertTrue("job should succeed", stats.isSuccessful());
        assertEquals(1, stats.getNumberJobs());
        OutputStats os = stats.getOutputStats().get(0);
        Tuple t = os.iterator().next();
        results[i++] = t.get(1).toString();
    }
    assertTrue(results[0] != null);
    assertTrue(results[1] != null);
    assertTrue(!results[0].equals(results[1]));
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:42,代码来源:TestScriptLanguage.java


示例20: display

import org.apache.pig.tools.pigstats.OutputStats; //导入依赖的package包/类
private void display() {
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
    StringBuilder sb = new StringBuilder();
    sb.append("\n");
    sb.append(String.format("%1$20s: %2$-100s%n", "HadoopVersion", getHadoopVersion()));
    sb.append(String.format("%1$20s: %2$-100s%n", "PigVersion", getPigVersion()));
    sb.append(String.format("%1$20s: %2$-100s%n", "TezVersion", TezExecType.getTezVersion()));
    sb.append(String.format("%1$20s: %2$-100s%n", "UserId", userId));
    sb.append(String.format("%1$20s: %2$-100s%n", "FileName", getFileName()));
    sb.append(String.format("%1$20s: %2$-100s%n", "StartedAt", sdf.format(new Date(startTime))));
    sb.append(String.format("%1$20s: %2$-100s%n", "FinishedAt", sdf.format(new Date(endTime))));
    sb.append(String.format("%1$20s: %2$-100s%n", "Features", getFeatures()));
    sb.append("\n");
    if (returnCode == ReturnCode.SUCCESS) {
        sb.append("Success!\n");
    } else if (returnCode == ReturnCode.PARTIAL_FAILURE) {
        sb.append("Some tasks have failed! Stop running all dependent tasks\n");
    } else {
        sb.append("Failed!\n");
    }
    sb.append("\n");

    // Print diagnostic info in case of failure
    if (returnCode == ReturnCode.FAILURE
            || returnCode == ReturnCode.PARTIAL_FAILURE) {
        if (errorMessage != null) {
            String[] lines = errorMessage.split("\n");
            for (int i = 0; i < lines.length; i++) {
                String s = lines[i].trim();
                if (i == 0 || !StringUtils.isEmpty(s)) {
                    sb.append(String.format("%1$20s: %2$-100s%n", i == 0 ? "ErrorMessage" : "", s));
                }
            }
            sb.append("\n");
        }
    }

    for (TezDAGStats dagStats : tezDAGStatsMap.values()) {
        sb.append(dagStats.getDisplayString());
        sb.append("\n");
    }

    sb.append("Input(s):\n");
    for (InputStats is : getInputStats()) {
        sb.append(is.getDisplayString().trim()).append("\n");
    }
    sb.append("\n");
    sb.append("Output(s):\n");
    for (OutputStats os : getOutputStats()) {
        sb.append(os.getDisplayString().trim()).append("\n");
    }
    LOG.info("Script Statistics:\n" + sb.toString());
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:54,代码来源:TezPigScriptStats.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java S00PacketDisconnect类代码示例发布时间:2022-05-23
下一篇:
Java TransformedList类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap