use of org.apache.carbondata.core.datastore.filesystem.AbstractDFSCarbonFile in project carbondata by apache.
the class BlockletDataMapIndexStore method createBlockMetaInfo.
private BlockMetaInfo createBlockMetaInfo(String carbonDataFile) throws IOException {
CarbonFile carbonFile = FileFactory.getCarbonFile(carbonDataFile);
if (carbonFile instanceof AbstractDFSCarbonFile) {
RemoteIterator<LocatedFileStatus> iter = ((AbstractDFSCarbonFile) carbonFile).fs.listLocatedStatus(new Path(carbonDataFile));
LocatedFileStatus fileStatus = iter.next();
String[] location = fileStatus.getBlockLocations()[0].getHosts();
long len = fileStatus.getLen();
return new BlockMetaInfo(location, len);
} else {
return new BlockMetaInfo(new String[] { "localhost" }, carbonFile.getSize());
}
}
Aggregations