MCPcopy Create free account
hub / github.com/apache/pig / getFirstOutputFile

Method getFirstOutputFile

test/org/apache/pig/test/TestStoreBase.java:431–451  ·  view source on GitHub ↗
(Configuration conf, Path outputDir,
            ExecType exectype, boolean isMapOutput)

Source from the content-addressed store, hash-verified

429 }
430
431 public static Path getFirstOutputFile(Configuration conf, Path outputDir,
432 ExecType exectype, boolean isMapOutput) throws Exception {
433 FileSystem fs = outputDir.getFileSystem(conf);
434 FileStatus[] outputFiles = fs.listStatus(outputDir,
435 Util.getSuccessMarkerPathFilter());
436
437 boolean filefound = false;
438 if (outputFiles != null && outputFiles.length != 0) {
439 String name = outputFiles[0].getPath().getName();
440 if (exectype == Util.getLocalTestMode() || exectype == ExecType.MAPREDUCE) {
441 if (isMapOutput) {
442 filefound = name.equals("part-m-00000");
443 } else {
444 filefound = name.equals("part-r-00000");
445 }
446 } else {
447 filefound = name.startsWith("part-");
448 }
449 }
450 return filefound ? outputFiles[0].getPath() : null;
451 }
452}

Callers 2

storeAndCopyLocallyMethod · 0.80

Calls 7

getLocalTestModeMethod · 0.95
getFileSystemMethod · 0.80
listStatusMethod · 0.45
getNameMethod · 0.45
getPathMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected