Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track INPUT_FILE_LAST_MODIFIED operations in TrackingFileSystemFactory #19406

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import static com.google.common.base.Verify.verify;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_EXISTS;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_GET_LENGTH;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_LAST_MODIFIED;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_NEW_STREAM;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.OUTPUT_FILE_CREATE;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.OUTPUT_FILE_CREATE_EXCLUSIVE;
Expand All @@ -50,6 +51,7 @@ public enum OperationType
OUTPUT_FILE_CREATE_OR_OVERWRITE,
OUTPUT_FILE_CREATE_EXCLUSIVE,
OUTPUT_FILE_TO_INPUT_FILE,
INPUT_FILE_LAST_MODIFIED,
}

private final AtomicInteger fileId = new AtomicInteger();
Expand Down Expand Up @@ -251,6 +253,7 @@ public boolean exists()
public Instant lastModified()
throws IOException
{
tracker.accept(INPUT_FILE_LAST_MODIFIED);
return delegate.lastModified();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import static com.google.inject.multibindings.OptionalBinder.newOptionalBinder;
import static io.trino.SystemSessionProperties.MIN_INPUT_SIZE_PER_TASK;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_GET_LENGTH;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_LAST_MODIFIED;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.INPUT_FILE_NEW_STREAM;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.OUTPUT_FILE_CREATE;
import static io.trino.filesystem.TrackingFileSystemFactory.OperationType.OUTPUT_FILE_CREATE_OR_OVERWRITE;
Expand Down Expand Up @@ -276,6 +277,7 @@ public void testReadWholePartition()
.add(new FileOperation(SNAPSHOT, INPUT_FILE_GET_LENGTH))
.add(new FileOperation(SNAPSHOT, INPUT_FILE_NEW_STREAM))
.addCopies(new FileOperation(DATA, INPUT_FILE_NEW_STREAM), 4)
.addCopies(new FileOperation(DATA, INPUT_FILE_LAST_MODIFIED), 4)
.build());

assertUpdate("DROP TABLE test_read_part_key");
Expand Down
Loading