code: void attachMetadataCacheInternal(SlotReference slot, MetadataCache cache) {
          MetadataCache oldCache = metadataCacheFiles.put(slot, cache);
          if (oldCache != null) {
              try {
                  oldCache.close();
              } catch (IOException e) {
                  logger.error("Problem closing previous metadata cache", e);
              }
          }
  
          deliverCacheUpdate(slot, cache);
      }
docs: Finishes the process of attaching a metadata cache file once it has been opened and validated.
  
  @param slot the slot to which the cache should be attached
  @param cache the opened, validated metadata cache file