logger.debug("Closing pathTmp:{}", pathTmp);
try {
Closeables.close(avroParquetWriter, false);
} catch (IOException e) {
throw new DatasetWriterException(
"Unable to close writer:" + avroParquetWriter + " to path:" + pathTmp);
}
logger.debug("Committing pathTmp:{} to path:{}", pathTmp, path);
try {
if (!fileSystem.rename(pathTmp, path)) {
throw new DatasetWriterException(
"Failed to move " + pathTmp + " to " + path);
}
} catch (IOException e) {
throw new DatasetWriterException(
"Internal error while trying to commit path:" + pathTmp, e);
}
state = ReaderWriterState.CLOSED;
}