Skip to content

Rename S3 Filesystem config socket-read-timeout to socket-timeout #26263

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

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
6 changes: 3 additions & 3 deletions docs/src/main/sphinx/object-storage/file-system-s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ support:
* - `s3.socket-connect-timeout`
- Maximum time [duration](prop-type-duration) allowed for socket connection
requests to complete before timing out.
* - `s3.socket-read-timeout`
- Maximum time [duration](prop-type-duration) for socket read operations
* - `s3.socket-timeout`
- Maximum time [duration](prop-type-duration) for socket read/write operations
before timing out.
* - `s3.tcp-keep-alive`
- Enable TCP keep alive on created connections. Defaults to `false`.
Expand Down Expand Up @@ -383,7 +383,7 @@ the following edits to your catalog configuration:
- Also see `s3.connection-max-idle-time` in preceding section for more
connection keep-alive options.
* - `hive.s3.socket-timeout`
- `s3.socket-read-timeout`
- `s3.socket-timeout`
- Also see `s3.tcp-keep-alive` in preceding sections for more socket
connection keep-alive options.
* - `hive.s3.max-connections`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.airlift.configuration.Config;
import io.airlift.configuration.ConfigDescription;
import io.airlift.configuration.ConfigSecuritySensitive;
import io.airlift.configuration.LegacyConfig;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import io.airlift.units.MaxDataSize;
Expand Down Expand Up @@ -163,7 +164,7 @@ public static RetryStrategy getRetryStrategy(RetryMode retryMode)
private Duration connectionTtl;
private Duration connectionMaxIdleTime;
private Duration socketConnectTimeout;
private Duration socketReadTimeout;
private Duration socketTimeout;
private boolean tcpKeepAlive;
private HostAndPort httpProxy;
private boolean httpProxySecure;
Expand Down Expand Up @@ -511,16 +512,17 @@ public S3FileSystemConfig setSocketConnectTimeout(Duration socketConnectTimeout)
return this;
}

public Optional<Duration> getSocketReadTimeout()
public Optional<Duration> getSocketTimeout()
{
return Optional.ofNullable(socketReadTimeout);
return Optional.ofNullable(socketTimeout);
}

@Config("s3.socket-read-timeout")
@ConfigDescription("Maximum time allowed for socket reads before timing out")
public S3FileSystemConfig setSocketReadTimeout(Duration socketReadTimeout)
@LegacyConfig("s3.socket-read-timeout")
@Config("s3.socket-timeout")
@ConfigDescription("Maximum time allowed for socket reads/writes before timing out")
public S3FileSystemConfig setSocketTimeout(Duration socketTimeout)
{
this.socketReadTimeout = socketReadTimeout;
this.socketTimeout = socketTimeout;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private static SdkHttpClient createHttpClient(S3FileSystemConfig config)
config.getConnectionTtl().ifPresent(ttl -> client.connectionTimeToLive(ttl.toJavaTime()));
config.getConnectionMaxIdleTime().ifPresent(time -> client.connectionMaxIdleTime(time.toJavaTime()));
config.getSocketConnectTimeout().ifPresent(timeout -> client.connectionTimeout(timeout.toJavaTime()));
config.getSocketReadTimeout().ifPresent(timeout -> client.socketTimeout(timeout.toJavaTime()));
config.getSocketTimeout().ifPresent(timeout -> client.socketTimeout(timeout.toJavaTime()));

if (config.getHttpProxy() != null) {
client.proxyConfiguration(ProxyConfiguration.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void testDefaults()
.setConnectionTtl(null)
.setConnectionMaxIdleTime(null)
.setSocketConnectTimeout(null)
.setSocketReadTimeout(null)
.setSocketTimeout(null)
.setTcpKeepAlive(false)
.setHttpProxy(null)
.setHttpProxySecure(false)
Expand Down Expand Up @@ -109,7 +109,7 @@ public void testExplicitPropertyMappings()
.put("s3.connection-ttl", "1m")
.put("s3.connection-max-idle-time", "2m")
.put("s3.socket-connect-timeout", "3m")
.put("s3.socket-read-timeout", "4m")
.put("s3.socket-timeout", "4m")
.put("s3.tcp-keep-alive", "true")
.put("s3.http-proxy", "localhost:8888")
.put("s3.http-proxy.secure", "true")
Expand Down Expand Up @@ -148,7 +148,7 @@ public void testExplicitPropertyMappings()
.setConnectionTtl(new Duration(1, MINUTES))
.setConnectionMaxIdleTime(new Duration(2, MINUTES))
.setSocketConnectTimeout(new Duration(3, MINUTES))
.setSocketReadTimeout(new Duration(4, MINUTES))
.setSocketTimeout(new Duration(4, MINUTES))
.setTcpKeepAlive(true)
.setHttpProxy(HostAndPort.fromParts("localhost", 8888))
.setHttpProxySecure(true)
Expand Down