ReverseDictionaryCache extends AbstractDictionaryCache<K, V> { @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; } ReverseDictionaryCache(String carbonStorePath, CarbonLRUCache carbonLRUCache); @Override Dictionary get(DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier); @Override List<Dictionary> getAll(
      List<DictionaryColumnUniqueIdentifier> dictionaryColumnUniqueIdentifiers); @Override Dictionary getIfPresent(
      DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier); @Override void invalidate(
      DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier);  }
@Test public void getIfPresent() throws Exception { deleteStorePath(); String columnIdentifier = columnIdentifiers[0]; prepareWriterAndWriteData(dataSet1, columnIdentifier); DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier = createDictionaryColumnUniqueIdentifier(columnIdentifier); Dictionary reverseDictionary = (Dictionary) reverseDictionaryCache.get(dictionaryColumnUniqueIdentifier); assertTrue(null != reverseDictionary); reverseDictionary = (Dictionary) reverseDictionaryCache.getIfPresent(dictionaryColumnUniqueIdentifier); compareSurrogateKeyData(dataSet1, reverseDictionary); reverseDictionaryCache.invalidate(dictionaryColumnUniqueIdentifier); reverseDictionary = (Dictionary) reverseDictionaryCache.getIfPresent(dictionaryColumnUniqueIdentifier); assertTrue(null == reverseDictionary); }