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

Method setStoreLocation

src/org/apache/pig/builtin/PigStorage.java:463–480  ·  view source on GitHub ↗
(String location, Job job)

Source from the content-addressed store, hash-verified

461 }
462
463 @Override
464 public void setStoreLocation(String location, Job job) throws IOException {
465 job.getConfiguration().set(MRConfiguration.TEXTOUTPUTFORMAT_SEPARATOR, "");
466 FileOutputFormat.setOutputPath(job, new Path(location));
467
468 if( "true".equals( job.getConfiguration().get( "output.compression.enabled" ) ) ) {
469 FileOutputFormat.setCompressOutput( job, true );
470 String codec = job.getConfiguration().get( "output.compression.codec" );
471 try {
472 FileOutputFormat.setOutputCompressorClass( job, (Class<? extends CompressionCodec>) Class.forName( codec ) );
473 } catch (ClassNotFoundException e) {
474 throw new RuntimeException("Class not found: " + codec );
475 }
476 } else {
477 // This makes it so that storing to a directory ending with ".gz" or ".bz2" works.
478 setCompression(new Path(location), job);
479 }
480 }
481
482 private void setCompression(Path path, Job job) {
483 String location=path.getName();

Callers

nothing calls this directly

Calls 5

setCompressionMethod · 0.95
setMethod · 0.65
getConfigurationMethod · 0.65
getMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected