#include <QBox.h>
Inherited by AggregateQBox, BSortQBox, CombineQBox, DelayQBox, ExistsQBox, FilterQBox, InsertQBox, JoinQBox, JoinStatic, LockQBox, LRWaitForQBox, MapQBox, MySQLQBox, ResampleQBox, RevisionAggregateQBox, RevisionFilterQBox, SControlQBox, SelectQBox, UnionQBox, UnlockQBox, UpdateQBox, and WaitForQBox.
QBox is an abstract class - each box type is a subclass of QBox (FilterQBox, JoinQBox, etc.).
The lifecycle of a QBox is as follows:
For example, JoinQBox's setupImpl() method will verify that there are exactly two input streams and that all the parameters make sure (else throw an AuroraTypingException). It will parse the join predicate, saving the Predicate object in an instance variable. It will then create the output stream's description by combining the two input descriptions the appropriate way, and calling setOutputDescription(0, theNewDescription).
If only type inferencing or validation is desired, then at this point the QBox can simply be destroyed.
Each input stream must match the corresponding input description provided before typechecking. Each output stream must match the output description generated by typechecking.
Public Member Functions | |
virtual | ~QBox () |
Destructor. | |
const DOMElement * | getCatalogElement () const |
Return a pointer to the DOMElement for this QBox in the catalog. | |
Table * | getTable () const |
Returns the table associated with this box, if any. | |
void | setTable (Table *table) |
Sets the table associated with this box. | |
const TupleDescription & | getInputDescription (unsigned int i) const |
Returns the description of the ith input stream, zero-relative. | |
void | setInputDescription (unsigned int i, ptr< TupleDescription > desc) |
Sets the description of the ith input stream, zero-relative. | |
void | setInputDescription (unsigned int i, const TupleDescription &desc) |
Sets the description of the ith input stream, zero-relative. | |
const TupleDescription & | getOutputDescription (unsigned int i) const |
Returns the description of the ith output stream, zero-relative. | |
void | setOutputDescription (unsigned int i, ptr< TupleDescription > desc) |
Sets the description of the ith output stream, zero-relative. | |
void | setOutputDescription (unsigned int i, const TupleDescription &desc) |
Sets the description of the ith output stream, zero-relative. | |
Stream & | getInput (unsigned int n) const |
Returns the ith input stream. | |
void | setInput (unsigned int i, Stream *desc) |
Sets the ith input stream. | |
Stream & | getOutput (unsigned int n) const |
Returns the ith output stream. | |
void | setCPView (ptr< CPView > cpview) |
Sets the CPView for this box This is called when the CPView is created in AuroraNode. | |
void | setOutput (unsigned int i, Stream *desc) |
Sets the ith output stream. | |
unsigned int | getNumInputs () |
Returns the number of input streams. | |
unsigned int | getNumOutputs () |
Returns the number of output streams. | |
string | getName () const |
Returns the name of the box. | |
string | getType () const |
Returns the type of the box. | |
string | as_string () const |
Returns a string representation of the box. | |
void | setup (AuroraNode &, const DOMElement *elt) throw (AuroraException) |
Set up the box. | |
void | init (PagePool &pool) throw (AuroraException) |
Initialize the box. | |
void | setPendingQueueState (ptr< QueueState > packed_queues) |
void | unpackQueue (ptr< QueueState > packed_queue) |
ptr< QueueState > | packQueues () |
virtual void | setPendingBoxState (ptr< AbstractBoxState > packed_box) |
virtual void | unpackState (ptr< AbstractBoxState > box_state) |
virtual ptr< AbstractBoxState > | packState () |
void | run (QBoxInvocation &inv) |
Runs the QBox. Should be called only by the scheduler. | |
void | scheduleRun () |
Requests that the box get run again. | |
TupleQueue * | getInputQueue (unsigned int input) |
Returns the input queue corresponding to the inputth input stream. | |
string | param (string name, Params::Req req=PARAM_NOT_REQUIRED) const throw (AuroraBadEntityException) |
string | param (string name, string def) const |
template<typename T> bool | typedParam (string name, T &value, Params::Req req=PARAM_NOT_REQUIRED) const throw (AuroraBadEntityException) |
const Params & | getParams () |
Static Public Member Functions | |
string | getBoxType (const DOMElement *) throw (AuroraException) |
Determine the type of a box from a DOM <box> tag. | |
QBox * | instantiate (const DOMElement *) throw (AuroraException) |
Static Public Attributes | |
const Params::Req | PARAM_NOT_REQUIRED = Params::NOT_REQUIRED |
const Params::Req | PARAM_REQUIRED = Params::REQUIRED |
const Params::Req | PARAM_NON_EMPTY = Params::NON_EMPTY |
Protected Types | |
typedef TupleQueue::DeqIterator | DeqIterator |
typedef Stream::EnqIterator | EnqIterator |
typedef TupleQueue::SeekIterator | SeekIterator |
Protected Member Functions | |
QBox () | |
DeqIterator | deq (unsigned int index) |
SeekIterator | seek (unsigned int index) |
EnqIterator | enq (unsigned int index) |
virtual void | setupImpl ()=0 |
virtual void | initImpl () |
virtual void | runImpl (QBoxInvocation &) |
ptr< LockSet > | getLockSet (string name) |
Protected Attributes | |
ptr< AbstractBoxState > | _pending_box_state |
AuroraNode * | _node |
ptr< CPView > | _cpview_on_input |
|
|
|
|
|
|
|
Destructor.
|
|
|
|
Returns a string representation of the box.
|
|
|
|
|
|
Determine the type of a box from a DOM <box> tag. Throws an exception if the <box> tag doesn't seem to be valid. |
|
Return a pointer to the DOMElement for this QBox in the catalog. Should only be called by subclasses during setupImpl(). |
|
Returns the ith input stream. Undefined behavior if no such input stream exists. |
|
Returns the description of the ith input stream, zero-relative. Undefined behavior if no such input stream exists. |
|
Returns the input queue corresponding to the inputth input stream.
|
|
|
|
Returns the name of the box.
|
|
Returns the number of input streams.
|
|
Returns the number of output streams.
|
|
Returns the ith output stream. Undefined behavior if no such input stream exists. |
|
Returns the description of the ith output stream, zero-relative. Undefined behavior if no such output stream exists. |
|
|
|
Returns the table associated with this box, if any.
|
|
Returns the type of the box.
|
|
Initialize the box. Calls setup() if setup has not yet been invoked. (The box must not have been inited already.) |
|
Reimplemented in AggregateQBox, BSortQBox, FilterQBox, JoinQBox, LockQBox, MapQBox, ResampleQBox, RevisionAggregateQBox, RevisionFilterQBox, SControlQBox, SJoinQBox, SOutputQBox, SUnionQBox, UnionQBox, UnlockQBox, WaitForQBox, JoinStatic, LRWaitForQBox, ExistsQBox, InsertQBox, SelectQBox, UpdateQBox, and MySQLQBox.
|
|
|
|
|
|
Reimplemented in AggregateQBox, FilterQBox, JoinQBox, SOutputQBox, and SUnionQBox.
|
|
|
|
|
|
Runs the QBox. Should be called only by the scheduler.
|
|
Reimplemented in AggregateQBox, BSortQBox, FilterQBox, JoinQBox, LockQBox, MapQBox, ResampleQBox, RevisionAggregateQBox, RevisionFilterQBox, SJoinQBox, SOutputQBox, SUnionQBox, UnionQBox, UnlockQBox, WaitForQBox, CombineQBox, DelayQBox, JoinStatic, LRWaitForQBox, ExistsQBox, InsertQBox, SelectQBox, UpdateQBox, and MySQLQBox.
|
|
Requests that the box get run again. (Currently just calls notifyEnq() on the first input stream, which is a hack.) |
|
|
|
Sets the CPView for this box This is called when the CPView is created in AuroraNode.
|
|
Sets the ith input stream.
|
|
Sets the description of the ith input stream, zero-relative.
|
|
Sets the description of the ith input stream, zero-relative.
|
|
Sets the ith output stream.
|
|
Sets the description of the ith output stream, zero-relative.
|
|
Sets the description of the ith output stream, zero-relative.
|
|
Reimplemented in AggregateQBox, FilterQBox, JoinQBox, SOutputQBox, and SUnionQBox.
|
|
|
|
Sets the table associated with this box.
|
|
Set up the box. (The box must not have been setup or inited yet.) See the QBox lifecycle overview. |
|
Implemented in AggregateQBox, BSortQBox, FilterQBox, JoinQBox, LockQBox, MapQBox, ResampleQBox, RevisionAggregateQBox, RevisionFilterQBox, SControlQBox, SJoinQBox, SOutputQBox, SUnionQBox, UnionQBox, UnlockQBox, WaitForQBox, CombineQBox, DelayQBox, JoinStatic, LRWaitForQBox, ExistsQBox, InsertQBox, SelectQBox, UpdateQBox, and MySQLQBox.
|
|
|
|
|
|
Reimplemented in AggregateQBox, FilterQBox, JoinQBox, SOutputQBox, and SUnionQBox.
|
|
|
|
|
|
|
|
|
|
|
|
|