use of org.apache.carbondata.core.writer.CarbonDeleteDeltaWriterImpl in project carbondata by apache.
the class CarbonDataMergerUtil method startCompactionDeleteDeltaFiles.
/**
* this method compact the delete delta files.
* @param deleteDeltaFiles
* @param blockName
* @param fullBlockFilePath
* @return
*/
public static Boolean startCompactionDeleteDeltaFiles(List<String> deleteDeltaFiles, String blockName, String fullBlockFilePath) throws IOException {
DeleteDeltaBlockDetails deleteDeltaBlockDetails = null;
CarbonDeleteFilesDataReader dataReader = new CarbonDeleteFilesDataReader();
try {
deleteDeltaBlockDetails = dataReader.getCompactedDeleteDeltaFileFromBlock(deleteDeltaFiles, blockName);
} catch (Exception e) {
String blockFilePath = fullBlockFilePath.substring(0, fullBlockFilePath.lastIndexOf(CarbonCommonConstants.FILE_SEPARATOR));
LOGGER.error("Error while getting the delete delta blocks in path " + blockFilePath);
throw new IOException();
}
CarbonDeleteDeltaWriterImpl carbonDeleteWriter = new CarbonDeleteDeltaWriterImpl(fullBlockFilePath, FileFactory.getFileType(fullBlockFilePath));
try {
carbonDeleteWriter.write(deleteDeltaBlockDetails);
} catch (IOException e) {
LOGGER.error("Error while writing compacted delete delta file " + fullBlockFilePath);
throw new IOException();
}
return true;
}
Aggregations