@Override
    public boolean alreadyExists(PersistentIndex idx, FileSpan searchSpan, StoreKey key, IndexValue srcValue)
        throws StoreException {
      IndexValue value = idx.findKey(key, searchSpan, EnumSet.allOf(PersistentIndex.IndexEntryType.class));
      boolean exists = false;
      if (value != null) {
        numKeysFoundInDuplicateChecking++;
        if (value.isDelete()) {
          exists = true;
        } else if (value.isTtlUpdate()) {
          // if srcValue is not a delete, it is a duplicate.
          exists = !srcValue.isDelete();
        } else {
          // value is a PUT without a TTL update or a DELETE
          exists = !srcValue.isDelete() && !srcValue.isTtlUpdate();
        }
      }
      return exists;
    }
@param key the {@link StoreKey} to check
@param searchStartOffset the start offset of the search for delete entry
@param deleteReferenceTime the timestamp to reference when deciding a delete is out of retention
@return {@code true} if the key has a delete entry that is out of retention
@throws StoreException if there are any problems using the index
ambry-store/src/main/java/com/github/ambry/store/BlobStoreCompactor.java