Class JobLog

java.lang.Object
edu.ucsb.cs156.jobs.entities.JobLog

@Entity(name="job_logs") public class JobLog extends Object
One line of a Job's log, stored as its own row rather than appended into a single growing TEXT column on jobs. Each ctx.log() call is an INSERT here (O(1)), instead of a read-modify-write of the whole accumulated log (O(N) per call, O(N^2) total across N lines) — Postgres and MySQL both rewrite a TEXT column's full new value on every UPDATE under MVCC, so there is no way to make "append to one big column" cheap at the database layer either.

id is a real, ordered, per-line sequence, which is what makes incremental "tail -f" style fetching possible: a client can ask for everything with id > lastSeenId.

  • Constructor Details

    • JobLog

      public JobLog()