TurtleDB
A mini distributed database system
ca.uqac.dim.turtledb.Engine Class Reference
Collaboration diagram for ca.uqac.dim.turtledb.Engine:

List of all members.

Public Member Functions

 Engine (String name)
void putRelation (String name, Relation r)
void addQuery (Relation query)
void addQuery (Collection< Relation > queries)
Set< RelationprocessPendingQueries ()
QueryPlan getQueryPlan (Relation query)
Table evaluate (Relation query)
Table evaluate (String s)
Table evaluate (Document d)
int getStorageSize ()
int getTuplesReceived ()

Protected Attributes

Map< String, Relationm_tables
List< Relationm_pendingQueries
int m_numTuplesReceived
String m_siteName

Detailed Description

An engine does two things:

  1. It locally hosts relations (or fragments thereof)
  2. It receives relational query trees and evaluates them against the locally-hosted relations, then outputs the resulting relation
Author:
sylvain

Definition at line 38 of file Engine.java.


Constructor & Destructor Documentation

Instantiates a new database query engine.

Definition at line 60 of file Engine.java.


Member Function Documentation

Add a query to process.

Parameters:
queryThe query

Definition at line 85 of file Engine.java.

void ca.uqac.dim.turtledb.Engine.addQuery ( Collection< Relation queries)

Add a set of queries. This is just the repeated application of addQuery to every element of the collection.

Parameters:
queriesThe collection of queries to add

Definition at line 149 of file Engine.java.

Locally evaluates a query

Parameters:
queryThe query XML document
Returns:
A new table containing the results of that query

Definition at line 215 of file Engine.java.

Locally evaluates a query

Parameters:
sThe query string
Returns:
A new table containing the results of that query

Definition at line 240 of file Engine.java.

Definition at line 254 of file Engine.java.

Creates a query plan from a given query

Parameters:
queryThe query to execute
Returns:
The query plan

Definition at line 204 of file Engine.java.

Returns the total number of tuples hosted locally by this database engine. This can be used, in conjunction with getTuplesReceived, to compute cost metrics.

Returns:
The number of tuples

Definition at line 274 of file Engine.java.

Returns the number of tuples this engine received from the outside world. This can be used, in conjunction with getStorageSize, to compute cost metrics.

Returns:
The number of tuples

Definition at line 291 of file Engine.java.

Process any pending queries

Returns:
The results of queries that have been processed

Definition at line 159 of file Engine.java.

void ca.uqac.dim.turtledb.Engine.putRelation ( String  name,
Relation  r 
)

Stores a new relation within the engine. Normally one would only store instances of Table here (although any relation can be passed).

Parameters:
nameThe relation's name
rThe relation

Definition at line 76 of file Engine.java.


Member Data Documentation

The total number of tuples received by this site

Definition at line 50 of file Engine.java.

The list of query plans that await computation

Definition at line 45 of file Engine.java.

The site's name

Definition at line 55 of file Engine.java.

Definition at line 40 of file Engine.java.


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