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

Method storeSchema

test/org/apache/pig/test/TestStore.java:423–449  ·  view source on GitHub ↗
(ResourceSchema schema, String location,
                Job job)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 7

getMethod · 0.65
getConfigurationMethod · 0.65
createMethod · 0.65
listStatusMethod · 0.45
getNameMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected