Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

AuroraNode Class Reference

#include <AuroraNode.h>

List of all members.


Detailed Description

An Aurora server node.

An AuroraNode contains a catalog and a scheduler, and a manager for dequeuers (see getDequeueHandle()).

Thread safety requirements:

  1. Construction, modifyNetwork(), start(), and destruction are not thread-safe. No other operation except dequeue() may be pending during these operations.

  2. shutdown(), typecheck(), validate(), and all accessors (e.g., describe(), listEntities(), getBoxes(), etc.) may be invoked at any time, except as described in #1.

  3. getDequeueHandle(), and all methods of DequeueHandle, are thread-safe, except as described in #1. For a single DequeueHandle, only one thread may invoke its dequeue() method at any given time. All DequeueHandles must be destroyed before shutdown() is called.

  4. For any given stream name, only one thread may invoke enqueue() at any given time. (Two threads may simultaneously invoke enqueue with different stream names, however.)


Public Types

typedef ::StreamProperties StreamProperties
enum  EntityType {
  STREAM = 1, SCHEMA = 2, BOX = 3, INPUT_STREAMS = 100,
  OUTPUT_STREAMS = 101
}
 An enumeration of the types of entities stored in a catalog. More...

Public Member Functions

 AuroraNode (ptr< ConfFile > conf=ptr< ConfFile >()) throw ( AuroraException )
 Creates a node.
 ~AuroraNode ()
 Destroys the node.
void modifyNetwork (string data, BoxPackage &boxes) throw ( AuroraException )
 Makes a modification to the network.
void load_box (string file_path) throw ( AuroraException )
 Dynamically load box code from a shared object.
void typecheck (string data, map< string, TupleDescription > &streams) throw ( AuroraException )
 Typechecks a potential modification to the network, outputting the tuple descriptions of any output streams that would be created.
void enqueue (const char *stream_name, const void *data, size_t tuple_length, size_t num_tuples, const void *schema_uuid=0) throw ( AuroraException )
 Enqueue tuples to a stream.
DequeueHandle getDequeueHandle ()
 Allocate a new handle for dequeuing.
void start () throw ( AuroraException )
 Starts the network.
void shutdown () throw ( AuroraException )
 Shuts down the network.
void typecheck (string data, vector< StreamProperties > &streams) throw ( AuroraException )
 Typechecks a potential modification to the network, outputting properties of all streams in the network.
void validate (string data) throw ( AuroraException )
 Validates a potential modification to the network.
StreamProperties getStreamProperties (string entity) throw ( AuroraException )
 Returns a description of a stream, throwing an exception if the stream does not exist.
string describe (string entity) throw ( AuroraException )
 Returns an XML description of an entity, or an empty string if the method does not exist.
void listEntities (EntityType type, vector< string > &names) throw ( AuroraException )
 Lists all entities of a particular type.
void drain () throw ( AuroraException )
 Drains the network: waits until there are no more tuples at all in the network and then shuts the network.
void chokeBoxes (vector< string > names)
 Chokes off inputs to the given boxes.
void suspendBoxes (vector< string > names)
 Chokes off inputs to the given boxes.
void resumeBoxes (vector< string > names)
 Resumes any inputs previously choked.
void packBoxes (string data, BoxPackage &boxes) throw ( AuroraException )
 Populates the package with frozen box states.
void checkpoint (vector< long long > &measurements)
 Take a snapshot of the state of the complete query network The measurements parameter is temporarily here so we can register the duration of checkpointing.
void recover ()
 Recover state of query network from last snapshot.
void schedule_checkpoint_task (ptr< GenericCheckpointTask > task)
 Helper function to scheduler either a checkpoint or a recovery task.
string repr () const
 Returns a multi-line string representation of the node.
StatisticsgetStatsObject ()
 Return the statistics object.
const StatisticsgetStatsObject () const
set< ptr< QBox > > getBoxes () const
 Returns a set of all the boxes presently in the network.
ptr< QBoxgetBox (string name) const
 Returns a box with a particular name, or null if it doesn't exist.
ptr< StreamgetStream (string name) const
 Returns a stream with a particular name, or null if it doesn't exist.
ptr< LockSetgetLockSet (string name)
 Returns a lockset with a particular name, creating a new one if it doesn't exist.
TupleDescription getTupleDescription (string name) const
 Returns a schema with a particular name, or null if it doesn't exist.
TupleDescription getTupleDescriptionByHash (string hash) const
 Returns a schema with a particular hash.
ptr< StreamcreateStream (string name, TupleDescription desc) throw ( AuroraException )
 Creates a stream with a particular name and schema.
void create_cpview (CPViewDescription view_desc, StreamDef streamdef) throw ( AuroraException )
 Creates a connection point.
ptr< ConfFilegetProperties () const throw ( AuroraException )
 Returns the properties for the node (or 0 if there are no properties available).
unsigned int xGetInputQueueLengthSum () const
 Returns the sum of all TupleQueues attached to all input streams.
string getNetworkAsDot () const
string getNetworkAsDotSubgraph (string prefix, string attrs) const
string getNetworkAsDotStatements (string prefix) const
PagePoolgetPagePool ()
const CpuStatsgetCpuStats () const

Public Attributes

double selval
StatsMgr sm
 Statistics manager that keeps all the statistics per this node.


Member Typedef Documentation

typedef ::StreamProperties AuroraNode::StreamProperties
 


Member Enumeration Documentation

enum AuroraNode::EntityType
 

An enumeration of the types of entities stored in a catalog.

Enumeration values:
STREAM  A stream.
SCHEMA  A schema.
BOX  A box.
INPUT_STREAMS  Pseudo-entity-type for input streams only (in listEntities()).
OUTPUT_STREAMS  Pseudo-entity-type for output streams only, i.e., streams with no boxes downstream (in listEntities()).


Constructor & Destructor Documentation

AuroraNode::AuroraNode ptr< ConfFile conf = ptr< ConfFile >()  )  throw ( AuroraException )
 

Creates a node.

AuroraNode::~AuroraNode  ) 
 

Destroys the node.


Member Function Documentation

void AuroraNode::checkpoint vector< long long > &  measurements  ) 
 

Take a snapshot of the state of the complete query network The measurements parameter is temporarily here so we can register the duration of checkpointing.

void AuroraNode::chokeBoxes vector< string >  names  ) 
 

Chokes off inputs to the given boxes.

void AuroraNode::create_cpview CPViewDescription  view_desc,
StreamDef  streamdef
throw ( AuroraException )
 

Creates a connection point.

ptr< Stream > AuroraNode::createStream string  name,
TupleDescription  desc
throw ( AuroraException )
 

Creates a stream with a particular name and schema.

Currently may only be invoked before the network is started.

string AuroraNode::describe string  entity  )  throw ( AuroraException )
 

Returns an XML description of an entity, or an empty string if the method does not exist.

void AuroraNode::drain  )  throw ( AuroraException )
 

Drains the network: waits until there are no more tuples at all in the network and then shuts the network.

Blocks until this is complete. Throws an exception if the scheduler does not support draining.

void AuroraNode::enqueue const char *  stream_name,
const void *  data,
size_t  tuple_length,
size_t  num_tuples,
const void *  schema_uuid = 0
throw ( AuroraException )
 

Enqueue tuples to a stream.

The stream must not be tied to the output of any box in the network.

Parameters:
stream_name the name of the stream to which to enqueue
data a buffer containing the data to enqueue. Each tuple must be preceded by twelve bytes of padding (the padding bytes are accounted for in TupleDescription).
tuple_length the length of each tuple in the buffer. Must match the TupleDescription of the stream currently in the catalog
num_tuples the number of tuples to enqueue
schema_uuid if provided, the UUID of the stream's schema, which is checked for consistency. Not checked if schema_uuid is null, or it points to a block of all zeroes

ptr<QBox> AuroraNode::getBox string  name  )  const
 

Returns a box with a particular name, or null if it doesn't exist.

set< ptr< QBox > > AuroraNode::getBoxes  )  const
 

Returns a set of all the boxes presently in the network.

const CpuStats& AuroraNode::getCpuStats  )  const
 

AuroraNode::DequeueHandle AuroraNode::getDequeueHandle  ) 
 

Allocate a new handle for dequeuing.

ptr< LockSet > AuroraNode::getLockSet string  name  ) 
 

Returns a lockset with a particular name, creating a new one if it doesn't exist.

string AuroraNode::getNetworkAsDot  )  const
 

string AuroraNode::getNetworkAsDotStatements string  prefix  )  const
 

string AuroraNode::getNetworkAsDotSubgraph string  prefix,
string  attrs
const
 

PagePool& AuroraNode::getPagePool  ) 
 

ptr<ConfFile> AuroraNode::getProperties  )  const throw ( AuroraException )
 

Returns the properties for the node (or 0 if there are no properties available).

const Statistics& AuroraNode::getStatsObject  )  const
 

Statistics& AuroraNode::getStatsObject  ) 
 

Return the statistics object.

ptr<Stream> AuroraNode::getStream string  name  )  const
 

Returns a stream with a particular name, or null if it doesn't exist.

StreamProperties AuroraNode::getStreamProperties string  entity  )  throw ( AuroraException )
 

Returns a description of a stream, throwing an exception if the stream does not exist.

TupleDescription AuroraNode::getTupleDescription string  name  )  const
 

Returns a schema with a particular name, or null if it doesn't exist.

TupleDescription AuroraNode::getTupleDescriptionByHash string  hash  )  const
 

Returns a schema with a particular hash.

void AuroraNode::listEntities EntityType  type,
vector< string > &  names
throw ( AuroraException )
 

Lists all entities of a particular type.

(One can then use "describe" to obtain a description of an entity.) names is cleared first.

void AuroraNode::load_box string  file_path  )  throw ( AuroraException )
 

Dynamically load box code from a shared object.

Parameters:
file_path File path to a shared library, containing box code.

void AuroraNode::modifyNetwork string  data,
BoxPackage &  boxes
throw ( AuroraException )
 

Makes a modification to the network.

If the scheduler does not support dynamic networks, the network must not have been started yet.

Parameters:
data An XML document rooted with a <modify> tag
boxes Holds the state of the box being modified.

void AuroraNode::packBoxes string  data,
BoxPackage &  boxes
throw ( AuroraException )
 

Populates the package with frozen box states.

void AuroraNode::recover  ) 
 

Recover state of query network from last snapshot.

string AuroraNode::repr  )  const
 

Returns a multi-line string representation of the node.

void AuroraNode::resumeBoxes vector< string >  names  ) 
 

Resumes any inputs previously choked.

void AuroraNode::schedule_checkpoint_task ptr< GenericCheckpointTask task  ) 
 

Helper function to scheduler either a checkpoint or a recovery task.

void AuroraNode::shutdown  )  throw ( AuroraException )
 

Shuts down the network.

void AuroraNode::start  )  throw ( AuroraException )
 

Starts the network.

void AuroraNode::suspendBoxes vector< string >  names  ) 
 

Chokes off inputs to the given boxes.

void AuroraNode::typecheck string  data,
vector< StreamProperties > &  streams
throw ( AuroraException )
 

Typechecks a potential modification to the network, outputting properties of all streams in the network.

streams is cleared first.

void AuroraNode::typecheck string  data,
map< string, TupleDescription > &  streams
throw ( AuroraException )
 

Typechecks a potential modification to the network, outputting the tuple descriptions of any output streams that would be created.

This method may be called even if the network has been started.

Parameters:
data an XML document rooted with a <modify> tag.
streams a map of stream names to descriptions

void AuroraNode::validate string  data  )  throw ( AuroraException )
 

Validates a potential modification to the network.

Returns successfully if the modification is guaranteed to result in a complete, valid network.

unsigned int AuroraNode::xGetInputQueueLengthSum  )  const
 

Returns the sum of all TupleQueues attached to all input streams.


Member Data Documentation

double AuroraNode::selval
 

StatsMgr AuroraNode::sm
 

Statistics manager that keeps all the statistics per this node.

this should be private, but locking/unlocking creates some issues need to ask Ying what the appropriate approach would be (i.e. if it is safe to have multiple classes having access to the same object).


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:23 2004 for Borealis by doxygen 1.3.8