0.10.8-alpha
ca.uqac.lif.cep.Processor Class Referenceabstract

Receives zero or more input events, and produces zero or more output events. More...

Classes

class  InternalProcessorState
 An object capturing the internal state of a processor, including the current contents of its input and output queues. More...
 

Public Member Functions

 Processor (int in_arity, int out_arity)
 Initializes a processor. More...
 
final synchronized Object getContext (String key)
 Retrieves an object from the processor's context. More...
 
synchronized Context getContext ()
 Gets the context associated to this object. More...
 
synchronized void setContext (String key, Object value)
 Adds an object to the object's context. More...
 
synchronized void setContext (Context context)
 Adds a complete context to this object. More...
 
final int hashCode ()
 Implementation of hashCode() specific to processors. More...
 
final boolean equals (Object o)
 Implementation of equals() specific to processors. More...
 
final int getId ()
 Fetches the processor instance's unique ID. More...
 
synchronized void reset ()
 Resets the processor. More...
 
abstract Pushable getPushableInput (int index)
 Returns the Pushable corresponding to the processor's i-th input trace. More...
 
final synchronized Pushable getPushableInput ()
 Returns the Pushable corresponding to the processor's first input trace. More...
 
abstract Pullable getPullableOutput (int index)
 Returns the Pullable corresponding to the processor's i-th output trace. More...
 
final synchronized Pullable getPullableOutput ()
 Returns the Pullable corresponding to the processor's first output trace. More...
 
synchronized void setPullableInput (int i, Pullable p)
 Assigns a Pullable to the processor's i-th input. More...
 
synchronized Pullable getPullableInput (int i)
 Returns the Pullable corresponding to the processor's i-th input. More...
 
synchronized void setPushableOutput (int i, Pushable p)
 Assigns a Pushable to the processor's i-th output. More...
 
synchronized Pushable getPushableOutput (int i)
 Retrieves the Pushable associated to the processor's i-th output. More...
 
final int getInputArity ()
 Returns the processor's input arity. More...
 
final int getOutputArity ()
 Returns the processor's output arity. More...
 
void duplicateInto (Processor p)
 Copies the contents and state of the current processor into another. More...
 
final Set< Class<?> > getInputType (int index)
 Gets the type of events the processor accepts for its i-th input trace. More...
 
void getInputTypesFor (Set< Class<?>> classes, int index)
 Populates the set of classes accepted by the processor for its i-th input. More...
 
Class<?> getOutputType (int index)
 Returns the type of the events produced by the processor for its i-th output. More...
 
void start ()
 Starts the processor. More...
 
void stop ()
 Stops the processor. More...
 
final EventTracker getEventTracker ()
 Gets the instance of event tracker associated to this processor. More...
 
Processor setEventTracker (EventTracker tracker)
 Associates an event tracker to this processor. More...
 
void associateToInput (int in_stream_index, int in_stream_pos, int out_stream_index, int out_stream_pos)
 Associates an input event to an output event. More...
 
void associateTo (NodeFunction f, int out_stream_index, int out_stream_pos)
 Associates a node function to a particular event of processor's output stream. More...
 
void associateToOutput (int in_stream_index, int in_stream_pos, int out_stream_index, int out_stream_pos)
 Associates an input event to an output event. More...
 
final int getInputCount ()
 Gets the number of event fronts received so far by this processor. More...
 
final int getOutputCount ()
 Gets the number of event fronts produced so far by this processor. More...
 
final Object print (ObjectPrinter<?> printer) throws ProcessorException
 Prints the contents of this processor into an object printer. More...
 
final Processor read (ObjectReader<?> reader, Object o) throws ProcessorException
 Reads the content of a processor from a serialized object. More...
 
final Processor duplicate ()
 Duplicates an object and sets it to its initial state. More...
 
void copyInputQueue (int index, Collection< Object > to)
 Copies the content of one of the processor's input queue to a collection. More...
 
void copyOutputQueue (int index, Collection< Object > to)
 Copies the content of one of the processor's output queue to a collection. More...
 
abstract Processor duplicate (boolean with_state)
 Duplicates an object. More...
 
Processor or (Processor p)
 Connects the first output pipe of this processor to the first input pipe of another processor. More...
 
Processor or (Pushable p)
 Connects the output at index 0 of the current processor to the input of another processor. More...
 
Pushable getAt (int index)
 Gets the Pushable object corresponding to the processor's input pipe for a given index. More...
 

Static Public Member Functions

static boolean allNull (Object[] v)
 Checks if all objects in the array are null. More...
 
static Queue< Object[]> getEmptyQueue ()
 Gets an instance of an empty event queue. More...
 
static void startAll (Processor ... procs)
 Starts all processors given as an argument. More...
 
static void stopAll (Processor ... procs)
 Stops all processors given as an argument. More...
 
static List< ProvenanceNode > getLeaves (ProvenanceNode root)
 Gets the leaves of a provenance tree. More...
 

Static Public Attributes

static final transient String s_versionString = "0.10.5"
 A string used to identify the program's version. More...
 
static final transient int MAX_PULL_RETRIES = 10000000
 Number of times the Pullable#hasNext() method tries to produce an output from the input before giving up. More...
 

Protected Member Functions

boolean allNotifiedEndOfTrace ()
 Determines if all the upstream pushables have sent the end of trace notification. More...
 
final Context newContext ()
 Creates a new empty context map. More...
 
boolean onEndOfTrace (Queue< Object[]> outputs) throws ProcessorException
 Allows to describe a specific behavior when the trace of input fronts has reached its end. More...
 
Object printState ()
 Produces an object that represents the state of the current processor. More...
 
Processor readState (Object o)
 Reads the state of a processor and uses it to create a new instance. More...
 

Static Protected Member Functions

static void getLeaves (ProvenanceNode root, List< ProvenanceNode > leaves)
 Accumulates the leaves of a provenance tree in a list. More...
 

Protected Attributes

int m_inputArity
 The processor's input arity, i.e. More...
 
int m_outputArity
 The processor's output arity, i.e. More...
 
transient Queue< Object > [] m_inputQueues
 An array of input event queues. More...
 
transient EventTracker m_eventTracker = null
 An object that keeps track of the relationship between input and output events. More...
 
transient Queue< Object > [] m_outputQueues
 An array of output event queues. More...
 
transient Pullable [] m_inputPullables
 An array of Pullables, one for each input trace this processor receives. More...
 
transient Pushable [] m_outputPushables
 An array of Pushables, one for each output trace this processor produces. More...
 
int m_inputCount = 0
 A counter incremented upon each input front processed. More...
 
int m_outputCount = 0
 A counter incremented upon each output front processed. More...
 
Context m_context = null
 The context in which the processor is instantiated. More...
 
boolean [] m_hasBeenNotifiedOfEndOfTrace
 Indicates whether the processor has been notified of the end of trace or not. More...
 

Detailed Description

Receives zero or more input events, and produces zero or more output events.

The processor is the fundamental class where all computation occurs. All of BeepBeep's processors (including yours) are descendants of this class.

A processor is depicted graphically as a "box", with "pipes" representing its input and output streams.

Processor

This class itself is abstract; nevertheless, it provides important methods for handling input/output event queues, connecting processors together, etc. However, if you write your own processor, you will most likely want to inherit from its child, SynchronousProcessor, which does some more work for you.

The Processor class does not assume anything about the type of events being input or output. All its input and output queues are therefore declared as containing instances of Object, Java's most generic type.

Author
Sylvain Hallé
Since
0.1

Definition at line 68 of file Processor.java.

Constructor & Destructor Documentation

◆ Processor()

ca.uqac.lif.cep.Processor.Processor ( int  in_arity,
int  out_arity 
)

Initializes a processor.

This has for effect of executing the basic operations common to every processor:

  • Giving a unique ID
  • Determining its input and output arity
  • Creating arrays of empty input and output queues, as well as arrays of Pullables and Pushables

If you create your own processor, its constructor must start by calling its ancestor's constructor (which ultimately ends up calling this constructor). Otherwise, expect a plethora of null pointers and other oddities.

Parameters
in_arityThe processor's input arity
out_arityThe processor's output arity

Definition at line 190 of file Processor.java.

Member Function Documentation

◆ allNotifiedEndOfTrace()

boolean ca.uqac.lif.cep.Processor.allNotifiedEndOfTrace ( )
protected

Determines if all the upstream pushables have sent the end of trace notification.

Returns
true
if all notifications have been sent,
false
otherwise

Definition at line 223 of file Processor.java.

◆ allNull()

static boolean ca.uqac.lif.cep.Processor.allNull ( Object []  v)
static

Checks if all objects in the array are null.

This is a convenience method used by other processor classes (e.g. SynchronousProcessor to make sure that some output was generated from a given input

Parameters
vThe array
Returns
true if all elements in the array are null, false otherwise

Definition at line 506 of file Processor.java.

◆ associateTo()

void ca.uqac.lif.cep.Processor.associateTo ( NodeFunction  f,
int  out_stream_index,
int  out_stream_pos 
)

Associates a node function to a particular event of processor's output stream.

Parameters
fThe node function
out_stream_indexThe index of the processor's output stream
out_stream_posThe position of the event in the output stream

Definition at line 716 of file Processor.java.

◆ associateToInput()

void ca.uqac.lif.cep.Processor.associateToInput ( int  in_stream_index,
int  in_stream_pos,
int  out_stream_index,
int  out_stream_pos 
)

Associates an input event to an output event.

Parameters
in_stream_indexThe index of the processor's input stream
in_stream_posThe position of the event in the input stream
out_stream_indexThe index of the processor's output stream
out_stream_posThe position of the event in the output stream

Definition at line 699 of file Processor.java.

◆ associateToOutput()

void ca.uqac.lif.cep.Processor.associateToOutput ( int  in_stream_index,
int  in_stream_pos,
int  out_stream_index,
int  out_stream_pos 
)

Associates an input event to an output event.

Parameters
in_stream_indexThe index of the processor's input stream
in_stream_posThe position of the event in the input stream
out_stream_indexThe index of the processor's output stream
out_stream_posThe position of the event in the output stream

Definition at line 731 of file Processor.java.

◆ copyInputQueue()

void ca.uqac.lif.cep.Processor.copyInputQueue ( int  index,
Collection< Object >  to 
)

Copies the content of one of the processor's input queue to a collection.

Parameters
indexThe index of the input queue
toThe collection where queue contents are copied to
Since
0.11

Definition at line 913 of file Processor.java.

◆ copyOutputQueue()

void ca.uqac.lif.cep.Processor.copyOutputQueue ( int  index,
Collection< Object >  to 
)

Copies the content of one of the processor's output queue to a collection.

Parameters
indexThe index of the output queue
toThe collection where queue contents are copied to
Since
0.11

Definition at line 924 of file Processor.java.

◆ duplicate() [1/2]

final Processor ca.uqac.lif.cep.Processor.duplicate ( )

Duplicates an object and sets it to its initial state.

This should be the same thing as calling duplicate(false).

Returns
Another object

Implements ca.uqac.lif.cep.DuplicableProcessor.

Definition at line 902 of file Processor.java.

◆ duplicate() [2/2]

abstract Processor ca.uqac.lif.cep.Processor.duplicate ( boolean  with_state)
abstract

Duplicates an object.

Optionally, set the object into the same state as the source object.

Parameters
with_stateSet to true to replicate the object's state, false to create a new copy in the initial state.
Returns
Another object

Implements ca.uqac.lif.cep.Duplicable.

◆ duplicateInto()

void ca.uqac.lif.cep.Processor.duplicateInto ( Processor  p)

Copies the contents and state of the current processor into another.

Parameters
pThe processor to copy contents into

Definition at line 524 of file Processor.java.

◆ equals()

final boolean ca.uqac.lif.cep.Processor.equals ( Object  o)

Implementation of equals() specific to processors.

Since every processor has a unique ID, equality amounts to equality of the field m_uniqueId. This behavior cannot be overridden by descendants.

Definition at line 320 of file Processor.java.

◆ getAt()

Pushable ca.uqac.lif.cep.Processor.getAt ( int  index)

Gets the Pushable object corresponding to the processor's input pipe for a given index.

Java programmers probably won't use this method, but users of the Groovy language can benefit from its operator overloading conventions, which map the construct p[x] to p.getAt(x). Combined with the definition of or(Pushable), this can be used to easily pipe two processors together:


def p = (some processor)
def q = (some other processor)
p | q[1] // Connects p to pipe index 1 of q
Parameters
indexThe input pipe index
Returns
The pushable object
Since
0.10.9

Definition at line 1039 of file Processor.java.

◆ getContext() [1/2]

final synchronized Object ca.uqac.lif.cep.Processor.getContext ( String  key)

Retrieves an object from the processor's context.

Parameters
keyThe key associated to that object
Returns
The object, or null if no object exists with such key

Definition at line 252 of file Processor.java.

◆ getContext() [2/2]

synchronized Context ca.uqac.lif.cep.Processor.getContext ( )

Gets the context associated to this object.

Returns
The context

Implements ca.uqac.lif.cep.Contextualizable.

Definition at line 262 of file Processor.java.

◆ getEmptyQueue()

static Queue<Object[]> ca.uqac.lif.cep.Processor.getEmptyQueue ( )
static

Gets an instance of an empty event queue.

It is recommended that processors call this method to get a queue instance, rather than instantiate their own manually.

Returns
The queue

Definition at line 610 of file Processor.java.

◆ getEventTracker()

final EventTracker ca.uqac.lif.cep.Processor.getEventTracker ( )

Gets the instance of event tracker associated to this processor.

Returns
The event tracker, or null of no event tracker is associated to this processor

Definition at line 673 of file Processor.java.

◆ getId()

final int ca.uqac.lif.cep.Processor.getId ( )

Fetches the processor instance's unique ID.

Returns
The ID

Definition at line 335 of file Processor.java.

◆ getInputArity()

final int ca.uqac.lif.cep.Processor.getInputArity ( )

Returns the processor's input arity.

Returns
The arity

Definition at line 481 of file Processor.java.

◆ getInputCount()

final int ca.uqac.lif.cep.Processor.getInputCount ( )

Gets the number of event fronts received so far by this processor.

Returns
The number of fronts

Definition at line 766 of file Processor.java.

◆ getInputType()

final Set<Class<?> > ca.uqac.lif.cep.Processor.getInputType ( int  index)

Gets the type of events the processor accepts for its i-th input trace.

Note that this method returns a set, in the case where the processor accepts various types of objects (for example, a processor accepting Numbers, but also Strings it converts into numbers internally).

Parameters
indexThe index of the input to query
Returns
A set of classes. If index it less than 0 or greater than the processor's declared input arity, the set will be empty.

Definition at line 551 of file Processor.java.

◆ getInputTypesFor()

void ca.uqac.lif.cep.Processor.getInputTypesFor ( Set< Class<?>>  classes,
int  index 
)

Populates the set of classes accepted by the processor for its i-th input.

By default, a processor returns the Connector.Variant type for all its inputs and all its outputs, meaning that the checking of types in Connector#connect(Processor...) will be skipped. A descendant of this class may choose to define specific types for its input and output, thereby activating runtime type checking.

Parameters
classesThe set of to fill with classes
indexThe index of the input to query

Definition at line 576 of file Processor.java.

◆ getLeaves() [1/2]

static List<ProvenanceNode> ca.uqac.lif.cep.Processor.getLeaves ( ProvenanceNode  root)
static

Gets the leaves of a provenance tree.

Parameters
rootThe root of the tree
Returns
A list of nodes that correspond to the leaves

Definition at line 937 of file Processor.java.

◆ getLeaves() [2/2]

static void ca.uqac.lif.cep.Processor.getLeaves ( ProvenanceNode  root,
List< ProvenanceNode >  leaves 
)
staticprotected

Accumulates the leaves of a provenance tree in a list.

Parameters
rootThe current node in the tree
leavesThe list of leaves

Definition at line 949 of file Processor.java.

◆ getOutputArity()

final int ca.uqac.lif.cep.Processor.getOutputArity ( )

Returns the processor's output arity.

Returns
The arity

Definition at line 491 of file Processor.java.

◆ getOutputCount()

final int ca.uqac.lif.cep.Processor.getOutputCount ( )

Gets the number of event fronts produced so far by this processor.

Returns
The number of fronts

Definition at line 775 of file Processor.java.

◆ getOutputType()

Class<?> ca.uqac.lif.cep.Processor.getOutputType ( int  index)

Returns the type of the events produced by the processor for its i-th output.

By default, a processor returns the Connector.Variant type for all its inputs and all its outputs, meaning that the checking of types in Connector#connect(Processor...) will be skipped. A descendant of this class may choose to define specific types for its input and output, thereby activating runtime type checking.

Parameters
indexThe index of the output to query
Returns
The type of the output. If index it less than 0 or greater than the processor's declared output arity, this method may throw an IndexOutOfBoundsException.

Definition at line 598 of file Processor.java.

◆ getPullableInput()

synchronized Pullable ca.uqac.lif.cep.Processor.getPullableInput ( int  i)

Returns the Pullable corresponding to the processor's i-th input.

Parameters
iThe index of the input. Should be greater than 0 and less than the processor's output arity. Outside these bounds, an ArrayIndexOutOfBounds will be thrown.
Returns
The pullable

Definition at line 441 of file Processor.java.

◆ getPullableOutput() [1/2]

abstract Pullable ca.uqac.lif.cep.Processor.getPullableOutput ( int  index)
abstract

Returns the Pullable corresponding to the processor's i-th output trace.

Parameters
indexThe index. Should be between 0 and the processor's output arity - 1 (since indices start at 0).
Returns
The pullable if the index is within the appropriate range, null otherwise.

◆ getPullableOutput() [2/2]

final synchronized Pullable ca.uqac.lif.cep.Processor.getPullableOutput ( )

Returns the Pullable corresponding to the processor's first output trace.

Returns
The pullable if the processor has at least one output. An ArrayIndexOutOfBounds will be thrown if the processor has an output arity of 0.

Definition at line 412 of file Processor.java.

◆ getPushableInput() [1/2]

abstract Pushable ca.uqac.lif.cep.Processor.getPushableInput ( int  index)
abstract

Returns the Pushable corresponding to the processor's i-th input trace.

Parameters
indexThe index. Should be between 0 and the processor's input arity - 1 (since indices start at 0).
Returns
The pushable if the index is within the appropriate range. Outside of the range,

◆ getPushableInput() [2/2]

final synchronized Pushable ca.uqac.lif.cep.Processor.getPushableInput ( )

Returns the Pushable corresponding to the processor's first input trace.

Returns
The pushable if the processor has at least one input. An ArrayIndexOutOfBounds will be thrown if the processor has an input arity of 0.

Definition at line 387 of file Processor.java.

◆ getPushableOutput()

synchronized Pushable ca.uqac.lif.cep.Processor.getPushableOutput ( int  i)

Retrieves the Pushable associated to the processor's i-th output.

Parameters
iThe index of the output. Should be greater than 0 (not checked) and less than the processor's output arity. Outside these bounds, an ArrayIndexOutOfBounds will be thrown.
Returns
The pushable

Definition at line 471 of file Processor.java.

◆ hashCode()

final int ca.uqac.lif.cep.Processor.hashCode ( )

Implementation of hashCode() specific to processors.

Every processor instance in BeepBeep is given a unique ID; even a clone of a processor (created using Processor#duplicate() will be identical to the original, except for this ID. This behavior cannot be overridden by descendants.

Definition at line 308 of file Processor.java.

◆ newContext()

final Context ca.uqac.lif.cep.Processor.newContext ( )
protected

Creates a new empty context map.

Returns
The context map

Definition at line 240 of file Processor.java.

◆ onEndOfTrace()

boolean ca.uqac.lif.cep.Processor.onEndOfTrace ( Queue< Object[]>  outputs) throws ProcessorException
protected

Allows to describe a specific behavior when the trace of input fronts has reached its end.

Called in "push mode" only. In "pull mode", implementing such a behavior can be done by using Pullable#hasNext() or Pullable#hasNextSoft().

Parameters
outputsA queue of arrays of objects. The processor should push arrays into this queue for every output front it produces. The size of each array should be equal to the processor's output arity, although this is not enforced.
Returns
true if the processor should output one or several output fronts, false otherwise and by default.
Exceptions
ProcessorExceptionAn exception thrown when a problem occurs with the operation

Definition at line 757 of file Processor.java.

◆ or() [1/2]

Processor ca.uqac.lif.cep.Processor.or ( Processor  p)

Connects the first output pipe of this processor to the first input pipe of another processor.

Java programmers probably won't use this method, but users of the Groovy language can benefit from its operator overloading conventions, which map the construct p | q to p.or(q). This can be used to easily pipe two processors together:


def p = (some processor)
def q = (some other processor)
p | q // Connects p to q
Parameters
pThe other processor
Returns
The other processor
Since
0.10.9

Definition at line 986 of file Processor.java.

◆ or() [2/2]

Processor ca.uqac.lif.cep.Processor.or ( Pushable  p)

Connects the output at index 0 of the current processor to the input of another processor.

Java programmers probably won't use this method. However, combined with the definition of getAt(int), users of the Groovy language can benefit from its operator overloading conventions, which map the construct p | q to p.or(q). This can be used to easily pipe two processors together:


def p = (some processor)
def q = (some other processor)
p | q[1] // Connects p to pipe index 1 of q

The above example works because q[1] returns q's input pushable for pipe index 1.

Parameters
pThe pushable object representing the input of the other processor to which the current output should be connected.
Returns
The other processor
Since
0.10.9

Definition at line 1013 of file Processor.java.

◆ print()

final Object ca.uqac.lif.cep.Processor.print ( ObjectPrinter<?>  printer) throws ProcessorException

Prints the contents of this processor into an object printer.

Parameters
printerThe printer to print this processor to
Returns
The printed processor
Since
0.10.2

Definition at line 787 of file Processor.java.

◆ printState()

Object ca.uqac.lif.cep.Processor.printState ( )
protected

Produces an object that represents the state of the current processor.

A concrete processor should override this method to add whatever state information that needs to be preserved in the serialization process.

Returns
Any object representing the processor's state (including null)
Since
0.10.2

Definition at line 825 of file Processor.java.

◆ read()

final Processor ca.uqac.lif.cep.Processor.read ( ObjectReader<?>  reader,
Object  o 
) throws ProcessorException

Reads the content of a processor from a serialized object.

Parameters
readerAn object reader
oThe object to read from
Returns
The serialized processor
Exceptions
ProcessorExceptionIf the read operation failed for some reason

Definition at line 839 of file Processor.java.

◆ readState()

Processor ca.uqac.lif.cep.Processor.readState ( Object  o)
protected

Reads the state of a processor and uses it to create a new instance.

Parameters
oThe object containing the processor's state
Returns
A new processor instance
Since
0.10.2

Definition at line 896 of file Processor.java.

◆ reset()

synchronized void ca.uqac.lif.cep.Processor.reset ( )

Resets the processor.

This has for effect of flushing the contents of all input and output event queues. If the processor has an internal state, this should also reset this state to its "initial" settings (whatever that means in your context).

Definition at line 346 of file Processor.java.

◆ setContext() [1/2]

synchronized void ca.uqac.lif.cep.Processor.setContext ( String  key,
Object  value 
)

Adds an object to the object's context.

Parameters
keyThe key associated to that object
valueThe object

Implements ca.uqac.lif.cep.Contextualizable.

Definition at line 274 of file Processor.java.

◆ setContext() [2/2]

synchronized void ca.uqac.lif.cep.Processor.setContext ( Context  context)

Adds a complete context to this object.

Parameters
contextThe context to add

Implements ca.uqac.lif.cep.Contextualizable.

Definition at line 286 of file Processor.java.

◆ setEventTracker()

Processor ca.uqac.lif.cep.Processor.setEventTracker ( EventTracker  tracker)

Associates an event tracker to this processor.

Parameters
trackerThe event tracker, or null to remove the association to an existing tracker
Returns
This processor

Definition at line 686 of file Processor.java.

◆ setPullableInput()

synchronized void ca.uqac.lif.cep.Processor.setPullableInput ( int  i,
Pullable  p 
)

Assigns a Pullable to the processor's i-th input.

Parameters
iThe index of the input. An ArrayIndexOutOfBounds will be thrown if it is out of range.
pThe pullable to assign it to

Definition at line 426 of file Processor.java.

◆ setPushableOutput()

synchronized void ca.uqac.lif.cep.Processor.setPushableOutput ( int  i,
Pushable  p 
)

Assigns a Pushable to the processor's i-th output.

Parameters
iThe index of the output. Should be greater than 0 and less than the processor's output arity. Outside these bounds, an ArrayIndexOutOfBounds will be thrown.
pThe pushable to assign it to

Definition at line 456 of file Processor.java.

◆ start()

void ca.uqac.lif.cep.Processor.start ( )

Starts the processor.

This has no effect, except for processors that use threads; in such a case, calling this method should start the thread.

Definition at line 619 of file Processor.java.

◆ startAll()

static void ca.uqac.lif.cep.Processor.startAll ( Processor ...  procs)
static

Starts all processors given as an argument.

Parameters
procsThe processors

Definition at line 639 of file Processor.java.

◆ stop()

void ca.uqac.lif.cep.Processor.stop ( )

Stops the processor.

This has no effect, except for processors that use threads; in such a case, calling this method should stop the thread.

Definition at line 628 of file Processor.java.

◆ stopAll()

static void ca.uqac.lif.cep.Processor.stopAll ( Processor ...  procs)
static

Stops all processors given as an argument.

Parameters
procsThe processors

Definition at line 656 of file Processor.java.

Member Data Documentation

◆ m_context

Context ca.uqac.lif.cep.Processor.m_context = null
protected

The context in which the processor is instantiated.

Definition at line 149 of file Processor.java.

◆ m_eventTracker

transient EventTracker ca.uqac.lif.cep.Processor.m_eventTracker = null
protected

An object that keeps track of the relationship between input and output events.

Definition at line 98 of file Processor.java.

◆ m_hasBeenNotifiedOfEndOfTrace

boolean [] ca.uqac.lif.cep.Processor.m_hasBeenNotifiedOfEndOfTrace
protected

Indicates whether the processor has been notified of the end of trace or not.

Each input pushable has its own flag, and the end of trace signal is propagated only once all upstream processors have sent the notification.

Definition at line 165 of file Processor.java.

◆ m_inputArity

int ca.uqac.lif.cep.Processor.m_inputArity
protected

The processor's input arity, i.e.

the number of input events it requires to produce an output

Definition at line 75 of file Processor.java.

◆ m_inputCount

int ca.uqac.lif.cep.Processor.m_inputCount = 0
protected

A counter incremented upon each input front processed.

Definition at line 122 of file Processor.java.

◆ m_inputPullables

transient Pullable [] ca.uqac.lif.cep.Processor.m_inputPullables
protected

An array of Pullables, one for each input trace this processor receives.

Definition at line 111 of file Processor.java.

◆ m_inputQueues

transient Queue<Object> [] ca.uqac.lif.cep.Processor.m_inputQueues
protected

An array of input event queues.

This is where the input events will be stored before the processor consumes them. There are as many input queues as the input arity of the processor.

Definition at line 92 of file Processor.java.

◆ m_outputArity

int ca.uqac.lif.cep.Processor.m_outputArity
protected

The processor's output arity, i.e.

the number of output events it produces

Definition at line 80 of file Processor.java.

◆ m_outputCount

int ca.uqac.lif.cep.Processor.m_outputCount = 0
protected

A counter incremented upon each output front processed.

Definition at line 127 of file Processor.java.

◆ m_outputPushables

transient Pushable [] ca.uqac.lif.cep.Processor.m_outputPushables
protected

An array of Pushables, one for each output trace this processor produces.

Definition at line 117 of file Processor.java.

◆ m_outputQueues

transient Queue<Object> [] ca.uqac.lif.cep.Processor.m_outputQueues
protected

An array of output event queues.

This is where the output events will be stored when the processor does its computation. There are as many output queues as the output arity of the processor.

Definition at line 105 of file Processor.java.

◆ MAX_PULL_RETRIES

final transient int ca.uqac.lif.cep.Processor.MAX_PULL_RETRIES = 10000000
static

Number of times the Pullable#hasNext() method tries to produce an output from the input before giving up.

While in theory, the method tries "as long as necessary", in practice a bound was put on the number of attempts as a safeguard to avoid infinite loops.

Definition at line 157 of file Processor.java.

◆ s_versionString

final transient String ca.uqac.lif.cep.Processor.s_versionString = "0.10.5"
static

A string used to identify the program's version.

Definition at line 85 of file Processor.java.


The documentation for this class was generated from the following file: