public List<ColumnStatistics> getPartColStatsList(List<String> partNames, List<String> colNames, String writeIdList,
        boolean txnStatSupported) throws MetaException {
      List<ColumnStatistics> colStatObjs = new ArrayList<>();
      try {
        tableLock.readLock().lock();
        Table tbl = getTable();
        for (String partName : partNames) {
          ColumnStatisticsDesc csd = new ColumnStatisticsDesc(false, tbl.getDbName(), tbl.getTableName());
          csd.setCatName(tbl.getCatName());
          csd.setPartName(partName);
          csd.setLastAnalyzed(0); //TODO : Need to get last analysed. This is not being used by anybody now.
          List<ColumnStatisticsObj> statObject = new ArrayList<>();
          List<String> partVal = Warehouse.getPartValuesFromPartName(partName);
          for (String colName : colNames) {
            ColumnStatisticsObj statisticsObj =
                partitionColStatsCache.get(CacheUtils.buildPartitonColStatsCacheKey(partVal, colName));
            if (statisticsObj != null) {
              statObject.add(statisticsObj);
            } else {
              LOG.info("Stats not available in cachedStore for col " + colName + " in partition " + partVal);
              return null;
            }
          }
          ColumnStatistics columnStatistics = new ColumnStatistics(csd, statObject);
          columnStatistics.setEngine(CacheUtils.HIVE_ENGINE);
          if (writeIdList != null && TxnUtils.isTransactionalTable(getParameters())) {
            columnStatistics.setIsStatsCompliant(true);
            if (!txnStatSupported) {
              columnStatistics.setIsStatsCompliant(false);
            } else {
              PartitionWrapper wrapper = partitionCache.get(CacheUtils.buildPartitionCacheKey(partVal));
              if (wrapper == null) {
                columnStatistics.setIsStatsCompliant(false);
              } else {
                Partition partition = wrapper.getPartition();
                if (!ObjectStore
                    .isCurrentStatsValidForTheQuery(partition.getParameters(), partition.getWriteId(), writeIdList,
                        false)) {
                  LOG.debug("The current cached store transactional partition column statistics for {}.{}.{} "
                          + "(write ID {}) are not valid for current query ({})", tbl.getDbName(), tbl.getTableName(),
                      partName, partition.getWriteId(), writeIdList);
                  columnStatistics.setIsStatsCompliant(false);
                }
              }
            }
          }
          colStatObjs.add(columnStatistics);
        }
      } finally {
        tableLock.readLock().unlock();
      }
      return colStatObjs;
    }
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