ComputingElement

org.eso.ias.asce.ComputingElement
See theComputingElement companion object
abstract class ComputingElement[T](val asceIdentifier: Identifier, var _output: InOut[T], initialInputs: Set[InOut[_]], val tfSetting: TransferFunctionSetting, validityThresholdSecs: Int, val props: Properties)

The Integrated Alarm System Computing Element (ASCE) is the basic unit of the IAS.

The ASCE is composed of an output, generated by the user provided script applied to the inputs (i.e. monitor points and/or other alarms): the ComputingElement changes its output when the input changes (for example the value of a monitor point changes).

The output of a ASCE is normally an alarm generated by digesting the values of the inputs of the component itself. But sometimes, the output is a value of a given type (for example an integer) to implement what we name synthetic parameters.

The inputs of the ASCE comes either from the BSDB (i.e. monitored systems or other DASUs) or from other ASCEs running in the same DASU. The initial set of inputs must contain all the possible inputs accepted by a ASCE. Such inputs will likely have a empty value at the beginning but they are needed for updating when the new input arrives. Note that inputs not provided in the constructor are rejected as unknown so it is mandatory to pass in the constructor all the possible inputs.

The user provides a JVM class in one of the supported languages to digest the inputs and produce the output. The transfer function of the object is invoked when the state of the inputs change. Which programming language the user wrote the object with is stored in the configuration database; programmatically it is visible in the TransferFunctionSetting object. Depending on the programming language, there might be some preparatory step before running the TF.

The class is abstract because the implementation of the transfer function depends on the programming language and must be mixed when instantiating the object.

The ASCE is a state machine (@see ComputingElementState) whose state changes during the life time of the ASCE for example after initialization or shutdown but also if the TF executor reports errors or is too slow.

Objects of this class are mutable.

The id of the ASCE does not change over time unless the ASCE is relocated. In such case a new ASCE must be built to correctly initialize the classes implementing the transfer function. For the same reason, if the transfer function, implemented by the user changes, then a new ASCE must be built.

The update of the output is triggered by the DASU: when it sends the inputs, the ASCE runs the TF and produces the new output.

The ASCE monitors when the execution time of the TF is too slow for a given amount of time. The slowness and the duration are specified in the TransferFunctionSetting class. The ASCE logs a messasge if the execution of the TF is slower than the max allowed time; if the slowness persists over the duration then the TF is marked as broken and will not be executed anymore.

Value parameters

_output:

The output generated by this Component after applying the script to the inputs It is not necessarily an alarm.

asceIdentifier:

The identifier of this Component

initialInputs:

The initial set of all the possible inputs.

props:

the java properties to pass to this component and the TF

tfSetting:

The definition of the implementation of the transfer function that manipulates the inputs to produce the new output

validityThresholdSecs

the threshold (seconds), including toelerance, to set the validity of the output taking into account when the timestamps of the inputs and the constraint possibly set in the TF

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait JavaTransfer[T]
trait ScalaTransfer[T]

Members list

Value members

Abstract methods

def initTransferFunction(inputsInfo: Set[IasioInfo], outputInfo: IasioInfo, instance: Option[Int]): Try[Unit]

Initialize the scala transfer function

Initialize the scala transfer function

Value parameters

inputsInfo

The IDs and types of the inputs

instance

the instance

outputInfo

The Id and type of thr output

Attributes

def transfer(inputs: Map[String, InOut[_]], id: Identifier, actualOutput: InOut[T]): Try[InOut[T]]

Update the output by running the user provided script/class (TF) against the inputs

Update the output by running the user provided script/class (TF) against the inputs

This method sets the validity of the output from the validity of its inputs.

Value parameters

actualOutput:

the actual output

id:

the ID of this computing element

inputs:

The map of inputs

Attributes

Returns

The new output

Concrete methods

def ack(): Boolean

ACK the alarm produced by the TF of the ASCE.

ACK the alarm produced by the TF of the ASCE.

This function should be executed only if the type of the output is an alarm so in that case an error message is logged but the TF is not marked as broken. The ratio behind this choice is that the ACK is a command coming from outside: ACKing a value that is not an alarm is an error produced somewhere else that should be reported but not impact the functioning of the ASCE.

The function updates the value of the last produced output. This value will be passed to the TF the next time it is run because the inputs changed.

Attributes

Returns

true if the alarm has been acknowledged, false otherwise

def getState(): State

Expose the actual state of this ASCE

Expose the actual state of this ASCE

Attributes

Returns

The state of the ASCE

def initialize(): State

Initialize the object.

Initialize the object.

This method must be executed only once before running the TF.

If the initialization fails, the state of the object changes to broken.

Attributes

Returns

The state of the ASCE after the initialization

def output: InOut[T]

Getter for the private _output

Getter for the private _output

This method return the last calculated output.

Use getOutputWithUpdatedValidity() if you want the updated with an updated validity.

Attributes

Returns

the last calculated output

def shutdown(): Unit

shutdown>/code> must be executed to free the resources of a ComputingElement that later on can be cleanly destroyed.

shutdown>/code> must be executed to free the resources of a ComputingElement that later on can be cleanly destroyed.

One of the tasks of this method is to stop the timer thread to update the output i.e. to execute the transfer function.

Attributes

override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def update(iasValues: Set[IASValue[_]]): (Option[InOut[T]], State)

The DASU sent a new set of inputs: they replace the old inputs and trigger the execution of the TF to create a new output. If some of the inputs of the ASCE is not yet initialized, it has a null/empty value and the ASCE cannot run the TF neither produce the output.

The DASU sent a new set of inputs: they replace the old inputs and trigger the execution of the TF to create a new output. If some of the inputs of the ASCE is not yet initialized, it has a null/empty value and the ASCE cannot run the TF neither produce the output.

Value parameters

iasValues

the new inputs received from the DASU

Attributes

Returns

A tuple with 2 fields: 1) the new output generated applying the TF to the inputs and the new state of the ASCE It is None if at least one of the inputs has not yet been initialized 2) the state of the ASCE

Abstract fields

The programming language of this TF is abstract because it depends on the of the transfer mixed in when building objects of this class

The programming language of this TF is abstract because it depends on the of the transfer mixed in when building objects of this class

Attributes

Concrete fields

val acceptedInputIds: Set[String]

The IDs of all and only the possible inputs of the ASCE

The IDs of all and only the possible inputs of the ASCE

Attributes

lazy val fromTemplate: Boolean

True if the DASU has been generated from a template, False otherwise

True if the DASU has been generated from a template, False otherwise

Attributes

val id: String

The ID of the ASCE

The ID of the ASCE

Attributes

val inputs: Map[String, InOut[_]]

The inputs that produced the output. This map is initially populated with IASIOs not yet initialized that have a empty value.

The inputs that produced the output. This map is initially populated with IASIOs not yet initialized that have a empty value.

When the DASU sends the last received IASIOs, this map is updated with the new values and a new output is produced

Attributes

lazy val isOutputASyntheticParam: Boolean

true if this component produces a synthetic parameter instead of an alarm

true if this component produces a synthetic parameter instead of an alarm

Attributes

lazy val isOutputAnAlarm: Boolean

true if this component generates an alarm

true if this component generates an alarm

Attributes

val isTooSlow: AtomicBoolean

It is true when the execution tie of the TF is too slow

It is true when the execution tie of the TF is too slow

Attributes

val props: Properties
lazy val templateInstance: Option[Int]

The number of the instance if the DASU has been generated from a template; empty otherwise

The number of the instance if the DASU has been generated from a template; empty otherwise

Attributes

val tooSlowStartTime: AtomicLong

The point in time when the TF begins to be slow calculating the output.

The point in time when the TF begins to be slow calculating the output.

Attributes

lazy val validityThreshold: Long

The threshold (msecs) to evaluate the validity

The threshold (msecs) to evaluate the validity

Attributes