presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/RecordingHiveMetastore.java/RecordingHiveMetastore/RecordingHiveMetastore
class RecordingHiveMetastore:    @Inject
    public RecordingHiveMetastore(@ForRecordingHiveMetastore HiveMetastore delegate, HiveConfig hiveConfig)
            throws IOException
    {
        this.delegate = requireNonNull(delegate, "delegate is null");
        requireNonNull(hiveConfig, "hiveConfig is null");
        this.recordingPath = Paths.get(requireNonNull(hiveConfig.getRecordingPath(), "recordingPath is null"));
        this.replay = hiveConfig.isReplay();

        databaseCache = createCache(hiveConfig);
        tableCache = createCache(hiveConfig);
        supportedColumnStatisticsCache = createCache(hiveConfig);
        tableStatisticsCache = createCache(hiveConfig);
        partitionStatisticsCache = createCache(hiveConfig);
        allTablesCache = createCache(hiveConfig);
        tablesWithParameterCache = createCache(hiveConfig);
        allViewsCache = createCache(hiveConfig);
        partitionCache = createCache(hiveConfig);
        partitionNamesCache = createCache(hiveConfig);
        partitionNamesByPartsCache = createCache(hiveConfig);
        partitionsByNamesCache = createCache(hiveConfig);
        tablePrivilegesCache = createCache(hiveConfig);
        roleGrantsCache = createCache(hiveConfig);

        if (replay) {
            loadRecording();
        }
    }