(Configuration conf, Path outputDir,
ExecType exectype, boolean isMapOutput)
| 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 | } |
no test coverage detected