public synchronized void refreshPartitionByEvent(HivePartitionName hivePartitionName,
                                                     HiveCommonStats commonStats,
                                                     Partition partition) {
        Map<String, HiveColumnStats> columnStats = get(partitionStatsCache, hivePartitionName).getColumnStats();
        HivePartitionStats updatedPartitionStats = createPartitionStats(commonStats, columnStats);
        DatabaseTableName
                databaseTableName = DatabaseTableName.of(hivePartitionName.getDatabaseName(), hivePartitionName.getTableName());
        partitionKeysCache.asMap().keySet().stream().filter(hivePartitionValue -> hivePartitionValue.getHiveTableName().
                equals(databaseTableName)).forEach(partitionKeysCache::invalidate);
        partitionCache.put(hivePartitionName, partition);
        partitionStatsCache.put(hivePartitionName, updatedPartitionStats);
    }
@Test
    public void testRefreshPartitionByEvent() {
        CachingHiveMetastore cachingHiveMetastore = new CachingHiveMetastore(
                metastore, executor, expireAfterWriteSec, refreshAfterWriteSec, 1000, false);

        HiveCommonStats stats = new HiveCommonStats(10, 100);
        HivePartitionName hivePartitionName = HivePartitionName.of("db1", "unpartitioned_table", "col1=1");
        Partition partition = cachingHiveMetastore.getPartition(
                "db1", "unpartitioned_table", Lists.newArrayList("col1"));
        cachingHiveMetastore.refreshPartitionByEvent(hivePartitionName, stats, partition);
    }