![]() |
0.11.4
|
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.
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.
Definition at line 68 of file Processor.java.
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. | |
| final Object | getContext (String key) |
| Retrieves an object from the processor's context. | |
| Context | getContext () |
| Gets the context associated to this object. | |
| void | setContext (String key, Object value) |
| Adds an object to the object's context. | |
| void | setContext (Context context) |
| Adds a complete context to this object. | |
| final int | hashCode () |
Implementation of hashCode() specific to processors. | |
| final boolean | equals (Object o) |
Implementation of equals() specific to processors. | |
| final int | getId () |
| Fetches the processor instance's unique ID. | |
| void | reset () |
| Resets the processor. | |
| abstract Pushable | getPushableInput (int index) |
Returns the Pushable corresponding to the processor's i-th input trace. | |
| final Pushable | getPushableInput () |
Returns the Pushable corresponding to the processor's first input trace. | |
| abstract Pullable | getPullableOutput (int index) |
Returns the Pullable corresponding to the processor's i-th output trace. | |
| final Pullable | getPullableOutput () |
Returns the Pullable corresponding to the processor's first output trace. | |
| void | setPullableInput (int i, Pullable p) |
Assigns a Pullable to the processor's i-th input. | |
| Pullable | getPullableInput (int i) |
Returns the Pullable corresponding to the processor's i-th input. | |
| void | setPushableOutput (int i, Pushable p) |
Assigns a Pushable to the processor's i-th output. | |
| Pushable | getPushableOutput (int i) |
Retrieves the Pushable associated to the processor's i-th output. | |
| final int | getInputArity () |
| Returns the processor's input arity. | |
| final int | getOutputArity () |
| Returns the processor's output arity. | |
| void | duplicateInto (Processor p) |
| Copies the contents and state of the current processor into another. | |
| final Set< Class<?> > | getInputType (int index) |
| Gets the type of events the processor accepts for its i-th input trace. | |
| void | getInputTypesFor (Set< Class<?> > classes, int index) |
| Populates the set of classes accepted by the processor for its i-th input. | |
| Class<?> | getOutputType (int index) |
| Returns the type of the events produced by the processor for its i-th output. | |
| void | start () |
| Starts the processor. | |
| void | stop () |
| Stops the processor. | |
| final EventTracker | getEventTracker () |
| Gets the instance of event tracker associated to this processor. | |
| Processor | setEventTracker (EventTracker tracker) |
| Associates an event tracker to this processor. | |
| 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. | |
| 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. | |
| 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. | |
| final int | getInputCount () |
| Gets the number of event fronts received so far by this processor. | |
| final int | getOutputCount () |
| Gets the number of event fronts produced so far by this processor. | |
| final Object | print (ObjectPrinter<?> printer) throws ProcessorException |
| Prints the contents of this processor into an object printer. | |
| final Processor | read (ObjectReader<?> reader, Object o) throws ProcessorException |
| Reads the content of a processor from a serialized object. | |
| final Processor | duplicate () |
| Duplicates an object and sets it to its initial state. | |
| void | copyInputQueue (int index, Collection< Object > to) |
| Copies the content of one of the processor's input queue to a collection. | |
| void | copyOutputQueue (int index, Collection< Object > to) |
| Copies the content of one of the processor's output queue to a collection. | |
| abstract Processor | duplicate (boolean with_state) |
| Duplicates an object. | |
| Processor | or (Processor p) |
| Connects the first output pipe of this processor to the first input pipe of another processor. | |
| Processor | or (CallAfterConnect c) |
Operates similar to or(Processor), but also calls a method after the connection has been established. | |
| Processor | or (SelectedInputPipe p) |
| Connects the output at index 0 of the current processor to the input of another processor. | |
| PipeSelector | getAt (int index) |
Gets the PipeSelector object corresponding to the processor's input or output pipe for a given index. | |
| Pushable | rightShift (int index) |
| Pullable | leftShift (int index) |
| Queue< Object > | getInputQueue (int index) |
| Gets the content of the processor's input queue at a given index. | |
| Queue< Object > | getOutputQueue (int index) |
| Gets the content of the processor's output queue at a given index. | |
Static Public Member Functions | |
| static boolean | allNull (Object[] v) |
| Checks if all objects in the array are null. | |
| static Queue< Object[]> | getEmptyQueue () |
| Gets an instance of an empty event queue. | |
| static void | startAll (Processor ... procs) |
| Starts all processors given as an argument. | |
| static void | stopAll (Processor ... procs) |
| Stops all processors given as an argument. | |
| static List< ProvenanceNode > | getLeaves (ProvenanceNode root) |
| Gets the leaves of a provenance tree. | |
Static Public Attributes | |
| static final transient String | s_versionString = "0.11.2" |
| A string used to identify the program's version. | |
| 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. | |
Protected Member Functions | |
| boolean | allNotifiedEndOfTrace () |
| Determines if all the upstream pushables have sent the end of trace notification. | |
| final Context | newContext () |
| Creates a new empty context map. | |
| boolean | onEndOfTrace (Queue< Object[]> outputs) throws ProcessorException |
| Allows to describe a specific behavior when the trace of input fronts has reached its end. | |
| Object | printState () |
| Produces an object that represents the state of the current processor. | |
| Processor | readState (Object o) |
| Reads the state of a processor and uses it to create a new instance. | |
Static Protected Member Functions | |
| static void | getLeaves (ProvenanceNode root, List< ProvenanceNode > leaves) |
| Accumulates the leaves of a provenance tree in a list. | |
Protected Attributes | |
| int | m_inputArity |
| The processor's input arity, i.e. | |
| int | m_outputArity |
| The processor's output arity, i.e. | |
| transient Queue< Object >[] | m_inputQueues |
| An array of input event queues. | |
| transient EventTracker | m_eventTracker = null |
| An object that keeps track of the relationship between input and output events. | |
| transient Queue< Object >[] | m_outputQueues |
| An array of output event queues. | |
| transient Pullable[] | m_inputPullables |
An array of Pullables, one for each input trace this processor receives. | |
| transient Pushable[] | m_outputPushables |
An array of Pushables, one for each output trace this processor produces. | |
| int | m_inputCount = 0 |
| A counter incremented upon each input front processed. | |
| int | m_outputCount = 0 |
| A counter incremented upon each output front processed. | |
| Context | m_context = null |
| The context in which the processor is instantiated. | |
| boolean[] | m_hasBeenNotifiedOfEndOfTrace |
| Indicates whether the processor has been notified of the end of trace or not. | |
| boolean | m_notifiedEndOfTraceDownstream |
| Indicates whether the processor has notified the end of the trace to the downstream processors it is connected to. | |
| 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:
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.
| in_arity | The processor's input arity |
| out_arity | The processor's output arity |
Definition at line 192 of file Processor.java.
|
protected |
Determines if all the upstream pushables have sent the end of trace notification.
true if all notifications have been sent, false otherwise Definition at line 224 of file Processor.java.
|
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
| v | The array |
true if all elements in the array are null, false otherwise Definition at line 508 of file Processor.java.
| 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.
| f | The node function |
| out_stream_index | The index of the processor's output stream |
| out_stream_pos | The position of the event in the output stream |
Definition at line 718 of file Processor.java.
| 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.
| in_stream_index | The index of the processor's input stream |
| in_stream_pos | The position of the event in the input stream |
| out_stream_index | The index of the processor's output stream |
| out_stream_pos | The position of the event in the output stream |
Definition at line 701 of file Processor.java.
| 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.
| in_stream_index | The index of the processor's input stream |
| in_stream_pos | The position of the event in the input stream |
| out_stream_index | The index of the processor's output stream |
| out_stream_pos | The position of the event in the output stream |
Definition at line 733 of file Processor.java.
| 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.
| index | The index of the input queue |
| to | The collection where queue contents are copied to |
Definition at line 915 of file Processor.java.
| 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.
| index | The index of the output queue |
| to | The collection where queue contents are copied to |
Definition at line 926 of file Processor.java.
| 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).
Implements ca.uqac.lif.cep.DuplicableProcessor.
Definition at line 904 of file Processor.java.
|
abstract |
Duplicates an object.
Optionally, set the object into the same state as the source object.
| with_state | Set to true to replicate the object's state, false to create a new copy in the initial state. |
Implements ca.uqac.lif.cep.Duplicable.
Reimplemented in ca.uqac.lif.cep.Adder, ca.uqac.lif.cep.Doubler, ca.uqac.lif.cep.functions.ApplyFunction, ca.uqac.lif.cep.functions.ApplyFunctionLambda, ca.uqac.lif.cep.functions.ApplyFunctionPartial, ca.uqac.lif.cep.functions.Cumulate, ca.uqac.lif.cep.functions.Integrate, ca.uqac.lif.cep.functions.TurnInto, ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.io.Call, ca.uqac.lif.cep.io.HttpGet, ca.uqac.lif.cep.io.Print, ca.uqac.lif.cep.io.Print.Println, ca.uqac.lif.cep.io.ReadInputStream, ca.uqac.lif.cep.io.SpliceSource, ca.uqac.lif.cep.io.WriteOutputStream, ca.uqac.lif.cep.io.WriteToFile, ca.uqac.lif.cep.tmf.BlackHole, ca.uqac.lif.cep.tmf.CallbackSink, ca.uqac.lif.cep.tmf.CountDecimate, ca.uqac.lif.cep.tmf.DetectEnd, ca.uqac.lif.cep.tmf.Divert, ca.uqac.lif.cep.tmf.Filter, ca.uqac.lif.cep.tmf.FilterOn, ca.uqac.lif.cep.tmf.Fork, ca.uqac.lif.cep.tmf.Freeze, ca.uqac.lif.cep.tmf.Insert, ca.uqac.lif.cep.tmf.KeepLast, ca.uqac.lif.cep.tmf.Multiplex, ca.uqac.lif.cep.tmf.Pad, ca.uqac.lif.cep.tmf.Passthrough, ca.uqac.lif.cep.tmf.Pump, ca.uqac.lif.cep.tmf.QueueSink, ca.uqac.lif.cep.tmf.QueueSource, ca.uqac.lif.cep.tmf.ResetLast, ca.uqac.lif.cep.tmf.SimpleFilter, ca.uqac.lif.cep.tmf.SinkLast, ca.uqac.lif.cep.tmf.Slice, ca.uqac.lif.cep.tmf.SliceLast, ca.uqac.lif.cep.tmf.Splice, ca.uqac.lif.cep.tmf.Stutter, ca.uqac.lif.cep.tmf.Tank, ca.uqac.lif.cep.tmf.TankLast, ca.uqac.lif.cep.tmf.TimeDecimate, ca.uqac.lif.cep.tmf.Trim, ca.uqac.lif.cep.tmf.VariableStutter, ca.uqac.lif.cep.tmf.Window, ca.uqac.lif.cep.tmf.WindowFunction, ca.uqac.lif.cep.util.Bags.RunOn, ca.uqac.lif.cep.util.FindPattern, ca.uqac.lif.cep.util.Lists.Pack, ca.uqac.lif.cep.util.Lists.PutInto, ca.uqac.lif.cep.util.Lists.PutIntoNew, ca.uqac.lif.cep.util.Lists.TimePack, ca.uqac.lif.cep.util.Lists.Unpack, ca.uqac.lif.cep.util.Maps.MapPutInto, ca.uqac.lif.cep.util.Maps.MergeMaps, ca.uqac.lif.cep.util.Maps.PutInto, ca.uqac.lif.cep.util.Multiset.PutInto, ca.uqac.lif.cep.util.Randomize, ca.uqac.lif.cep.util.Sets.Intersect, ca.uqac.lif.cep.util.Sets.PutInto, ca.uqac.lif.cep.util.Sets.PutIntoNew, ca.uqac.lif.cep.util.Sets.Union, and ca.uqac.lif.cep.util.Strings.BuildString.
| void ca.uqac.lif.cep.Processor.duplicateInto | ( | Processor | p | ) |
Copies the contents and state of the current processor into another.
| p | The processor to copy contents into |
Definition at line 526 of file Processor.java.
| 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 321 of file Processor.java.
| PipeSelector ca.uqac.lif.cep.Processor.getAt | ( | int | index | ) |
Gets the PipeSelector object corresponding to the processor's input or output 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(Connector.SelectedInputPipe), 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
| index | The input pipe index |
Definition at line 1059 of file Processor.java.
| Context ca.uqac.lif.cep.Processor.getContext | ( | ) |
Gets the context associated to this object.
Implements ca.uqac.lif.cep.Contextualizable.
Definition at line 263 of file Processor.java.
| final Object ca.uqac.lif.cep.Processor.getContext | ( | String | key | ) |
Retrieves an object from the processor's context.
| key | The key associated to that object |
null if no object exists with such key Definition at line 253 of file Processor.java.
|
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.
Definition at line 612 of file Processor.java.
| final EventTracker ca.uqac.lif.cep.Processor.getEventTracker | ( | ) |
Gets the instance of event tracker associated to this processor.
null of no event tracker is associated to this processor Definition at line 675 of file Processor.java.
| final int ca.uqac.lif.cep.Processor.getId | ( | ) |
Fetches the processor instance's unique ID.
Definition at line 336 of file Processor.java.
| final int ca.uqac.lif.cep.Processor.getInputArity | ( | ) |
Returns the processor's input arity.
Definition at line 483 of file Processor.java.
| final int ca.uqac.lif.cep.Processor.getInputCount | ( | ) |
Gets the number of event fronts received so far by this processor.
Definition at line 768 of file Processor.java.
| Queue< Object > ca.uqac.lif.cep.Processor.getInputQueue | ( | int | index | ) |
Gets the content of the processor's input queue at a given index.
Note that the method returns a copy of the queue, and not its own internal queue. This means that modifications to the returned queue have no effect on the processor's internal state.
| index | The index of the input |
Definition at line 1084 of file Processor.java.
| 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).
| index | The index of the input to query |
index is less than 0 or greater than the processor's declared input arity, the set will be empty. Definition at line 553 of file Processor.java.
| 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.
| classes | The set of to fill with classes |
| index | The index of the input to query |
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunction, and ca.uqac.lif.cep.functions.TurnInto.
Definition at line 578 of file Processor.java.
|
static |
Gets the leaves of a provenance tree.
| root | The root of the tree |
Definition at line 939 of file Processor.java.
|
staticprotected |
Accumulates the leaves of a provenance tree in a list.
| root | The current node in the tree |
| leaves | The list of leaves |
Definition at line 951 of file Processor.java.
| final int ca.uqac.lif.cep.Processor.getOutputArity | ( | ) |
Returns the processor's output arity.
Definition at line 493 of file Processor.java.
| final int ca.uqac.lif.cep.Processor.getOutputCount | ( | ) |
Gets the number of event fronts produced so far by this processor.
Definition at line 777 of file Processor.java.
| Queue< Object > ca.uqac.lif.cep.Processor.getOutputQueue | ( | int | index | ) |
Gets the content of the processor's output queue at a given index.
Note that the method returns a copy of the queue, and not its own internal queue. This means that modifications to the returned queue have no effect on the processor's internal state.
| index | The index of the input |
Definition at line 1101 of file Processor.java.
| 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.
| index | The index of the output to query |
index it less than 0 or greater than the processor's declared output arity, this method may throw an IndexOutOfBoundsException. Reimplemented in ca.uqac.lif.cep.functions.ApplyFunction, ca.uqac.lif.cep.functions.TurnInto, ca.uqac.lif.cep.tmf.QueueSource, ca.uqac.lif.cep.util.Lists.ListUpdateProcessor, ca.uqac.lif.cep.util.Maps.MapPutInto, ca.uqac.lif.cep.util.Maps.PutInto, and ca.uqac.lif.cep.util.Sets.SetUpdateProcessor.
Definition at line 600 of file Processor.java.
| Pullable ca.uqac.lif.cep.Processor.getPullableInput | ( | int | i | ) |
Returns the Pullable corresponding to the processor's i-th input.
| i | The 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. |
Reimplemented in ca.uqac.lif.cep.GroupProcessor.
Definition at line 443 of file Processor.java.
| final Pullable ca.uqac.lif.cep.Processor.getPullableOutput | ( | ) |
Returns the Pullable corresponding to the processor's first output trace.
Definition at line 414 of file Processor.java.
|
abstract |
Returns the Pullable corresponding to the processor's i-th output trace.
| index | The index. Should be between 0 and the processor's output arity - 1 (since indices start at 0). |
null otherwise. Reimplemented in ca.uqac.lif.cep.AsynchronousProcessor, ca.uqac.lif.cep.functions.ApplyFunctionPartial, ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.io.ReadInputStream, ca.uqac.lif.cep.SynchronousProcessor, ca.uqac.lif.cep.tmf.Divert, ca.uqac.lif.cep.tmf.Multiplex, ca.uqac.lif.cep.tmf.Pump, ca.uqac.lif.cep.tmf.Tank, ca.uqac.lif.cep.UniformProcessor, and ca.uqac.lif.cep.util.Lists.TimePack.
| final Pushable ca.uqac.lif.cep.Processor.getPushableInput | ( | ) |
Returns the Pushable corresponding to the processor's first input trace.
Definition at line 389 of file Processor.java.
|
abstract |
Returns the Pushable corresponding to the processor's i-th input trace.
| index | The index. Should be between 0 and the processor's input arity - 1 (since indices start at 0). |
Reimplemented in ca.uqac.lif.cep.AsynchronousProcessor, ca.uqac.lif.cep.functions.ApplyFunctionPartial, ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.SynchronousProcessor, ca.uqac.lif.cep.tmf.Divert, ca.uqac.lif.cep.tmf.Multiplex, ca.uqac.lif.cep.tmf.Pump, ca.uqac.lif.cep.tmf.Tank, ca.uqac.lif.cep.tmf.TankLast, and ca.uqac.lif.cep.UniformProcessor.
| Pushable ca.uqac.lif.cep.Processor.getPushableOutput | ( | int | i | ) |
Retrieves the Pushable associated to the processor's i-th output.
| i | The 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. |
Reimplemented in ca.uqac.lif.cep.GroupProcessor.
Definition at line 473 of file Processor.java.
| 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 309 of file Processor.java.
| Pullable ca.uqac.lif.cep.Processor.leftShift | ( | int | index | ) |
Definition at line 1069 of file Processor.java.
|
protected |
Creates a new empty context map.
Definition at line 241 of file Processor.java.
|
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().
| outputs | A 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. |
| ProcessorException | An exception thrown when a problem occurs with the operation |
Reimplemented in ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.tmf.AbstractSlice, ca.uqac.lif.cep.tmf.Decimate, ca.uqac.lif.cep.tmf.KeepLast, ca.uqac.lif.cep.tmf.SinkLast, ca.uqac.lif.cep.UniformProcessor, and ca.uqac.lif.cep.util.Lists.AbstractPack.
Definition at line 759 of file Processor.java.
| Processor ca.uqac.lif.cep.Processor.or | ( | CallAfterConnect | c | ) |
Operates similar to or(Processor), but also calls a method after the connection has been established.
Currently there is a single use for this method, which is when GroupProcessor#or(Processor) is called —which, again, typically only occurs in the context of a Groovy script.
| c | The object that contains the method to call |
c Definition at line 1004 of file Processor.java.
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
| p | The other processor |
Definition at line 988 of file Processor.java.
| Processor ca.uqac.lif.cep.Processor.or | ( | SelectedInputPipe | 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.
| p | The pushable object representing the input of the other processor to which the current output should be connected. |
Definition at line 1033 of file Processor.java.
| final Object ca.uqac.lif.cep.Processor.print | ( | ObjectPrinter<?> | printer | ) | throws ProcessorException |
Prints the contents of this processor into an object printer.
| printer | The printer to print this processor to |
Definition at line 789 of file Processor.java.
|
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.
null) Reimplemented in ca.uqac.lif.cep.functions.ApplyFunction, ca.uqac.lif.cep.functions.ApplyFunctionPartial, ca.uqac.lif.cep.functions.Cumulate, ca.uqac.lif.cep.functions.TurnInto, ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.tmf.BlackHole, ca.uqac.lif.cep.tmf.CountDecimate, ca.uqac.lif.cep.tmf.Fork, ca.uqac.lif.cep.tmf.Freeze, ca.uqac.lif.cep.tmf.Passthrough, ca.uqac.lif.cep.tmf.QueueSink, ca.uqac.lif.cep.tmf.QueueSource, ca.uqac.lif.cep.tmf.SinkLast, ca.uqac.lif.cep.tmf.Slice, ca.uqac.lif.cep.tmf.SliceLast, and ca.uqac.lif.cep.tmf.Trim.
Definition at line 827 of file Processor.java.
| final Processor ca.uqac.lif.cep.Processor.read | ( | ObjectReader<?> | reader, |
| Object | o ) throws ProcessorException |
Reads the content of a processor from a serialized object.
| reader | An object reader |
| o | The object to read from |
| ProcessorException | If the read operation failed for some reason |
Definition at line 841 of file Processor.java.
|
protected |
Reads the state of a processor and uses it to create a new instance.
| o | The object containing the processor's state |
Reimplemented in ca.uqac.lif.cep.Adder, ca.uqac.lif.cep.Doubler, ca.uqac.lif.cep.functions.ApplyFunction, ca.uqac.lif.cep.functions.ApplyFunctionPartial, ca.uqac.lif.cep.functions.Cumulate, ca.uqac.lif.cep.functions.TurnInto, ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.tmf.BlackHole, ca.uqac.lif.cep.tmf.CountDecimate, ca.uqac.lif.cep.tmf.Fork, ca.uqac.lif.cep.tmf.Freeze, ca.uqac.lif.cep.tmf.Passthrough, ca.uqac.lif.cep.tmf.QueueSink, ca.uqac.lif.cep.tmf.QueueSource, ca.uqac.lif.cep.tmf.SinkLast, ca.uqac.lif.cep.tmf.Slice, ca.uqac.lif.cep.tmf.SliceLast, and ca.uqac.lif.cep.tmf.Trim.
Definition at line 898 of file Processor.java.
| 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).
Reimplemented in ca.uqac.lif.cep.AsynchronousProcessor, ca.uqac.lif.cep.functions.ApplyFunction, ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.io.Print, ca.uqac.lif.cep.io.WriteToFile, ca.uqac.lif.cep.tmf.AbstractSlice, ca.uqac.lif.cep.tmf.CountDecimate, ca.uqac.lif.cep.tmf.DetectEnd, ca.uqac.lif.cep.tmf.Freeze, ca.uqac.lif.cep.tmf.Insert, ca.uqac.lif.cep.tmf.Pad, ca.uqac.lif.cep.tmf.Prefix, ca.uqac.lif.cep.tmf.QueueSink, ca.uqac.lif.cep.tmf.QueueSource, ca.uqac.lif.cep.tmf.ResetLast, ca.uqac.lif.cep.tmf.SinkLast, ca.uqac.lif.cep.tmf.Slice, ca.uqac.lif.cep.tmf.SliceLast, ca.uqac.lif.cep.tmf.Splice, ca.uqac.lif.cep.tmf.Tank, ca.uqac.lif.cep.tmf.TimeDecimate, ca.uqac.lif.cep.tmf.Window, ca.uqac.lif.cep.util.Lists.ListUpdateProcessor, ca.uqac.lif.cep.util.Maps.MapPutInto, ca.uqac.lif.cep.util.Maps.MergeMaps, ca.uqac.lif.cep.util.Maps.PutInto, ca.uqac.lif.cep.util.Multiset.PutInto, ca.uqac.lif.cep.util.Sets.SetUpdateProcessor, and ca.uqac.lif.cep.util.Strings.BuildString.
Definition at line 347 of file Processor.java.
| Pushable ca.uqac.lif.cep.Processor.rightShift | ( | int | index | ) |
Definition at line 1064 of file Processor.java.
| void ca.uqac.lif.cep.Processor.setContext | ( | Context | context | ) |
Adds a complete context to this object.
| context | The context to add |
Implements ca.uqac.lif.cep.Contextualizable.
Reimplemented in ca.uqac.lif.cep.GroupProcessor, and ca.uqac.lif.cep.tmf.Splice.
Definition at line 287 of file Processor.java.
| void ca.uqac.lif.cep.Processor.setContext | ( | String | key, |
| Object | value ) |
Adds an object to the object's context.
| key | The key associated to that object |
| value | The object |
Implements ca.uqac.lif.cep.Contextualizable.
Reimplemented in ca.uqac.lif.cep.GroupProcessor, and ca.uqac.lif.cep.tmf.Splice.
Definition at line 275 of file Processor.java.
| Processor ca.uqac.lif.cep.Processor.setEventTracker | ( | EventTracker | tracker | ) |
Associates an event tracker to this processor.
| tracker | The event tracker, or null to remove the association to an existing tracker |
Reimplemented in ca.uqac.lif.cep.GroupProcessor, and ca.uqac.lif.cep.SynchronousProcessor.
Definition at line 688 of file Processor.java.
| void ca.uqac.lif.cep.Processor.setPullableInput | ( | int | i, |
| Pullable | p ) |
Assigns a Pullable to the processor's i-th input.
| i | The index of the input. An ArrayIndexOutOfBounds will be thrown if it is out of range. |
| p | The pullable to assign it to |
Reimplemented in ca.uqac.lif.cep.GroupProcessor.
Definition at line 428 of file Processor.java.
| void ca.uqac.lif.cep.Processor.setPushableOutput | ( | int | i, |
| Pushable | p ) |
Assigns a Pushable to the processor's i-th output.
| i | The 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. |
| p | The pushable to assign it to |
Reimplemented in ca.uqac.lif.cep.GroupProcessor, and ca.uqac.lif.cep.tmf.Divert.
Definition at line 458 of file Processor.java.
| 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.
Reimplemented in ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.io.SpliceSource, ca.uqac.lif.cep.tmf.Pump, and ca.uqac.lif.cep.util.Lists.TimePack.
Definition at line 621 of file Processor.java.
|
static |
Starts all processors given as an argument.
| procs | The processors |
Definition at line 641 of file Processor.java.
| 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.
Reimplemented in ca.uqac.lif.cep.GroupProcessor, ca.uqac.lif.cep.io.Print, ca.uqac.lif.cep.io.SpliceSource, ca.uqac.lif.cep.tmf.Pump, ca.uqac.lif.cep.tmf.Splice, and ca.uqac.lif.cep.util.Lists.TimePack.
Definition at line 630 of file Processor.java.
|
static |
Stops all processors given as an argument.
| procs | The processors |
Definition at line 658 of file Processor.java.
|
protected |
The context in which the processor is instantiated.
Definition at line 144 of file Processor.java.
|
protected |
An object that keeps track of the relationship between input and output events.
Definition at line 98 of file Processor.java.
|
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 160 of file Processor.java.
|
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.
|
protected |
A counter incremented upon each input front processed.
Definition at line 122 of file Processor.java.
|
protected |
An array of Pullables, one for each input trace this processor receives.
Definition at line 111 of file Processor.java.
|
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.
|
protected |
Indicates whether the processor has notified the end of the trace to the downstream processors it is connected to.
The end of trace signal should be sent at most once.
Definition at line 167 of file Processor.java.
|
protected |
The processor's output arity, i.e.
the number of output events it produces
Definition at line 80 of file Processor.java.
|
protected |
A counter incremented upon each output front processed.
Definition at line 127 of file Processor.java.
|
protected |
An array of Pushables, one for each output trace this processor produces.
Definition at line 117 of file Processor.java.
|
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.
|
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 152 of file Processor.java.
|
static |
A string used to identify the program's version.
Definition at line 85 of file Processor.java.