private static void addFilesAndBlobsForSubDirRemoved(DirIndex dirIndex,
      Set<FileIndex> filesRemoved,
      Set<FileBlob> blobsRemoved) {
    for (FileIndex filePresent: dirIndex.getFilesPresent()) {
      filesRemoved.add(filePresent);
      blobsRemoved.addAll(filePresent.getBlobs());
    }

    for (FileIndex fileRemoved: dirIndex.getFilesRemoved()) {
      filesRemoved.add(fileRemoved);
      blobsRemoved.addAll(fileRemoved.getBlobs());
    }

    for (DirIndex subDir: dirIndex.getSubDirsPresent()) {
      addFilesAndBlobsForSubDirRemoved(subDir, filesRemoved, blobsRemoved);
    }
  }
Representation of a directory in the blob store
samza-core/src/main/java/org/apache/samza/storage/blobstore/index/DirIndex.java