public ColumStatsWithWriteId getPartitionColStats(List<String> partVal, String colName, String writeIdList) {
      try {
        tableLock.readLock().lock();
        ColumnStatisticsObj statisticsObj =
            partitionColStatsCache.get(CacheUtils.buildPartitonColStatsCacheKey(partVal, colName));
        if (statisticsObj == null || writeIdList == null) {
          return new ColumStatsWithWriteId(-1, statisticsObj);
        }
        PartitionWrapper wrapper = partitionCache.get(CacheUtils.buildPartitionCacheKey(partVal));
        if (wrapper == null) {
          LOG.info("Partition: " + partVal + " is not present in the cache. Cannot update stats in cache.");
          return null;
        }
        long writeId = wrapper.getPartition().getWriteId();
        ValidWriteIdList list4TheQuery = ValidReaderWriteIdList.fromValue(writeIdList);
        // Just check if the write ID is valid. If it's valid (i.e. we are allowed to see it),
        // that means it cannot possibly be a concurrent write. If it's not valid (we are not
        // allowed to see it), that means it's either concurrent or aborted, same thing for us.
        if (!list4TheQuery.isWriteIdValid(writeId)) {
          LOG.debug("Write id list " + writeIdList + " is not compatible with write id " + writeId);
          return null;
        }
        return new ColumStatsWithWriteId(writeId, statisticsObj);
      } finally {
        tableLock.readLock().unlock();
      }
    }
Common method to refresh cache constraint
@param constraints list of constraints to update
@param mn Constraint type
@return Since memory constraint is handled by cache eviction policy.
Hence this method will always return true if correct constraint type passed.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java