use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class CarbonDictionarySortIndexReaderImpl method initPath.
protected void initPath() {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(carbonStorePath, carbonTableIdentifier);
try {
CarbonDictionaryColumnMetaChunk chunkMetaObjectForLastSegmentEntry = getChunkMetaObjectForLastSegmentEntry();
long dictOffset = chunkMetaObjectForLastSegmentEntry.getEnd_offset();
this.sortIndexFilePath = carbonTablePath.getSortIndexFilePath(columnIdentifier.getColumnId(), dictOffset);
if (!FileFactory.isFileExist(this.sortIndexFilePath, FileFactory.getFileType(this.sortIndexFilePath))) {
this.sortIndexFilePath = carbonTablePath.getSortIndexFilePath(columnIdentifier.getColumnId());
}
} catch (IOException e) {
this.sortIndexFilePath = carbonTablePath.getSortIndexFilePath(columnIdentifier.getColumnId());
}
}
use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class CarbonDictionaryReaderImpl method initFileLocation.
/**
* This method will form the path for dictionary file for a given column
*/
protected void initFileLocation() {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(this.storePath, carbonTableIdentifier);
this.columnDictionaryFilePath = carbonTablePath.getDictionaryFilePath(columnIdentifier.getColumnId());
}
use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class CarbonDictionaryWriterImpl method initPaths.
protected void initPaths() {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(this.storePath, carbonTableIdentifier);
this.dictionaryFilePath = carbonTablePath.getDictionaryFilePath(columnIdentifier.getColumnId());
this.dictionaryMetaFilePath = carbonTablePath.getDictionaryMetaFilePath(columnIdentifier.getColumnId());
}
use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class CarbonDictionarySortIndexWriterImpl method initPath.
protected void initPath() {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(carbonStorePath, carbonTableIdentifier);
String dictionaryPath = carbonTablePath.getDictionaryFilePath(columnIdentifier.getColumnId());
long dictOffset = CarbonUtil.getFileSize(dictionaryPath);
this.sortIndexFilePath = carbonTablePath.getSortIndexFilePath(columnIdentifier.getColumnId(), dictOffset);
cleanUpOldSortIndex(carbonTablePath, dictionaryPath);
}
use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class CarbonUtil method isFileExistsForGivenColumn.
/**
* This method will check if dictionary and its metadata file exists for a given column
*
* @param dictionaryColumnUniqueIdentifier unique identifier which contains dbName,
* tableName and columnIdentifier
* @return
*/
public static boolean isFileExistsForGivenColumn(String carbonStorePath, DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier) {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(carbonStorePath, dictionaryColumnUniqueIdentifier.getCarbonTableIdentifier());
String dictionaryFilePath = carbonTablePath.getDictionaryFilePath(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId());
String dictionaryMetadataFilePath = carbonTablePath.getDictionaryMetaFilePath(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId());
// check if both dictionary and its metadata file exists for a given column
return isFileExists(dictionaryFilePath) && isFileExists(dictionaryMetadataFilePath);
}
Aggregations