public IcebergFindFiles asOfTime(long timestampMillis) {
    Preconditions.checkArgument(
        this.snapshotId == null,
        "Cannot set snapshot multiple times, already set to id=%s",
        snapshotId);

    Long lastSnapshotId = null;
    for (HistoryEntry logEntry : ops.current().snapshotLog()) {
      if (logEntry.timestampMillis() <= timestampMillis) {
        lastSnapshotId = logEntry.snapshotId();
      } else {
        // the last snapshot ID was the last one older than the timestamp
        break;
      }
    }

    // the snapshot ID could be null if no entries were older than the requested time. in that
    // case, there is no valid snapshot to read.
    Preconditions.checkArgument(
        lastSnapshotId != null,
        "Cannot find a snapshot older than %s",
        DateTimeUtil.formatTimestampMillis(timestampMillis));
    return inSnapshot(lastSnapshotId);
  }
Base results on files in the snapshot that was current as of a timestamp.

@param timestampMillis a timestamp in milliseconds
@return this for method chaining
amoro-format-iceberg/src/main/java/org/apache/iceberg/IcebergFindFiles.java