-
Notifications
You must be signed in to change notification settings - Fork 30
Archive
sheldonabrown edited this page Feb 25, 2013
·
7 revisions
The archiver's main responsibility is archiving both real time and inference messages. Additionally:
- The archiver picks up messages on both the Real-Time Queue and the Inference Queue.
- The archiver queries the TDS for some additional records
- The archiver does a minimal amount of data manipulation and, using Hibernate, inserts location and inference messages into their respective databases.
- The archiver hosts an Internal Operational Developer API to the most recent vehicle locations.
Import info from Confluence
- Crew assignment, depot assignment, and vehicle pullout data archived daily at 4am (this is when the last updated values for the previous day come through)
- Bundles are archived by convention on S3
- DSC data is not archived (original requirement was waived)
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| agency_id | varchar(64) | YES | | NULL | |
| depot_id | varchar(16) | YES | | NULL | |
| operator_id | varchar(16) | YES | | NULL | |
| run | varchar(255) | YES | | NULL | |
| service_date | date | NO | | NULL | |
| updated | datetime | YES | | NULL | |
+--------------+--------------+------+-----+---------+-------+
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| agency_id | varchar(64) | YES | | NULL | |
| date | date | NO | | NULL | |
| depot_id | varchar(16) | YES | | NULL | |
| vehicle_id | int(11) | NO | | NULL | |
+------------+-------------+------+-----+---------+-------+
+----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| agency_id | varchar(64) | YES | | NULL | |
| agency_id_tcip | int(11) | YES | | NULL | |
| depot_id | varchar(16) | YES | | NULL | |
| operator_id | varchar(16) | YES | | NULL | |
| pullin_time | datetime | YES | | NULL | |
| pullout_time | datetime | YES | | NULL | |
| run | varchar(255) | YES | | NULL | |
| service_date | date | NO | | NULL | |
| vehicle_id | int(11) | NO | | NULL | |
+----------------+--------------+------+-----+---------+-------+
- Create slave database from backup of master
- Peform upgrade modifications to database
- Stop monitoring, turn on maintenance mode
- Stop external data capture cron jobs
- Stop service alerts cron job
- Stop archiver process (tomcat6)
- Backup master database
- Switch CNAME from master to slave
- Start archiver
- Start service alerts cron job
- Start external data capture cron jobs
- Turn on monitoring (once system stabilizes)
- Perform manual backfill for time from last backup to CNAME swap
- Delete old master