CATCH_NEXTROW()
 {
     ActivityTimer t(totalCycles, timeActivities);
     if (!abortSoon)
     {
         if (firstget)
         {
             firstget = false;
             while (skipped<skipCount)
             {
                 OwnedConstThorRow row = input->ungroupedNextRow();
                 if (!row)
                 {
                     stop();
                     return NULL;
                 }
                 skipped++;
             }
         }
         if (getDataLinkCount() < limit)
         {
             OwnedConstThorRow row = input->ungroupedNextRow();
             if (row)
             {
                 dataLinkIncrement();
                 return row.getClear();
             }
         }
         stop(); // NB: really whatever is pulling, should stop asap.
     }
     return NULL;
 }
void CThorDataLink::initMetaInfo(ThorDataLinkMetaInfo &info)
{
    memset(&info,0,sizeof(info));
    //info.rowsdone = xx;
    info.totalRowsMin = 0;          
    info.totalRowsMax = -1; // rely on inputs to set
    info.spilled = (offset_t)-1;
    info.byteTotal = (offset_t)-1;
    info.rowsOutput = getDataLinkCount();
    // more
}
 void ensureSendCount()
 {
     if (hasStarted() && !isLookAheadActive(0))
         sendOnce(getDataLinkCount() + skipped);
 }
Example #4
0
 void stop()
 {
     stopInput(getDataLinkCount());
     dataLinkStop();
 }
 const void *nextRowGENoCatch(const void *seek, unsigned numFields, bool &wasCompleteMatch, const SmartStepExtra &stepExtra)
 {
     ActivityTimer t(totalCycles, timeActivities, NULL);
     OwnedConstThorRow ret = input->nextRowGE(seek, numFields, wasCompleteMatch, stepExtra);
     if (ret && prev && stepCompare->docompare(prev, ret, numFields) > 0)
     {
         // MORE - better to give mismatching rows than indexes?
         throw MakeActivityException(this, TE_NotSorted, "detected incorrectly sorted rows (row %"RCPF"d,  %"RCPF"d))", getDataLinkCount(), getDataLinkCount()+1);
     }
     prev.set(ret);
     if (ret)
         dataLinkIncrement();
     return ret.getClear();
 }
 CATCH_NEXTROW()
 {
     ActivityTimer t(totalCycles, timeActivities, NULL);
     OwnedConstThorRow ret = input->nextRow();
     if (ret && prev && icompare->docompare(prev, ret) > 0)
     {
         // MORE - better to give mismatching rows than indexes?
         throw MakeActivityException(this, TE_NotSorted, "detected incorrectly sorted rows (row %"RCPF"d,  %"RCPF"d))", getDataLinkCount(), getDataLinkCount()+1);
     }
     prev.set(ret);
     if (ret)
         dataLinkIncrement();
     return ret.getClear();
 }
Example #7
0
 virtual void stop() override
 {
     stopInput(getDataLinkCount());
 }