本文整理汇总了C++中hashtable::Iterator::readnext方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::readnext方法的具体用法?C++ Iterator::readnext怎么用?C++ Iterator::readnext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hashtable::Iterator
的用法示例。
在下文中一共展示了Iterator::readnext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: simdprobeCursor
WriteTable* StoreCopy::simdprobeCursor(PageCursor* t, int threadid, WriteTable* ret)
{
if (ret == NULL) {
ret = new WriteTable();
ret->init(sout, outputsize);
}
char tmp[sout->getTupleSize()];
void* tup1;
void* tup2;
Page* b2;
unsigned int curbuc, i;
HashTable::Iterator it = hashtable.createIterator();
while (b2 = (atomic ? t->atomicReadNext() : t->readNext())) {
i = 0;
while (tup2 = b2->getTupleOffset(i++)) {
curbuc = _hashfn->hash(s2->asLong(tup2, ja2));
hashtable.placeIterator(it, curbuc);
while (tup1 = it.readnext()) {
if (sbuild->asLong(tup1,0) != s2->asLong(tup2,ja2) ) {
continue;
}
#if defined(OUTPUT_ASSEMBLE)
// copy payload of first tuple to destination
if (s1->getTupleSize())
s1->copyTuple(tmp, sbuild->calcOffset(tup1,1));
// copy each column to destination
for (unsigned int j=0; j<sel2.size(); ++j)
sout->writeData(tmp, // dest
s1->columns()+j, // col in output
s2->calcOffset(tup2, sel2[j])); // src for this col
#if defined(OUTPUT_WRITE_NORMAL)
ret->append(tmp);
#endif
#endif
}
}
}
return ret;
}
示例2: realprobeCursor
WriteTable* StoreCopy::realprobeCursor(PageCursor* t, int threadid, WriteTable* ret)
{
if (ret == NULL) {
ret = new WriteTable();
ret->init(sout, outputsize);
}
char tmp[sout->getTupleSize()];
void* tup1;
void* tup2;
Page* b2;
unsigned int curbuc, i;
HashTable::Iterator it = hashtable.createIterator();
t->reset(); // added by yipeng to produce output in 1 thread
while (b2 = (atomic ? t->atomicReadNext() : t->readNext())) {
#ifdef VERBOSE
cout << "Working on page " << b2 << endl;
cout << "Thread " << threadid << endl;
#endif
i = 0;
while (tup2 = b2->getTupleOffset(i++)) {
#ifdef VERBOSE
cout << "Joining tuple " << b2 << ":"
<< setfill('0') << setw(6) << i
<< " having key " << s2->asLong(tup2, ja2) << endl;
#endif
curbuc = _hashfn->hash(s2->asLong(tup2, ja2));
#ifdef VERBOSE
cout << "\twith bucket " << setfill('0') << setw(6) << curbuc << endl;
#endif
hashtable.placeIterator(it, curbuc);
#ifdef PREFETCH
#warning Only works for 16-byte tuples!
hashtable.prefetch(_hashfn->hash(
*(unsigned long long*)(((char*)tup2)+32)
));
hashtable.prefetch(_hashfn->hash(
*(unsigned long long*)(((char*)tup2)+64)
));
#endif
while (tup1 = it.readnext()) {
if (sbuild->asLong(tup1,0) != s2->asLong(tup2,ja2) ) {
continue;
}
// copy payload of first tuple to destination
if (s1->getTupleSize())
s1->copyTuple(tmp, sbuild->calcOffset(tup1,1));
// copy each column to destination
for (unsigned int j=0; j<sel2.size(); ++j)
sout->writeData(tmp, // dest
s1->columns()+j, // col in output
s2->calcOffset(tup2, sel2[j])); // src for this col
ret->append(tmp);
#ifdef OUTPUT_WRITE_NT
ret->nontemporalappend16(tmp);
#endif
#if defined(OUTPUT_AGGREGATE)
aggregator[ (threadid * AGGLEN) +
+ (sbuild->asLong(tup1,0) & (AGGLEN-1)) ]++;
#endif
#if !defined(OUTPUT_AGGREGATE) && !defined(OUTPUT_ASSEMBLE)
__asm__ __volatile__ ("nop");
#endif
}
}
}
return ret;
}