class CopyOutputFormat extends TextOutputFormat<K, V> {

  @Override
  public void checkOutputSpecs(JobContext context) throws IOException {
    Configuration conf = HadoopCompat.getConfiguration(context);

    if (getCommitDirectory(conf) == null) {
      throw new IllegalStateException("Commit directory not configured");
    }

    Path workingPath = getWorkingDirectory(conf);
    if (workingPath == null) {
      throw new IllegalStateException("Working directory not configured");
    }

    // get delegation token for outDir's file system
    TokenCache.obtainTokensForNamenodes(HadoopCompat.getCredentials(context),
                                        new Path[] {workingPath}, conf);
  }

}