Example usage for org.apache.hadoop.mapred JobConf getJobLocalDir

List of usage examples for org.apache.hadoop.mapred JobConf getJobLocalDir

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobConf getJobLocalDir.

Prototype

public String getJobLocalDir() 

Source Link

Document

Get job-specific shared directory for use as scratch space

When a job starts, a shared directory is created at location ${mapreduce.cluster.local.dir}/taskTracker/$user/jobcache/$jobid/work/ .

Usage

From source file:org.broadinstitute.sting.gatk.hadoop.LociRecordReader.java

License:Open Source License

public void initialize(InputSplit spl, TaskAttemptContext ctx) throws IOException {
    final FileVirtualSplit split = (FileVirtualSplit) spl;

    file = split.getPath();// ww  w .j  av a2  s  . co m
    fs = file.getFileSystem(ctx.getConfiguration());

    final FSDataInputStream in = fs.open(file);
    codec = new BAMRecordCodec(new SAMFileReader(in).getFileHeader());

    in.seek(0);
    bci = new BlockCompressedInputStream(
            new WrapSeekable<FSDataInputStream>(in, fs.getFileStatus(file).getLen(), file));

    virtualStart = split.getStartVirtualOffset();
    fileStart = virtualStart >>> 16;
    virtualEnd = split.getEndVirtualOffset();
    fileEnd = virtualEnd >>> 16;
    idx = new SplittingBAMIndex(file.getFileSystem(ctx.getConfiguration()).open(getIdxPath(file)));
    codec.setInputStream(bci);
    bci.seek(virtualStart);

    JobConf job = new JobConf(ctx.getConfiguration());
    jobDir = new String(job.getJobLocalDir());
    attemptID = ctx.getTaskAttemptID().toString();
}