use of edu.uci.ics.textdb.exp.source.scan.ScanSourcePredicate in project textdb by TextDB.
the class SamplerTest method matchSamplerTable.
/*
* To test if the sampled tuples are equal to the first K tuples of the sampler table
* in both the order and content.
*/
public static boolean matchSamplerTable(List<Tuple> sampleList) throws TextDBException {
ScanBasedSourceOperator scanSource = new ScanBasedSourceOperator(new ScanSourcePredicate(SAMPLER_TABLE));
scanSource.open();
ListIterator<Tuple> iter = null;
iter = sampleList.listIterator();
while (iter.hasNext()) {
Tuple nextTableTuple = scanSource.getNextTuple();
Tuple nextSampledTuple = iter.next();
if (!nextSampledTuple.equals(nextTableTuple)) {
scanSource.close();
return false;
}
}
scanSource.close();
return true;
}
Aggregations