Example usage for org.apache.hadoop.mapred FileAlreadyExistsException FileAlreadyExistsException

List of usage examples for org.apache.hadoop.mapred FileAlreadyExistsException FileAlreadyExistsException

Introduction

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

Prototype

public FileAlreadyExistsException() 

Source Link

Usage

From source file:co.nubetech.hiho.mapreduce.lib.output.AppendSequenceFileOutputFormat.java

License:Apache License

@Override
public void checkOutputSpecs(JobContext job) throws FileAlreadyExistsException, IOException {
    try {//from   w  ww . ja v  a 2 s  .c  o  m
        super.checkOutputSpecs(job);
    } catch (FileAlreadyExistsException e) {

        Configuration conf = job.getConfiguration();

        isAppend = conf.get(HIHOConf.IS_APPEND, "false");
        if (isAppend.equalsIgnoreCase("false")) {
            throw new FileAlreadyExistsException();
        } else {
            Path outDir = getOutputPath(job);
            if (outDir == null) {
                throw new InvalidJobConfException("OUTPUT directory not set.");
            }
        }
    }
}