Skip to content

Commit

Permalink
Updates from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
AlSpinks committed Mar 3, 2025
1 parent 09544e2 commit b37f6f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ public Duration readTimeout() {

/**
* The amount of time to wait when writing a fragment before giving up and timing out. This is accomplished through
* calling the {@link software.amazon.awssdk.core.RequestOverrideConfiguration.Builder#apiCallTimeout(java.time.Duration)}
* calling the
* {@link software.amazon.awssdk.core.RequestOverrideConfiguration.Builder#apiCallTimeout(java.time.Duration)}
* method to time out api calls.
*/
public abstract Optional<Duration> writeTimeout();
public abstract Optional<Duration> writeTimeout();

/**
* The credentials to use when reading or writing to S3. By default, uses {@link Credentials#resolving()}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ void readWriteTestExpectWriteTimeout() throws IOException {
final Throwable cause = e.getCause();
assertThat(cause.getClass().equals(ExecutionException.class)).isEqualTo(true);
final String s = cause.getMessage();
assertThat(s.contains("Client execution did not complete before the specified timeout configuration")).isEqualTo(true);
assertThat(s.contains("Client execution did not complete before the specified timeout configuration"))
.isEqualTo(true);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.deephaven.extensions.s3.S3Instructions;
import io.deephaven.extensions.s3.S3SeekableChannelProviderPlugin;
import io.deephaven.util.channel.SeekableChannelsProvider;
import org.jetbrains.annotations.Nullable;
import software.amazon.awssdk.core.async.AsyncRequestBody;
import software.amazon.awssdk.services.s3.S3AsyncClient;
import software.amazon.awssdk.services.s3.model.CreateBucketRequest;
Expand Down Expand Up @@ -71,14 +72,15 @@ protected final void putObject(String key, AsyncRequestBody body)
}

protected final SeekableChannelsProvider providerImpl() {
final S3SeekableChannelProviderPlugin plugin = new S3SeekableChannelProviderPlugin();
final S3Instructions instructions = s3Instructions(S3Instructions.builder()).build();
return plugin.createProvider(SCHEME, instructions);
return providerImpl(null);
}

protected final SeekableChannelsProvider providerImpl(final S3Instructions.Builder s3InstructionsBuilder) {
protected final SeekableChannelsProvider providerImpl(
@Nullable final S3Instructions.Builder s3InstructionsBuilder) {
final S3SeekableChannelProviderPlugin plugin = new S3SeekableChannelProviderPlugin();
final S3Instructions instructions = s3Instructions(s3InstructionsBuilder).build();
final S3Instructions instructions =
s3Instructions(s3InstructionsBuilder == null ? S3Instructions.builder() : s3InstructionsBuilder)
.build();
return plugin.createProvider(SCHEME, instructions);
}

Expand Down
3 changes: 2 additions & 1 deletion py/server/deephaven/experimental/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def __init__(self,
"PT1s", or other time duration types. Default to 2 seconds.
write_timeout (DurationLike): the amount of time to wait when writing a fragment before giving up and timing
out. Can be expressed as an integer in nanoseconds, a time interval string, e.g. "PT00:00:00.001" or
"PT1s", or other time duration types. Default to 2 seconds.
"PT1s", or other time duration types. This value is a Java Optional and must be tested as such.
If not set then the Optional is empty.
access_key_id (str): (Deprecated) the access key for reading files. Both access key and secret access key
must be provided to use static credentials. If you specify both access key and secret key, then you
cannot provide other credentials like setting anonymous_access or credentials argument.
Expand Down

0 comments on commit b37f6f3

Please sign in to comment.