private void initialFetchAndSchedule() {
    Runnable updater = () -> {
      try {
        long startTimeMs = System.currentTimeMillis();
        Map<String, Map<String, Long>> base = containerStorageUsageMonthlyBase;
        Map<String, Map<String, Long>> storageUsage =
            convertAggregatedAccountStorageStatsToMap(accountStatsStore.queryAggregatedAccountStorageStats(),
                config.usePhysicalStorage);
        if (storageUsage != null) {
          subtract(storageUsage, base);
          containerStorageUsageForCurrentMonthRef.set(storageUsage);
          if (listener.get() != null) {
            listener.get().onNewContainerStorageUsage(Collections.unmodifiableMap(storageUsage));
          }
          metrics.mysqlRefresherRefreshUsageTimeMs.update(System.currentTimeMillis() - startTimeMs);
        }
      } catch (Exception e) {
        logger.error("Failed to retrieve the container usage from mysql", e);
        // If we already have a container usage map in memory, then don't replace it with empty map.
        containerStorageUsageForCurrentMonthRef.compareAndSet(null, Collections.EMPTY_MAP);
      }
    };
    updater.run();

    if (scheduler != null) {
      int initialDelay = new Random().nextInt(config.refresherPollingIntervalMs + 1);
      scheduler.scheduleAtFixedRate(updater, initialDelay, config.refresherPollingIntervalMs, TimeUnit.MILLISECONDS);
      logger.info(
          "Background storage usage updater will fetch storage usage from remote starting {} ms from now and repeat with interval={} ms",
          initialDelay, config.refresherPollingIntervalMs);
    }
  }
Fetch the storage usage and schedule a task to periodically refresh the storage usage.
ambry-quota/src/main/java/com/github/ambry/quota/storage/MySqlStorageUsageRefresher.java