(String location, Job job)
| 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(); |
nothing calls this directly
no test coverage detected