infosphere-spl

How does one validate submission-time values?


SPL supports submission-time values, which are retrieved via function calls getSubmissionTimeValue() and/or getSubmissionTimeListValue(). Since there is no main() function in an SPL program, how can I validate these values in an operator?


Solution

  • In the param clause or logic state clause, assign a variable via means of an SPL function. Perform your validation in the SPL function.

    stream<blob incoming_data, uint32 source_port> DataStream
    as UDPReceiver = UDPSource() {
       param
          address : getConfig('exporter'); // IP address or host name
    

    stream<blob incoming_data, uint32 source_port> NextStream
    as Parser = Custom(DataStream) {
       logic
          state: {
              MyInfoMap _my_info_map = getInfoAsMap();
    

    Above, SPL functions getConfig() and getInfoAsMap() would retrieve the submission-time values and validate them.