Skip to content
Open
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
12 changes: 12 additions & 0 deletions velox/connectors/hive/storage_adapters/s3fs/S3Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class S3Config {
kUseProxyFromEnv,
kCredentialsProvider,
kIMDSEnabled,
kExecutorPoolSize,
kEnd
};

Expand Down Expand Up @@ -116,6 +117,8 @@ class S3Config {
{Keys::kCredentialsProvider,
std::make_pair("aws-credentials-provider", std::nullopt)},
{Keys::kIMDSEnabled, std::make_pair("aws-imds-enabled", "true")},
{Keys::kExecutorPoolSize,
std::make_pair("executor-pool-size", std::nullopt)},
};
return config;
}
Expand Down Expand Up @@ -251,6 +254,15 @@ class S3Config {
return folly::to<bool>(value);
}

/// Executor pool size for async operations.
std::optional<uint32_t> executorPoolSize() const {
auto val = config_.find(Keys::kExecutorPoolSize)->second;
if (val.has_value()) {
return folly::to<uint32_t>(val.value());
}
return std::optional<uint32_t>();
}

private:
std::unordered_map<Keys, std::optional<std::string>> config_;
std::string payloadSigningPolicy_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/client/AdaptiveRetryStrategy.h>
#include <aws/core/client/DefaultRetryStrategy.h>
#include <aws/core/utils/threading/PooledThreadExecutor.h>
#include <aws/identity-management/auth/STSAssumeRoleCredentialsProvider.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/CopyObjectRequest.h>
Expand Down Expand Up @@ -299,6 +300,9 @@ class S3FileSystem::Impl {
inferPayloadSign(s3Config.payloadSigningPolicy());

auto credentialsProvider = getCredentialsProvider(s3Config);
if (s3Config.executorPoolSize().has_value() && s3Config.executorPoolSize().value()>0) {
clientConfig.executor = Aws::MakeShared<Aws::Utils::Threading::PooledThreadExecutor>(nullptr, s3Config.executorPoolSize().value());
}

client_ = std::make_shared<Aws::S3::S3Client>(
credentialsProvider, nullptr /* endpointProvider */, clientConfig);
Expand Down
4 changes: 4 additions & 0 deletions velox/docs/configs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,10 @@ Each query can override the config by setting corresponding query session proper
- true
- AWS Instance Metadata Service (IMDS) is an AWS EC2 instance component used by applications to securely access metadata.
We must disable it on other instances to avoid high first-time read latency from S3 compatible object storages.
* - hive.s3.executor-pool-size
- integer
-
- Define the executor size in the AWS thread pool which is used to perform S3 requests. 0 means disabled.

Bucket Level Configuration
""""""""""""""""""""""""""
Expand Down