public DataSinkDescriptor build() {
if (org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.class
.isAssignableFrom(outputFormat) ||
FileOutputFormat.class.isAssignableFrom(outputFormat)) {
if (outputPath == null) {
throw new TezUncheckedException(
"OutputPaths must be specified for OutputFormats based on " +
org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.class.getName() + " or " +
FileOutputFormat.class.getName());
}
}
Credentials credentials = null;
if (getCredentialsForSinkFilesystem && outputPath != null) {
try {
Path path = new Path(outputPath);
FileSystem fs;
fs = path.getFileSystem(conf);
Path qPath = fs.makeQualified(path);
credentials = new Credentials();
TezClientUtils.addFileSystemCredentialsFromURIs(Collections.singletonList(qPath.toUri()),
credentials, conf);
} catch (IOException e) {
throw new TezUncheckedException(e);
}
}
return new DataSinkDescriptor(
OutputDescriptor.create(outputClassName).setUserPayload(createUserPayload()),