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

Cleanup #20825

Merged
merged 4 commits into from
Feb 23, 2024
Merged

Cleanup #20825

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 @@ -37,8 +37,8 @@
public class GcsOutputFile
implements TrinoOutputFile
{
private static final Storage.BlobTargetOption[] DOES_NOT_EXIST_TARGET_OPTION = {Storage.BlobTargetOption.doesNotExist()};
private static final Storage.BlobTargetOption[] EMPTY_TARGET_OPTIONS = {};
private static final BlobTargetOption[] DOES_NOT_EXIST_TARGET_OPTION = {BlobTargetOption.doesNotExist()};
private static final BlobTargetOption[] EMPTY_TARGET_OPTIONS = {};

private final GcsLocation location;
private final Storage storage;
Expand Down Expand Up @@ -100,7 +100,7 @@ private OutputStream createOutputStream(AggregatedMemoryContext memoryContext, b
try {
BlobTargetOption[] blobTargetOptions = EMPTY_TARGET_OPTIONS;
if (!overwrite) {
if (!getBlob(storage, location).isEmpty()) {
if (getBlob(storage, location).isPresent()) {
throw new FileAlreadyExistsException("File %s already exists".formatted(location));
}
blobTargetOptions = DOES_NOT_EXIST_TARGET_OPTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void testExplicitPropertyMappings()
.put("gcs.json-key", "{}")
.put("gcs.json-key-file-path", jsonKeyFile.toString())
.put("gcs.client.max-retries", "10")
.put("gcs.client.backoff-scale-factor", "3.0")
.put("gcs.client.backoff-scale-factor", "4.0")
.put("gcs.client.max-retry-time", "10s")
.put("gcs.client.min-backoff-delay", "20ms")
.put("gcs.client.max-backoff-delay", "20ms")
Expand All @@ -86,7 +86,7 @@ void testExplicitPropertyMappings()
.setJsonKey("{}")
.setJsonKeyFilePath(jsonKeyFile.toString())
.setMaxRetries(10)
.setBackoffScaleFactor(3.0)
.setBackoffScaleFactor(4.0)
.setMaxRetryTime(new Duration(10, SECONDS))
.setMinBackoffDelay(new Duration(20, MILLISECONDS))
.setMaxBackoffDelay(new Duration(20, MILLISECONDS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public interface TrinoFileSystem

/**
* Deletes the specified file. The file location path cannot be empty, and must not end with
* a slash or whitespace. If the file is a director, an exception is raised. If the file does
* a slash or whitespace. If the file is a directory, an exception is raised. If the file does
* not exist, this method is a noop.
*
* @throws IllegalArgumentException if location is not valid for this file system
Expand Down
Loading