Document toolboxDocument toolbox

Devo Managed Query

Description

This unit is a Source unit and is a variant of the DevoSource unit.

The Devo Managed Query unit can be configured to optimize the management of eternal queries and data stalls. This means that when the unit has not received new events for some time, it will continue running and will not end despite the apparent broken connection. 

This unit has 2 input ports:

  • do: Input events entering through this port will launch a new execution of the query, overriding the query that is already running.
  • stop: The reception of an event through this port stops the current query.

An event enters through the do port. Then, an event is sent to the init port to signal the start of the query. The query specified in the properties is executed. An event is sent through the data port for each result row.

The error port outputs an event every time there's an error running the query, retrieving new records, etc. The unit adds the field "action" to the output events with the value 'error', plus other standard error fields containing details about the error.

Finally, it is sent through the end port every time a query ends, be it after an error, or when there are no more results. These events are the same as the input events, without any modification.

Alternatively, if an event enters through the stop port, the query ends.

Configuration

After dragging this unit into the Flow canvas, double-click it to access its configuration options. The following table describes the configuration options of this unit:

TabFieldDescription
GeneralNameEnter a name for the unit. It must start with a letter, and cannot contain spaces. Only letters, numbers, and underscores are allowed.
Check DB configurationWhether to check the connection to the DB when the unit is configured. This actually tries to connect to the given DB with provided parameters.
Poll wait time

Time (in miliseconds) to wait between query iterations when the unit is in a data stall in order to avoid closing the query.

Max loopsThe maximum number of iterations of the query.
QueryThe Devo query to be performed, in linq format. This query can include parameters (defined in the 'parameters' field), that will be filled with the corresponding input event field.  
Start timeYou can specify a start time if you wish to test the query without input events. The unit will start sending data from that time included.
End timeYou can specify an end time if you wish to test the query without input events. The unit will stop sending data from this time (excluded).
ParametersA list of field names to be used as parameters in the query, evaluated in order.
Fields onWhen defined, this is the name of the output event field with a list of column names.
Map onWhen defined, this is the name of the output event field if you wish to map from column names to values.
Ensure all dataIf this is set, the query will wait to obtain all data before beginning.
ColumnsEvent fieldThe name of an input event field containing a list of (name, type) pairs.
FieldsClick the plus icon to add name-type pairs.
NameThe name of an output event field where the query result will be inserted.
TypeThe expected type for the query result (java class qualified name).

Input ports

PortDescription
do

Input events entering through this port will launch a new execution of the query, overriding the query that is already running.

stopThe reception of an event through this port stops the current query.

Output ports

PortDescription
initOutputs an event every time a new query is launched (on each input event). These events are the same as the input events, without any modification.
dataOutputs an event for each query result row. The events generated are the input events extended with fields including the query results. Further required columns can be specified in the unit configuration options.
errorOutputs an event every time there's an error running the query, retrieving new records, etc. The generated event is an input event enriched with standard error messages.
endOutputs an event every time a query ends, be it after an error, or when there are no more results. These events are the same as the input events, without any modification.
stallOutputs an event every time a query that was launched enters into stall mode. The generated event has the field 'eventdate' with the current Timestamp.