Distributed Quoted-Log Tokenization
Design an offline batch system that tokenizes a 10 TB quoted log exactly and in order across worker boundaries.
Problem statement
For this exercise, assume one immutable 10 TB log object is available through range reads. Spaces separate tokens except while the parser is inside balanced double quotes.
Every double-quote character toggles the parser's quote state; escape sequences and embedded literal-quote syntax are outside scope, and the input has balanced quotes. The job may use up to 100 workers and must emit exactly the ordered token stream that a correct single-machine parser would produce.
Quote state and partial tokens may cross any range boundary. Workers and coordinators may retry, but the committed result must contain every token exactly once, in source order, with no boundary-created split or merge.
Design the offline batch system, including partitioning, coordination, durable intermediate state, final output publication, and recovery. Interactive and continuous-stream processing are outside scope.
What to build
- Submit a tokenization job for one immutable, versioned source object and obtain a stable job identifier.
- Produce every token exactly once in source order while preserving quote state and partial tokens across range boundaries.
- Inspect job progress and retrieve one immutable committed output manifest after successful completion.
- Retry failed workers or coordination steps without duplicating tokens or publishing a partial result as complete.
At scale
- For this exercise, assume one immutable input object can be as large as 10 TB and supports independent range reads against a stable object version.
- For this exercise, assume an offline batch job may use at most 100 workers reading disjoint ranges in parallel.
- For this exercise, the committed output must equal the single-machine parser byte-for-byte in token order, including tokens that span multiple ranges.
- For this exercise, worker and coordinator retries are expected; only one complete manifest may become the visible result for a job.