(ResourceSchema schema, String location,
Job job)
| 421 | } |
| 422 | |
| 423 | @Override |
| 424 | public void storeSchema(ResourceSchema schema, String location, |
| 425 | Job job) throws IOException { |
| 426 | FileSystem fs = FileSystem.get(job.getConfiguration()); |
| 427 | |
| 428 | FileStatus[] outputFiles = fs.listStatus(new Path(location), |
| 429 | Util.getSuccessMarkerPathFilter()); |
| 430 | // verify that output is available prior to storeSchema call |
| 431 | Path resultPath = null; |
| 432 | if (outputFiles != null && outputFiles.length > 0 |
| 433 | && outputFiles[0].getPath().getName().startsWith("part-")) { |
| 434 | resultPath = outputFiles[0].getPath(); |
| 435 | } |
| 436 | if (resultPath == null) { |
| 437 | FileStatus[] listing = fs.listStatus(new Path(location)); |
| 438 | for (FileStatus fstat : listing) { |
| 439 | System.err.println("Output File:" + fstat.getPath()); |
| 440 | } |
| 441 | // not creating the marker file below fails the test |
| 442 | throw new IOException("" + resultPath + " not available in storeSchema"); |
| 443 | } |
| 444 | // create a file to test that this method got called - if it gets called |
| 445 | // multiple times, the create will throw an Exception |
| 446 | fs.create( |
| 447 | new Path(location + "_storeSchema_test"), |
| 448 | false); |
| 449 | } |
| 450 | |
| 451 | @Override |
| 452 | public void cleanupOnFailure(String location, Job job) |
nothing calls this directly
no test coverage detected