pub fn create_remote_store_client(
url: String,
remote_store_options: Vec<(String, String)>,
request_timeout_secs: u64,
) -> IngestionResult<Box<dyn ObjectStore>>
Expand description
Creates a remote store client without any retry mechanism.
This function constructs a remote store client configured to not retry
failed requests. All requests will fail immediately if the underlying
operation encounters an error. This is a convenience wrapper around
create_remote_store_client_with_ops
that sets the retry configuration
to disable retries.
§Arguments
url
: The URL of the remote store. The scheme of the URL determines the storage provider:http://
orhttps://
: HTTP-based store.gs://
: Google Cloud Storage.s3://
or other AWS S3-compatible URL: Amazon S3.
remote_store_options
: A vector of key-value pairs representing provider-specific options.- For GCS: See [
object_store::gcp::GoogleConfigKey
] for valid keys. - For S3: See [
object_store::aws::AmazonS3ConfigKey
] for valid keys. - For HTTP: No options are currently supported. This parameter should be empty.
- For GCS: See [
request_timeout_secs
: The timeout duration (in seconds) for individual requests. This timeout is used to set a slightly longer retry timeout (request_timeout_secs + 1) internally, even though retries are disabled. This is done to ensure that the overall operation doesn’t hang indefinitely.
§Examples
Creating an S3 client without retries:
use object_store::aws::AmazonS3ConfigKey;
let url = "s3://my-bucket";
let options = vec![(
AmazonS3ConfigKey::Region.as_ref().to_owned(),
"us-east-1".to_string(),
)];
let client = create_remote_store_client(url.to_string(), options, 30).unwrap();
Creating a GCS client without retries:
use object_store::gcp::GoogleConfigKey;
let url = "gs://my-bucket";
let options = vec![(
GoogleConfigKey::ServiceAccount.as_ref().to_owned(),
"my-service-account".to_string(),
)];
let client = create_remote_store_client(url.to_string(), options, 30).unwrap();
Creating an HTTP client without retries (no options supported):
let url = "http://example.bucket.com";
let options = vec![]; // No options for HTTP
let client = create_remote_store_client(url.to_string(), options, 30).unwrap();