@Override public BloomCacheKeyValue.CacheValue getIfPresent(BloomCacheKeyValue.CacheKey key) { return (BloomCacheKeyValue.CacheValue) lruCache.get(key.toString()); }
/** * returns the SegmentTaskIndexWrapper * * @param tableSegmentUniqueIdentifierWrapper * @return */ @Override public BlockletDataMapIndexWrapper getIfPresent( TableBlockIndexUniqueIdentifierWrapper tableSegmentUniqueIdentifierWrapper) { return (BlockletDataMapIndexWrapper) lruCache.get( tableSegmentUniqueIdentifierWrapper.getTableBlockIndexUniqueIdentifier() .getUniqueTableSegmentIdentifier()); }
/** * This method will check and create columnReverseDictionaryInfo object for the given column * * @param dictionaryColumnUniqueIdentifier * @param columnIdentifier * @return */ private ColumnReverseDictionaryInfo getColumnReverseDictionaryInfo( DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier, String columnIdentifier) { ColumnReverseDictionaryInfo columnReverseDictionaryInfo = (ColumnReverseDictionaryInfo) carbonLRUCache .get(getLruCacheKey(columnIdentifier, CacheType.REVERSE_DICTIONARY)); if (null == columnReverseDictionaryInfo) { synchronized (dictionaryColumnUniqueIdentifier) { columnReverseDictionaryInfo = (ColumnReverseDictionaryInfo) carbonLRUCache .get(getLruCacheKey(columnIdentifier, CacheType.REVERSE_DICTIONARY)); if (null == columnReverseDictionaryInfo) { columnReverseDictionaryInfo = new ColumnReverseDictionaryInfo(); } } } return columnReverseDictionaryInfo; }
/** * This method will check and create columnDictionaryInfo object for the given column * * @param dictionaryColumnUniqueIdentifier * @param columnIdentifier * @return */ private ColumnDictionaryInfo getColumnDictionaryInfo( DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier, String columnIdentifier) { ColumnDictionaryInfo columnDictionaryInfo = (ColumnDictionaryInfo) carbonLRUCache .get(getLruCacheKey(columnIdentifier, CacheType.FORWARD_DICTIONARY)); if (null == columnDictionaryInfo) { synchronized (dictionaryColumnUniqueIdentifier) { columnDictionaryInfo = (ColumnDictionaryInfo) carbonLRUCache .get(getLruCacheKey(columnIdentifier, CacheType.FORWARD_DICTIONARY)); if (null == columnDictionaryInfo) { columnDictionaryInfo = new ColumnDictionaryInfo(dictionaryColumnUniqueIdentifier.getDataType()); } } } return columnDictionaryInfo; }
/** * The method clears the access count of table segments * * @param tableSegmentUniqueIdentifiersWrapper */ @Override public void clearAccessCount( List<TableBlockIndexUniqueIdentifierWrapper> tableSegmentUniqueIdentifiersWrapper) { for (TableBlockIndexUniqueIdentifierWrapper identifierWrapper : tableSegmentUniqueIdentifiersWrapper) { BlockDataMap cacheable = (BlockDataMap) lruCache.get( identifierWrapper.getTableBlockIndexUniqueIdentifier().getUniqueTableSegmentIdentifier()); cacheable.clear(); } } }
@Override public void clearAccessCount(List<DictionaryColumnUniqueIdentifier> keys) { for (DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier : keys) { Dictionary cacheable = (Dictionary) carbonLRUCache.get( getLruCacheKey(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId(), CacheType.FORWARD_DICTIONARY)); cacheable.clear(); } }
@Override public void clearAccessCount(List<DictionaryColumnUniqueIdentifier> keys) { for (DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier : keys) { Dictionary cacheable = (Dictionary) carbonLRUCache.get( getLruCacheKey(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId(), CacheType.REVERSE_DICTIONARY)); cacheable.clear(); } }
/** * This method will return the value for the given key. It will not check and load * the data for the given key * * @param dictionaryColumnUniqueIdentifier unique identifier which contains dbName, * tableName and columnIdentifier * @return */ @Override public Dictionary getIfPresent( DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier) { Dictionary forwardDictionary = null; ColumnDictionaryInfo columnDictionaryInfo = (ColumnDictionaryInfo) carbonLRUCache.get( getLruCacheKey(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId(), CacheType.FORWARD_DICTIONARY)); if (null != columnDictionaryInfo) { forwardDictionary = new ForwardDictionary(columnDictionaryInfo); incrementDictionaryAccessCount(columnDictionaryInfo); } return forwardDictionary; }
/** * This method will return the value for the given key. It will not check and load * the data for the given key * * @param dictionaryColumnUniqueIdentifier unique identifier which contains dbName, * tableName and columnIdentifier * @return */ @Override public Dictionary getIfPresent( DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier) { Dictionary reverseDictionary = null; ColumnReverseDictionaryInfo columnReverseDictionaryInfo = (ColumnReverseDictionaryInfo) carbonLRUCache.get( getLruCacheKey(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId(), CacheType.REVERSE_DICTIONARY)); if (null != columnReverseDictionaryInfo) { reverseDictionary = new ReverseDictionary(columnReverseDictionaryInfo); incrementDictionaryAccessCount(columnReverseDictionaryInfo); } return reverseDictionary; }
String lruCacheKey = identifier.getUniqueTableSegmentIdentifier(); BlockletDataMapIndexWrapper blockletDataMapIndexWrapper = (BlockletDataMapIndexWrapper) lruCache.get(lruCacheKey); List<BlockDataMap> dataMaps = new ArrayList<>(); if (blockletDataMapIndexWrapper == null) {