@Override
public ModelOutput<T> createOutput(
Class<? extends T> dataType,
FileSystem fileSystem, Path path,
Counter counter) throws IOException, InterruptedException {
WriterOptions options = OrcFile.writerOptions(getConf());
options.fileSystem(fileSystem);
options.inspector(new DataModelInspector(getDataModelDescriptor()));
OrcFormatConfiguration conf = getFormatConfiguration();
if (LOG.isDebugEnabled()) {
LOG.debug(MessageFormat.format(
"ORCFile output ({0}): {1}",
path,
conf));
}
Version formatVersion = conf.getFormatVersion();
if (formatVersion != null) {
options.version(formatVersion);
}
CompressionKind compressionKind = conf.getCompressionKind();
if (compressionKind != null) {
options.compress(compressionKind);
}
Long stripeSize = conf.getStripeSize();
if (stripeSize != null) {
options.stripeSize(stripeSize);
}
return new OrcFileOutput<T>(getDataModelDescriptor(), path, options, counter);
}