public void alterPartitionAndStats(List<String> partVals, SharedCache sharedCache, long writeId,
        Map<String, String> parameters, List<ColumnStatisticsObj> colStatsObjs) {
      try {
        tableLock.writeLock().lock();
        PartitionWrapper partitionWrapper = partitionCache.get(CacheUtils.buildPartitionCacheKey(partVals));
        if (partitionWrapper == null) {
          LOG.info("Partition " + partVals + " is missing from cache. Cannot update the partition stats in cache.");
          return;
        }
        Partition newPart = partitionWrapper.getPartition();
        newPart.setParameters(parameters);
        newPart.setWriteId(writeId);
        removePartition(partVals, sharedCache);
        cachePartition(newPart, sharedCache);
        updatePartitionColStats(partVals, colStatsObjs);
      } finally {
        tableLock.writeLock().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