uint TupleConstantOnlyStep::nextBand(messageqcpp::ByteStream &bs) { RGData rgDataOut; uint rowCount = 0; if (!fEndOfResult) { try { bs.restart(); if (traceOn() && dlTimes.FirstReadTime().tv_sec == 0) dlTimes.setFirstReadTime(); rgDataOut.reinit(fRowGroupOut, 1); fRowGroupOut.setData(&rgDataOut); fillInConstants(); fRowGroupOut.serializeRGData(bs); rowCount = fRowGroupOut.getRowCount(); } catch(const std::exception& ex) { catchHandler(ex.what(), fSessionId); if (status() == 0) status(tupleConstantStepErr); } catch(...) { catchHandler("TupleConstantStep next band caught an unknown exception", fSessionId); if (status() == 0) status(tupleConstantStepErr); } fEndOfResult = true; } else { // send an empty / error band RGData rgData(fRowGroupOut, 0); fRowGroupOut.setData(&rgData); fRowGroupOut.resetRowGroup(0); fRowGroupOut.setStatus(status()); fRowGroupOut.serializeRGData(bs); if (traceOn()) { dlTimes.setLastReadTime(); dlTimes.setEndOfInputTime(); printCalTrace(); } } return rowCount; }
uint32_t SubAdapterStep::nextBand(messageqcpp::ByteStream &bs) { RGData rgDataOut; bool more = false; uint32_t rowCount = 0; try { bs.restart(); more = fOutputDL->next(fOutputIterator, &rgDataOut); if (!more || cancelled()) { //@bug4459. while (more) more = fOutputDL->next(fOutputIterator, &rgDataOut); fEndOfResult = true; } if (more && !fEndOfResult) { fRowGroupDeliver.setData(&rgDataOut); fRowGroupDeliver.serializeRGData(bs); rowCount = fRowGroupDeliver.getRowCount(); } } catch(const std::exception& ex) { catchHandler(ex.what(), ERR_IN_DELIVERY, fErrorInfo, fSessionId); while (more) more = fOutputDL->next(fOutputIterator, &rgDataOut); fEndOfResult = true; } catch(...) { catchHandler("SubAdapterStep next band caught an unknown exception", ERR_IN_DELIVERY, fErrorInfo, fSessionId); while (more) more = fOutputDL->next(fOutputIterator, &rgDataOut); fEndOfResult = true; } if (fEndOfResult) { // send an empty / error band RGData rgData(fRowGroupDeliver, 0); fRowGroupDeliver.setData(&rgData); fRowGroupDeliver.resetRowGroup(0); fRowGroupDeliver.setStatus(status()); fRowGroupDeliver.serializeRGData(bs); } return rowCount; }
uint TupleConstantBooleanStep::nextBand(messageqcpp::ByteStream &bs) { // send an empty band RGData rgData(fRowGroupOut, 0); fRowGroupOut.setData(&rgData); fRowGroupOut.resetRowGroup(0); fRowGroupOut.setStatus(status()); fRowGroupOut.serializeRGData(bs); if (traceOn()) { dlTimes.setFirstReadTime(); dlTimes.setLastReadTime(); dlTimes.setEndOfInputTime(); printCalTrace(); } return 0; }
uint TupleConstantStep::nextBand(messageqcpp::ByteStream &bs) { RGData rgDataIn; RGData rgDataOut; bool more = false; uint rowCount = 0; try { bs.restart(); more = fInputDL->next(fInputIterator, &rgDataIn); if (traceOn() && dlTimes.FirstReadTime().tv_sec == 0) dlTimes.setFirstReadTime(); if (!more && cancelled()) { fEndOfResult = true; } if (more && !fEndOfResult) { fRowGroupIn.setData(&rgDataIn); rgDataOut.reinit(fRowGroupOut, fRowGroupIn.getRowCount()); fRowGroupOut.setData(&rgDataOut); fillInConstants(); fRowGroupOut.serializeRGData(bs); rowCount = fRowGroupOut.getRowCount(); } else { fEndOfResult = true; } } catch(const std::exception& ex) { catchHandler(ex.what(), fSessionId); if (status() == 0) status(tupleConstantStepErr); while (more) more = fInputDL->next(fInputIterator, &rgDataIn); fEndOfResult = true; } catch(...) { catchHandler("TupleConstantStep next band caught an unknown exception", fSessionId); if (status() == 0) status(tupleConstantStepErr); while (more) more = fInputDL->next(fInputIterator, &rgDataIn); fEndOfResult = true; } if (fEndOfResult) { // send an empty / error band RGData rgData(fRowGroupOut, 0); fRowGroupOut.setData(&rgData); fRowGroupOut.resetRowGroup(0); fRowGroupOut.setStatus(status()); fRowGroupOut.serializeRGData(bs); if (traceOn()) { dlTimes.setLastReadTime(); dlTimes.setEndOfInputTime(); printCalTrace(); } } return rowCount; }