use of org.apache.carbondata.core.datastore.block.BlockletInfos in project carbondata by apache.
the class CarbonInputFormat method getTableBlockInfo.
/**
* Below method will be used to get the table block info
*
* @param job job context
* @param segmentId number of segment id
* @return list of table block
* @throws IOException
*/
private List<TableBlockInfo> getTableBlockInfo(JobContext job, TableSegmentUniqueIdentifier tableSegmentUniqueIdentifier, Set<SegmentTaskIndexStore.TaskBucketHolder> taskKeys, UpdateVO updateDetails, SegmentUpdateStatusManager updateStatusManager, String segmentId, Set<SegmentTaskIndexStore.TaskBucketHolder> validTaskKeys) throws IOException {
List<TableBlockInfo> tableBlockInfoList = new ArrayList<TableBlockInfo>();
// get file location of all files of given segment
JobContext newJob = new JobContextImpl(new Configuration(job.getConfiguration()), job.getJobID());
newJob.getConfiguration().set(CarbonInputFormat.INPUT_SEGMENT_NUMBERS, tableSegmentUniqueIdentifier.getSegmentId() + "");
// identify table blocks
for (InputSplit inputSplit : getSplitsInternal(newJob)) {
CarbonInputSplit carbonInputSplit = (CarbonInputSplit) inputSplit;
// then add as TableInfo object.
if (isValidBlockBasedOnUpdateDetails(taskKeys, carbonInputSplit, updateDetails, updateStatusManager, segmentId, validTaskKeys)) {
BlockletInfos blockletInfos = new BlockletInfos(carbonInputSplit.getNumberOfBlocklets(), 0, carbonInputSplit.getNumberOfBlocklets());
tableBlockInfoList.add(new TableBlockInfo(carbonInputSplit.getPath().toString(), carbonInputSplit.getStart(), tableSegmentUniqueIdentifier.getSegmentId(), carbonInputSplit.getLocations(), carbonInputSplit.getLength(), blockletInfos, carbonInputSplit.getVersion(), carbonInputSplit.getBlockStorageIdMap()));
}
}
return tableBlockInfoList;
}
use of org.apache.carbondata.core.datastore.block.BlockletInfos in project carbondata by apache.
the class InMemoryBTreeIndex method getTableBlockInfo.
/**
* Below method will be used to get the table block info
*
* @param job job context
* @return list of table block
* @throws IOException
*/
private List<TableBlockInfo> getTableBlockInfo(JobContext job) throws IOException {
List<TableBlockInfo> tableBlockInfoList = new ArrayList<>();
// identify table blocks from all file locations of given segment
for (InputSplit inputSplit : segment.getAllSplits(job)) {
CarbonInputSplit carbonInputSplit = (CarbonInputSplit) inputSplit;
BlockletInfos blockletInfos = new BlockletInfos(carbonInputSplit.getNumberOfBlocklets(), 0, carbonInputSplit.getNumberOfBlocklets());
tableBlockInfoList.add(new TableBlockInfo(carbonInputSplit.getPath().toString(), carbonInputSplit.getStart(), segment.getId(), carbonInputSplit.getLocations(), carbonInputSplit.getLength(), blockletInfos, carbonInputSplit.getVersion()));
}
return tableBlockInfoList;
}
Aggregations