buckethead.storage.bucket¶
Thin wrapper over boto3.client("s3", ...).
buckethead.storage.bucket
¶
Thin wrapper over boto3.client("s3", ...).
Exposes only what snapshot.py and files/store.py need. No retry/backoff logic — boto3 defaults stand. Any error surfaces as botocore.ClientError to the caller.
Optionally records per-op byte totals and wall times into an IOCounters instance (Phase 9 profiling). Passing io_counters=None (the default) keeps the hot path free of any counting overhead.
BucketClient
¶
BucketClient(
config: BucketConfig,
io_counters: IOCounters | None = None,
)
Source code in src/buckethead/storage/bucket.py
put_bytes
¶
In-memory counterpart to upload(). For small payloads only — large bytes blow up memory. Counts as an 'upload' in IOCounters so the byte totals reflect all traffic we generated.
Source code in src/buckethead/storage/bucket.py
generate_presigned_get
¶
Return a sig-v4 presigned GET URL for key.
expires_in is seconds; S3/R2 hard-cap at 7 days (604800).
Source code in src/buckethead/storage/bucket.py
last_modified
¶
Epoch seconds of the object's LastModified, or None if missing.
Used by FileStore.gc() to enforce the grace window. Counts as a head_object in IOCounters.