hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Schmitz <Christoph.Schm...@1und1.de>
Subject AW: how to change default name of a sequnce file
Date Mon, 20 Jun 2011 06:16:32 GMT
Hi JJ,

you can do that by subclassing TextOutputFormat (or whichever output format you're using)
and overloading the getDefaultWorkFile method:

public class MyOutputFormat<K, V> extends TextOutputFormat<K, V> {
    // ...
    public Path getDefaultWorkFile(TaskAttemptContext context,
            String extension) throws IOException {
        FileOutputCommitter committer = (FileOutputCommitter) getOutputCommitter(context);
        return new Path(committer.getWorkPath(), myOwnMethodToComputeTheFileName(context));
    }
}

Regards,

Christoph

-----Urspr√ľngliche Nachricht-----
Von: Mapred Learn [mailto:mapred.learn@gmail.com] 
Gesendet: Montag, 20. Juni 2011 06:59
An: mapreduce-user@hadoop.apache.org; cdh-user@cloudera.org
Betreff: how to change default name of a sequnce file

Hi,
I want to name output files of my map-red job (sequence files) to be a certain name instead
of part* default format.
 
Has anyone ever tried to over-ride the default filename and give output file name per map-red
?
 
Thanks,
-JJ

Mime
View raw message