Pure logic to turn the stream of billing.events JSON log lines into batched .jsonl content + S3 keys. No I/O — fully unit-testable.
Depends: #2515
What to do
- For each logged line, parse out only
event_type and timestamp (for routing + key); keep the original line verbatim as the .jsonl body (no re-serialization).
- Batch lines grouped by
event_type, sealing a batch on max-events / max-bytes / max-age (whichever first).
- Build the key
<event_type>/<YYYY>/<MM>/<DD>/<HH>/<MM>/<uuid>.jsonl from the batch's event_type + timestamp + a per-file UUID.
Acceptance
- Unit tests: key format for a fixed timestamp; per-event_type grouping;
.jsonl body equals the exact logged lines newline-joined; per-file UUID uniqueness.
Pure logic to turn the stream of
billing.eventsJSON log lines into batched.jsonlcontent + S3 keys. No I/O — fully unit-testable.Depends: #2515
What to do
event_typeandtimestamp(for routing + key); keep the original line verbatim as the.jsonlbody (no re-serialization).event_type, sealing a batch onmax-events/max-bytes/max-age(whichever first).<event_type>/<YYYY>/<MM>/<DD>/<HH>/<MM>/<uuid>.jsonlfrom the batch's event_type + timestamp + a per-file UUID.Acceptance
.jsonlbody equals the exact logged lines newline-joined; per-file UUID uniqueness.