iterator
Class NestedLoopsJoins
java.lang.Object
iterator.Iterator
iterator.NestedLoopsJoins
- All Implemented Interfaces:
- Flags
- public class NestedLoopsJoins
- extends Iterator
This file contains an implementation of the nested loops join
algorithm as described in the Shapiro paper.
The algorithm is extremely simple:
foreach tuple r in R do
foreach tuple s in S do
if (ri == sj) then add (r, s) to the result.
Constructor Summary |
NestedLoopsJoins(AttrType[] in1,
int len_in1,
short[] t1_str_sizes,
AttrType[] in2,
int len_in2,
short[] t2_str_sizes,
int amt_of_mem,
Iterator am1,
java.lang.String relationName,
CondExpr[] outFilter,
CondExpr[] rightFilter,
FldSpec[] proj_list,
int n_out_flds)
constructor
Initialize the two relations which are joined, including relation type, |
Method Summary |
void |
close()
implement the abstract method close() from super class Iterator
to finish cleaning up |
Tuple |
get_next()
abstract method, every subclass must implement it. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NestedLoopsJoins
public NestedLoopsJoins(AttrType[] in1,
int len_in1,
short[] t1_str_sizes,
AttrType[] in2,
int len_in2,
short[] t2_str_sizes,
int amt_of_mem,
Iterator am1,
java.lang.String relationName,
CondExpr[] outFilter,
CondExpr[] rightFilter,
FldSpec[] proj_list,
int n_out_flds)
throws java.io.IOException,
NestedLoopException
- constructor
Initialize the two relations which are joined, including relation type,
- Parameters:
in1
- Array containing field types of R.len_in1
- # of columns in R.t1_str_sizes
- shows the length of the string fields.in2
- Array containing field types of Slen_in2
- # of columns in St2_str_sizes
- shows the length of the string fields.amt_of_mem
- IN PAGESam1
- access method for left i/p to joinrelationName
- access hfapfile for right i/p to joinoutFilter
- select expressionsrightFilter
- reference to filter applied on right i/pproj_list
- shows what input fields go where in the output tuplen_out_flds
- number of outer relation fileds
- Throws:
java.io.IOException
- some I/O fault
NestedLoopException
- exception from this class
get_next
public Tuple get_next()
throws java.io.IOException,
JoinsException,
index.IndexException,
InvalidTupleSizeException,
InvalidTypeException,
PageNotReadException,
TupleUtilsException,
PredEvalException,
SortException,
LowMemException,
UnknowAttrType,
UnknownKeyTypeException,
java.lang.Exception
- Description copied from class:
Iterator
- abstract method, every subclass must implement it.
- Specified by:
get_next
in class Iterator
- Returns:
- The joined tuple is returned
- Throws:
java.io.IOException
- I/O errors
JoinsException
- some join exception
index.IndexException
- exception from super class
InvalidTupleSizeException
- invalid tuple size
InvalidTypeException
- tuple type not valid
PageNotReadException
- exception from lower layer
TupleUtilsException
- exception from using tuple utilities
PredEvalException
- exception from PredEval class
SortException
- sort exception
LowMemException
- memory error
UnknowAttrType
- attribute type unknown
UnknownKeyTypeException
- key type unknown
java.lang.Exception
- other exceptions
close
public void close()
throws JoinsException,
java.io.IOException,
index.IndexException
- implement the abstract method close() from super class Iterator
to finish cleaning up
- Specified by:
close
in class Iterator
- Throws:
java.io.IOException
- I/O error from lower layers
JoinsException
- join error from lower layers
index.IndexException
- index access error