SPL File traceLevelSwitch.spl

com.ibm.streamsx.plumbing > com.ibm.streamsx.plumbing 1.0.0 > com.ibm.streamsx.plumbing.switches > traceLevelSwitch.spl

Content

Operators

Composites

composite TraceLevelSwitch(output OUT; input IN)

Non-blocking switch set by application trace level.

When the switch is closed all tuples on its input port flow through to its output port unchanged. The switch is closed if isTraceable(traceThreshold) is true or forceClosed is true, otherwise it is open.

When the switch is open tuples on its input port are discarded, thus not blocking any upstream processing.

A change in the application trace level for the PE hosting an invocation of TraceLevelSwitch dynamically changes the state of the switch according to the operator's parameters.

Parameters

Input Ports

Output Ports

SPL Source Code


 public composite TraceLevelSwitch (input IN ; output OUT)
 {
   param 
     expression<boolean> $forceClosed : false;
     expression<Trace.Level> $traceThreshold : Trace.trace;
   graph 
     stream<IN> OUT = Filter(IN) {
       param
         filter : $forceClosed || isTraceable($traceThreshold);
     }
 }