final String destination,
FileOutputFormat<? super NullWritable, ? super V> output) throws IOException {
assert destination != null;
assert output != null;
LOG.debug("Opening {} using {}", destination, output.getClass().getName());
Job job = JobCompatibility.newJob(configuration);
job.setOutputKeyClass(NullWritable.class);
job.setOutputValueClass(definition.getModelClass());
final File temporaryDir = File.createTempFile("asakusa", ".tempdir");
if (temporaryDir.delete() == false || temporaryDir.mkdirs() == false) {
throw new IOException("Failed to create temporary directory");
}
LOG.debug("Using staging deploy target: {}", temporaryDir);
URI uri = temporaryDir.toURI();
FileOutputFormat.setOutputPath(job, new Path(uri));
TaskAttemptContext context = JobCompatibility.newTaskAttemptContext(
job.getConfiguration(),
JobCompatibility.newTaskAttemptId(JobCompatibility.newTaskId(JobCompatibility.newJobId())));
FileOutputFormatDriver<V> result = new FileOutputFormatDriver<V>(context, output, NullWritable.get()) {
@Override
public void close() throws IOException {
super.close();