Data Services Events
DAPs and SM provide event callbacks that can be customized with user code. To use the callbacks, the custom code must be installed via a package.
Packaging and Installation
Refer to the User Defined Analytics (UDAs) documentation.
Process and lifecycle events
Syntax:
.ev.add[eventName;fnName]
The given function is called whenever the event is triggered. The parameters to the function are the event name and payload.
Example:
Code that could be added to sm.q
to use the initialization hooks in the SM.
.custom.sm.processInitPreCalled:0b;
.custom.sm.processInitPostCalled:0b;
.custom.sm.processInitPre:{[event;data]
.custom.sm.processInitPreCalled:1b;
}
.custom.sm.processInitPost:{[event;data]
.custom.sm.processInitPostCalled:1b;
}
.ev.add[`process.init.pre ;`.custom.sm.processInitPre];
.ev.add[`process.init.post;`.custom.sm.processInitPost];
Initialization
Event | Component | Description | Payload |
---|---|---|---|
process.init.pre |
SM,AGG,RC,DAP | Before process initialization | N/A |
process.init.post |
SM,AGG,RC,DAP | After process initialization | N/A |
process.init.registerAPI |
DAP | Before SG registration so that API's are available via getMeta |
N/A |
Data persistence
Event | Component | Description | Payload |
---|---|---|---|
lifecycle.partition.end |
DAP | End of partition (EOI/EOD) received from bus Deprecates .da.prtnEndCB |
(dict) End of partition message detailssignal (symbol): either eoi or eod |
lifecycle.reload.pre |
DAP | Before reloading the DB | (dict) Reload message details |
lifecycle.reload.post |
DAP | After reloading the DB Deprecates .da.reloadCB |
(dict) Reload message details |
lifecycle.eoi.pre |
SM (EOI) | Before EOI processing | (dict) Contains date , isEOD and seqid |
lifecycle.eoi.post |
SM (EOI) | After EOI processing | (dict) Contains date , isEOD and seqid |
lifecycle.eod.pre |
SM (EOD) | Before EOD processing | (dict) Contains date , nextDate and seq |
lifecycle.eod.post |
SM (EOD) | After EOD processing | (dict) Contains date , nextDate and seq |
lifecycle.batch.pre |
SM | Before batch processing | (dict) Contains batchUpdType and request parameters |
lifecycle.batch.post |
SM | After batch processing | (dict) Contains batchUpdType , request parameters and result |