TriNet Wave Archiver `wa' Wave Archiver (wa) queries the database for waveform request cards, obtains and archives the requested waveforms. Its actions are initiated only by an internal timer. On startup, wa parses its config file. Key parameters are the request type to be processed (triggered or continuous), retrieval order (newest or oldest first), maximum number of requests to process in one polling operation, wave servers to access, the polling interval, and database login information. Wa then starts polling the database for request cards to process. First wa queries the database waveform_request table for `old' request cards, maximum of 2048 (fixed) cards. The query is for requests more than a configurable number of days old, ordered by number of retries. Thus the requests tried the most number of times will be first on the list. The old requests are deleted from the database and logged. Then wa queries the database for `newer' request cards, maximum of 1024 (configurable) cards. These are cards which either have not be tried previously, or whose last retry time is older than 10 raised to the power "number of retries" seconds (maximum of 1 day). Requests whose end time is newer than the wavepool wait time: 60 seconds for triggered requests, 180 seconds for continuous requests (these numbers are hard-coded.) The requests are processed as follows. The wave servers are queried for the requested waveform. If the waveform is retrieved from a server, it is saved as miniSEED. Directory is outdir/NET.STA.CHAN. Filename is NET.STA.CHAN of triggered requests, YYYYMMDDHH.NET.STA.CHAN for continuous triggers. (MiniSEED writer may add to the file name). Any waveforms that could not be saved, or requests that could not be served by the wave server are added to a `rejects' RequestList . All requests that are satisfied by the wave server and have their waveforms successfully saved are added to a `saved' RequestList and their waveform descriptive data are added to the `archived' WaveformList. The `archived' WaveformList data is written to the database; if this fails, all the `saved' requests are moved to the `rejects' RequestList. Then the `saved' requests are removed from the database; if this fails, all the all the `saved' requests are moved to the `rejects' RequestList. Finally, all the `rejects' request cards have their retry count and time updated in the database. Major Structures: RequestList: multimap< RequestCard, RequestInfo > RequestCard: Channel chan, TimeWindow win, int retry, TimeStamp lastretry, requestType rtype, requestPrioType priority RequestInfo: int evidind, unsigned long evid, int src_evidind, char *src_evid WaveformList: multimap< RequestInfo, WaveformArchive > WaveformArchive: Channel chan, TimeStamp reqstart, // Original start time of cont. waveform request TimeWindow win, // Actual start and end times of waveform data char *archloc, char *filename, int offset, int length, waveType wtype, formatType format, dataFormatType dataformat, orderType wordorder, int recsize, statusType status Major Enumeration Types: requestType: Unknown, Trig, Cont requestPrioType: Unknown, Low, Med, High