wiki:drmsCheckTriggers

Version 1 (modified by niles, 11 years ago) (diff)

--

Checking Triggers

If a site is subscribed to a data series, then it will be notified when there are new storage unit numbers for that series. It is then up to the site to do something about it, that is, to put the storage unit numbers on the queue to get them processed.

To illustrate :

The following SUMS database queries will list all the series tables fof aia and hmi :

\d aia.*
\d hmi.*

Note that one of the hmi series is called "hmi.v_avg120", so we can describe that :

\d hmi.v_avg120

Which, among other things, shows :

Triggers:
    hmi_v_avg120_trg AFTER INSERT ON hmi.v_avg120 FOR EACH ROW EXECUTE PROCEDURE hmi_v_avg120_fc()

So the trigger hmi_v_avg120_trg will run the procedure hmi_v_avg120_fc() every time a row is inserted in hmi.v_avg120. To see the procedure :

\df+ hmi_v_avg120_fc()

Which shows the source for the procedure - it adds the sunum to the queue :

BEGIN
 IF (TG_OP='INSERT' AND new.sunum > 0) THEN
  INSERT INTO sunum_queue (sunum,recnum,series_name) VALUES (new.sunum,new.recnum,'hmi.V_avg120');
 END IF;
 RETURN NEW;
END

Note that this still does not get the data on disk - but your local DRMS/SUMS database now has knowledge that the data exists offsite. Given that, the JMD will be able to download it.