/** * Returns default blocklet datamap * @param carbonTable * @param resolverIntf * @return */ public static DataMapExprWrapper getDefaultDataMap(CarbonTable carbonTable, FilterResolverIntf resolverIntf) { // Return the default datamap if no other datamap exists. return new DataMapExprWrapperImpl( DataMapStoreManager.getInstance().getDefaultDataMap(carbonTable), resolverIntf); }
/** * After updating table status file clear the dataMap cache for all segmentId's on which * dataMap is being created because flows like merge index file creation involves modification of * segment file and once segment file is modified the cache for that segment need to be cleared * otherwise the old cache will be used which is stale * * @param carbonTable * @param segmentId */ public static void clearBlockDataMapCache(CarbonTable carbonTable, String segmentId) { TableDataMap defaultDataMap = DataMapStoreManager.getInstance().getDefaultDataMap(carbonTable); Segment segment = new Segment(segmentId); List<Segment> segments = new ArrayList<>(); segments.add(segment); LOGGER.info( "clearing cache while updating segment file entry in table status file for segmentId: " + segmentId); defaultDataMap.clear(segments); }
/** * Clear the invalid segments from all the datamaps of the table * @param carbonTable * @param segments */ public void clearInvalidSegments(CarbonTable carbonTable, List<Segment> segments) throws IOException { getDefaultDataMap(carbonTable).clear(segments); List<TableDataMap> allDataMap = getAllDataMap(carbonTable); for (TableDataMap dataMap: allDataMap) { dataMap.clear(segments); } }
/** * Return a chosen datamap based on input filter. See {@link DataMapChooser} */ public DataMapExprWrapper choose(FilterResolverIntf filter) { if (filter != null) { Expression expression = filter.getFilterExpression(); // First check for FG datamaps if any exist ExpressionTuple tuple = selectDataMap(expression, fgDataMaps, filter); if (tuple.dataMapExprWrapper == null) { // Check for CG datamap tuple = selectDataMap(expression, cgDataMaps, filter); } if (tuple.dataMapExprWrapper != null) { return tuple.dataMapExprWrapper; } } // Return the default datamap if no other datamap exists. return new DataMapExprWrapperImpl( DataMapStoreManager.getInstance().getDefaultDataMap(carbonTable), filter); }
TableDataMap blockletMap = DataMapStoreManager.getInstance().getDefaultDataMap(table);
List<PartitionSpec> partitionsToPrune = getPartitionsToPrune(job.getConfiguration()); TableDataMap defaultDataMap = DataMapStoreManager.getInstance().getDefaultDataMap(carbonTable); List<ExtendedBlocklet> prunedBlocklets = null;