@VisibleForTesting
  static void enqueueRestore(String jobName, String jobId, String taskName, String storeName, File storeDir, DirIndex dirIndex,
      long storeRestoreStartTime, List<CompletionStage<Void>> restoreFutures, BlobStoreUtil blobStoreUtil,
      DirDiffUtil dirDiffUtil, BlobStoreRestoreManagerMetrics metrics, ExecutorService executor, boolean getDeleted,
      boolean compareFileOwners) {

    Metadata requestMetadata = new Metadata(storeDir.getAbsolutePath(), Optional.empty(), jobName, jobId, taskName, storeName);
    CompletableFuture<Void> restoreFuture =
        blobStoreUtil.restoreDir(storeDir, dirIndex, requestMetadata, getDeleted).thenRunAsync(() -> {
          metrics.storeRestoreNs.get(storeName).set(System.nanoTime() - storeRestoreStartTime);

          long postRestoreStartTime = System.nanoTime();
          LOG.trace(
              "Comparing restored store directory: {} and remote directory to verify restore with compareFileOwners set to: {}",
              storeDir, compareFileOwners);
          if (!dirDiffUtil.areSameDir(FILES_TO_IGNORE, true, compareFileOwners).test(storeDir, dirIndex)) {
            metrics.storePostRestoreNs.get(storeName).set(System.nanoTime() - postRestoreStartTime);
            throw new SamzaException(
                String.format("Restored store directory: %s contents " + "are not the same as the remote snapshot.",
                    storeDir.getAbsolutePath()));
          } else {
            metrics.storePostRestoreNs.get(storeName).set(System.nanoTime() - postRestoreStartTime);
            LOG.info("Restore from remote snapshot completed for store: {} with getDeleted set to {}", storeDir, getDeleted);
          }
        }, executor);

    restoreFutures.add(restoreFuture);
  }
Starts the restore for the store, enqueuing all restore-completion futures into {@param restoreFutures}.
samza-core/src/main/java/org/apache/samza/storage/blobstore/BlobStoreRestoreManager.java