Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26105

Rectify the expired TODO comment in CombinedBC

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      In the method getBlock in CombinedBC, there is a TODO comment as follows:

      @Override
        public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching,
            boolean repeat, boolean updateCacheMetrics) {
          // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock
          // we end up calling l2Cache.getBlock.
          // We are not in a position to exactly look at LRU cache or BC as BlockType may not be getting
          // passed always.
          boolean existInL1 = l1Cache.containsBlock(cacheKey);
          if (!existInL1 && updateCacheMetrics && !repeat) {
            // If the block does not exist in L1, the containsBlock should be counted as one miss.
            l1Cache.getStats().miss(caching, cacheKey.isPrimary(), cacheKey.getBlockType());
          }
          return existInL1 ?
              l1Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics):
              l2Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics);
        }
      

      The TODO comment is expired. While in CombinedBC, L2 is not the victim handler of L1.

      Attachments

        Activity

          People

            xytss123 Yutong Xiao
            xytss123 Yutong Xiao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: