Class S3Source.Builder
java.lang.Object
dev.hardwood.s3.S3Source.Builder
- Enclosing class:
S3Source
-
Method Summary
Modifier and TypeMethodDescriptionSends requests unsigned, for buckets that allow public read access.build()Builds theS3Source.connectTimeout(Duration connectTimeout) Sets the connect timeout for the HTTP client (default 10 seconds).credentials(S3Credentials credentials) Sets static credentials (convenience shorthand).credentials(S3CredentialsProvider provider) Sets the credential provider.Sets the endpoint for S3-compatible services (e.g. MinIO, R2, GCP).httpClient(HttpClient httpClient) Sets a customHttpClientfor full control over connection pooling and transport settings.maxRetries(int maxRetries) Sets the maximum number of retries per request on transient failures (HTTP 500/503 and network errors).pathStyle(boolean pathStyle) Forces path-style access (endpoint/bucket/keyinstead ofbucket.endpoint/key).rangeBacking(RangeBacking rangeBacking) Sets the range-caching strategy for files opened from this source.Sets the AWS region (e.g."eu-west-1","auto").requestTimeout(Duration requestTimeout) Sets the per-request timeout for individual HTTP requests (default 30 seconds).Sets the temp directory used byRangeBacking.SPARSE_TEMPFILEfor the sparse-file backing.uploadPartSize(int bytes) Sets the part size of uploads throughS3Source.outputFile(String, String)(default 8 MiB, at least 5 MiB).
-
Method Details
-
uploadPartSize
Sets the part size of uploads throughS3Source.outputFile(String, String)(default 8 MiB, at least 5 MiB). Each open output holds up to five buffers of this size. A multipart upload has at most 10,000 parts, which caps an object at 10,000 times the part size. -
region
Sets the AWS region (e.g."eu-west-1","auto"). -
endpoint
Sets the endpoint for S3-compatible services (e.g. MinIO, R2, GCP). -
pathStyle
Forces path-style access (endpoint/bucket/keyinstead ofbucket.endpoint/key). -
credentials
Sets the credential provider. -
credentials
Sets static credentials (convenience shorthand). -
anonymous
Sends requests unsigned, for buckets that allow public read access. Mutually exclusive withcredentials(S3CredentialsProvider). A source built this way cannot create output files:S3Source.outputFile(String, String)throwsIllegalStateException. -
connectTimeout
Sets the connect timeout for the HTTP client (default 10 seconds). -
requestTimeout
Sets the per-request timeout for individual HTTP requests (default 30 seconds). It bounds the time until a response's headers arrive, and then each gap between bytes of its body: a body that stops sending bytes fails after one to two timeouts, and its request is retried like a network error. -
maxRetries
Sets the maximum number of retries per request on transient failures (HTTP 500/503 and network errors). Default is 3. -
httpClient
Sets a customHttpClientfor full control over connection pooling and transport settings. When provided, the caller is responsible for closing the client —S3Source.close()will not close it. Connect timeout is ignored when a custom client is supplied. -
rangeBacking
Sets the range-caching strategy for files opened from this source. Default isRangeBacking.NONE(everyreadRangeis a network GET). Opt in toRangeBacking.SPARSE_TEMPFILEfor interactive workloads that re-read the same byte ranges —diveis the canonical opt-in caller. -
tempDir
Sets the temp directory used by
RangeBacking.SPARSE_TEMPFILEfor the sparse-file backing. Defaults to the JVM'sjava.io.tmpdir. Ignored when range backing isRangeBacking.NONE.Under
RangeBacking.SPARSE_TEMPFILEthe directory must exist and be writeable;build()rejects it otherwise. -
build
-