/** * This method will get the value for the given key. If value does not exist * for the given key, it will check and load the value. * * @param key * @return * @throws IOException in case memory is not sufficient to load data into memory */ public V get(K key) throws IOException { V value = cache.get(key); if (value != null) { segmentSet.add(key); } return value; }
public static Dictionary getDictionary(DictionaryColumnUniqueIdentifier columnIdentifier) throws IOException { Cache<DictionaryColumnUniqueIdentifier, Dictionary> dictCache = CacheProvider.getInstance().createCache(CacheType.REVERSE_DICTIONARY); return dictCache.get(columnIdentifier); }
private ExtendedBlocklet getExtendedBlocklet( Set<TableBlockIndexUniqueIdentifierWrapper> identifiersWrapper, Blocklet blocklet) throws IOException { for (TableBlockIndexUniqueIdentifierWrapper identifierWrapper : identifiersWrapper) { BlockletDataMapIndexWrapper wrapper = cache.get(identifierWrapper); List<BlockDataMap> dataMaps = wrapper.getDataMaps(); for (DataMap dataMap : dataMaps) { if (((BlockDataMap) dataMap) .getTableTaskInfo(BlockletDataMapRowIndexes.SUMMARY_INDEX_FILE_NAME) .startsWith(blocklet.getFilePath())) { return ((BlockDataMap) dataMap).getDetailedBlocklet(blocklet.getBlockletId()); } } } throw new IOException("Blocklet not found: " + blocklet.toString()); }
BloomCacheKeyValue.CacheValue cacheValue = cache.get(cacheKey); List<CarbonBloomFilter> bloomIndexList = cacheValue.getBloomFilters(); for (CarbonBloomFilter bloomFilter : bloomIndexList) {
Cache<DictionaryColumnUniqueIdentifier, Dictionary> dictCache = CacheProvider.getInstance() .createCache(CacheType.REVERSE_DICTIONARY); dictionary = dictCache.get(identifier);
Dictionary dict = (Dictionary) dictCache.get( new DictionaryColumnUniqueIdentifier(absoluteTableIdentifier, columnIdentifier, dims.get(i).getDataType()));
cacheProvider.createCache(CacheType.FORWARD_DICTIONARY); return forwardDictionaryCache.get(dictionaryColumnUniqueIdentifier);
/** * This initialization is done inside executor task * for column dictionary involved in decoding. * * @param carbonColumns column list * @param carbonTable table identifier */ @Override public void initialize(CarbonColumn[] carbonColumns, CarbonTable carbonTable) throws IOException { this.carbonColumns = carbonColumns; dictionaries = new Dictionary[carbonColumns.length]; dataTypes = new DataType[carbonColumns.length]; for (int i = 0; i < carbonColumns.length; i++) { if (carbonColumns[i].hasEncoding(Encoding.DICTIONARY) && !carbonColumns[i] .hasEncoding(Encoding.DIRECT_DICTIONARY) && !carbonColumns[i].isComplex()) { CacheProvider cacheProvider = CacheProvider.getInstance(); Cache<DictionaryColumnUniqueIdentifier, Dictionary> forwardDictionaryCache = cacheProvider .createCache(CacheType.FORWARD_DICTIONARY); dataTypes[i] = carbonColumns[i].getDataType(); String dictionaryPath = carbonTable.getTableInfo().getFactTable().getTableProperties() .get(CarbonCommonConstants.DICTIONARY_PATH); dictionaries[i] = forwardDictionaryCache.get(new DictionaryColumnUniqueIdentifier( carbonTable.getAbsoluteTableIdentifier(), carbonColumns[i].getColumnIdentifier(), dataTypes[i], dictionaryPath)); } else { dataTypes[i] = carbonColumns[i].getDataType(); } } }
new DictionaryColumnUniqueIdentifier(carbontable.getAbsoluteTableIdentifier(), child.getColumnIdentifier(), child.getDataType(), dictionaryPath); dictionary = cache.get(dictionarIdentifier);