示例#1
0
vector<T> CollectTask<T>::run()
{
	IteratorSeq<T> *iter = RDDTask< T, vector<T> >::rdd->iteratorSeq(RDDTask< T, vector<T> >::partition);
//	if(iter.type == 0)
//	{
//		vector<T> *tmp = new vector<T>;
//		T start = iter.getStart();
//		T end = iter.getEnd();
//		T step = iter.getStep();
//		T i = start;
//		for(; i<end; i+=step)
//			tmp->push_back(i);
//
//		if(i == end && iter.isInclusive() == 1)
//			tmp->push_back(end);
//
//		return *tmp;
//	}
//	// type = 1
	return iter->getVector();
}
示例#2
0
bool IteratorSeq<T>::operator==(const IteratorSeq<T> &s) const {
	return (this->getType() == s.getType() // the same type
			&& this->size() == s.size() // the same number of elements
			&& this->getVector() == s.getVector()); // and the same data set
}