Code example for MapMaker

0
  private static final Logger s_logger = LoggerFactory.getLogger(InMemoryViewExecutionCache.class);
 
  /** 
   * The buffer to hold compiled view definitions. 
   */ 
  private final Map<ViewExecutionCacheKey, CompiledViewDefinitionWithGraphs> _compiledViewDefinitions = new MapMaker().softValues().makeMap();
 
  @Override 
  public CompiledViewDefinitionWithGraphs getCompiledViewDefinitionWithGraphs(ViewExecutionCacheKey key) {
    CompiledViewDefinitionWithGraphs viewDefinition = _compiledViewDefinitions.get(key);
    if (s_logger.isDebugEnabled()) { 
      if (viewDefinition == null) {
        s_logger.debug("Cache miss CompiledViewDefinitionWithGraphs for {}", key);
      } else { 
        s_logger.debug("Cache hit CompiledViewDefinitionWithGraphs for {}", key);
      } 
    } 
    return viewDefinition;
  } 
 
Contextual code suggestions in your IDE  Get Codota for Java