use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class CarbonDictionaryMetadataReaderImpl method initFileLocation.
/**
* This method will form the path for dictionary metadata file for a given column
*/
protected void initFileLocation() {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(this.storePath, carbonTableIdentifier);
this.columnDictionaryMetadataFilePath = carbonTablePath.getDictionaryMetaFilePath(columnIdentifier.getColumnId());
}
use of org.apache.carbondata.core.service.PathService in project carbondata by apache.
the class AbstractDictionaryCache method getDictionaryMetaCarbonFile.
/**
* This method will return the carbon file objetc based on its type (local, HDFS)
*
* @param dictionaryColumnUniqueIdentifier
* @return
*/
private CarbonFile getDictionaryMetaCarbonFile(DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier) throws IOException {
PathService pathService = CarbonCommonFactory.getPathService();
CarbonTablePath carbonTablePath = pathService.getCarbonTablePath(carbonStorePath, dictionaryColumnUniqueIdentifier.getCarbonTableIdentifier());
String dictionaryFilePath = carbonTablePath.getDictionaryMetaFilePath(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId());
FileFactory.FileType fileType = FileFactory.getFileType(dictionaryFilePath);
CarbonFile dictFile = FileFactory.getCarbonFile(dictionaryFilePath, fileType);
// When rename table triggered parallely with select query, dictionary files may not exist
if (!dictFile.exists()) {
throw new IOException("Dictionary file does not exist: " + dictionaryFilePath);
}
return dictFile;
}
Aggregations