TurtleDB
A mini distributed database system
|
Public Member Functions | |
abstract Schema | getSchema () |
final int | getDegree () |
void | setStreamingMode (boolean b) |
final RelationIterator | iterator () |
String | toString () |
abstract void | accept (QueryVisitor v) throws QueryVisitor.VisitorException |
int | getCardinality () |
abstract int | tupleCount () |
boolean | contains (Tuple tup) |
abstract RelationIterator | streamIterator () |
abstract RelationIterator | cacheIterator () |
boolean | isFragment () |
boolean | isLeaf () |
Public Attributes | |
boolean | m_streamingMode = false |
Protected Member Functions | |
Relation () |
A relation is implemented as a map from a set of tuples (the relation's key) to a set of tuples
Definition at line 28 of file Relation.java.
ca.uqac.dim.turtledb.Relation.Relation | ( | ) | [protected] |
Empty constructor. Should only be called from children's constructors.
Definition at line 47 of file Relation.java.
abstract void ca.uqac.dim.turtledb.Relation.accept | ( | QueryVisitor | v | ) | throws QueryVisitor.VisitorException [pure virtual] |
abstract RelationIterator ca.uqac.dim.turtledb.Relation.cacheIterator | ( | ) | [pure virtual] |
Returns an iterator over tuples of the relation
Implemented in ca.uqac.dim.turtledb.Table, ca.uqac.dim.turtledb.VariableTable, ca.uqac.dim.turtledb.Join, ca.uqac.dim.turtledb.Projection, ca.uqac.dim.turtledb.Selection, ca.uqac.dim.turtledb.Intersection, ca.uqac.dim.turtledb.Product, and ca.uqac.dim.turtledb.Union.
boolean ca.uqac.dim.turtledb.Relation.contains | ( | Tuple | tup | ) |
Determines if a relation contains a given tuple. Warning #1: this implementation is inefficient, as it enumerates all tuples until found. Warning #2: using contains resets any undergoing enumeration made on the relation.
tup | The tuple to look for |
Reimplemented in ca.uqac.dim.turtledb.Table.
Definition at line 148 of file Relation.java.
Computes the cardinality of a relation. Except for instances of Table (which actually contain concrete tuples), calling this method will trigger the evaluation of the query tree and the enumeration of all tuples. It should be used sparingly.
Reimplemented in ca.uqac.dim.turtledb.Table.
Definition at line 120 of file Relation.java.
final int ca.uqac.dim.turtledb.Relation.getDegree | ( | ) |
A relation's degree is the size of its schema.
Definition at line 56 of file Relation.java.
abstract Schema ca.uqac.dim.turtledb.Relation.getSchema | ( | ) | [pure virtual] |
Returns the relation's schema
Implemented in ca.uqac.dim.turtledb.Table, ca.uqac.dim.turtledb.VariableTable, ca.uqac.dim.turtledb.NAryRelation, ca.uqac.dim.turtledb.Join, ca.uqac.dim.turtledb.Projection, ca.uqac.dim.turtledb.Selection, and ca.uqac.dim.turtledb.Product.
boolean ca.uqac.dim.turtledb.Relation.isFragment | ( | ) |
Determines if the query tree is a fragment. This is the case when the tree's root is a VariableTable.
Reimplemented in ca.uqac.dim.turtledb.VariableTable.
Definition at line 180 of file Relation.java.
boolean ca.uqac.dim.turtledb.Relation.isLeaf | ( | ) |
Determines if a given operator is at the leaf of the query tree. Only instances of Table and VariableTable may be leaves.
Reimplemented in ca.uqac.dim.turtledb.Table, and ca.uqac.dim.turtledb.VariableTable.
Definition at line 191 of file Relation.java.
Definition at line 70 of file Relation.java.
void ca.uqac.dim.turtledb.Relation.setStreamingMode | ( | boolean | b | ) |
Sets the way of querying the relation's tuples
b | True to evaluate in streaming mode, false otherwise |
Definition at line 65 of file Relation.java.
abstract RelationIterator ca.uqac.dim.turtledb.Relation.streamIterator | ( | ) | [pure virtual] |
Returns an iterator over tuples of the relation
Implemented in ca.uqac.dim.turtledb.VariableTable, ca.uqac.dim.turtledb.Table, ca.uqac.dim.turtledb.Join, ca.uqac.dim.turtledb.Projection, ca.uqac.dim.turtledb.Selection, ca.uqac.dim.turtledb.Intersection, ca.uqac.dim.turtledb.Product, and ca.uqac.dim.turtledb.Union.
String ca.uqac.dim.turtledb.Relation.toString | ( | ) |
Pretty-prints a relation to a string
Reimplemented in ca.uqac.dim.turtledb.VariableTable.
Definition at line 81 of file Relation.java.
abstract int ca.uqac.dim.turtledb.Relation.tupleCount | ( | ) | [pure virtual] |
Returns the number of actual tuples present in the query. This number is different from the cardinality of the query; it counts the number of tuples that are present in the leaves of the query tree.
Implemented in ca.uqac.dim.turtledb.Table, ca.uqac.dim.turtledb.VariableTable, ca.uqac.dim.turtledb.NAryRelation, ca.uqac.dim.turtledb.BinaryRelation, ca.uqac.dim.turtledb.Join, and ca.uqac.dim.turtledb.UnaryRelation.
boolean ca.uqac.dim.turtledb.Relation.m_streamingMode = false |
Whether the enumeration of the relation's tuples is performed in "streaming" mode (vs. "cache" mode)
Definition at line 35 of file Relation.java.