@Override
  public boolean equals(Object o) {
    if (this == o) return true;

    if (o == null || getClass() != o.getClass()) return false;

    DirDiff dirDiff = (DirDiff) o;

    return new EqualsBuilder()
        .append(getDirName(), dirDiff.getDirName())
        .append(getFilesAdded(), dirDiff.getFilesAdded())
        .append(getFilesRetained(), dirDiff.getFilesRetained())
        .append(getFilesRemoved(), dirDiff.getFilesRemoved())
        .append(getSubDirsAdded(), dirDiff.getSubDirsAdded())
        .append(getSubDirsRetained(), dirDiff.getSubDirsRetained())
        .append(getSubDirsRemoved(), dirDiff.getSubDirsRemoved())
        .isEquals();
  }
Subdirectories that are already present in the previous snapshot, but don't exist in the local snapshot,
and hence all of their contents need to be recursively removed.
samza-core/src/main/java/org/apache/samza/storage/blobstore/diff/DirDiff.java