Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
uint32_t TupleUnion::nextBand(messageqcpp::ByteStream &bs)
{
	RGData mem;
	bool more;
	uint32_t ret = 0;

	bs.restart();
	more = output->next(outputIt, &mem);
	if (more)
		outputRG.setData(&mem);
	else {
		mem = RGData(outputRG, 0);
		outputRG.setData(&mem);
		outputRG.resetRowGroup(0);
		outputRG.setStatus(status());
	}
	outputRG.serializeRGData(bs);
	ret = outputRG.getRowCount();

	return ret;
}
Esempio n. 4
0
uint32_t TupleHavingStep::nextBand(messageqcpp::ByteStream &bs)
{
	RGData rgDataIn;
	RGData rgDataOut;
	bool more = false;
	uint32_t rowCount = 0;

	try
	{
		bs.restart();

		more = fInputDL->next(fInputIterator, &rgDataIn);
		if (dlTimes.FirstReadTime().tv_sec ==0)
            dlTimes.setFirstReadTime();

		if (!more || cancelled())
		{
			fEndOfResult = true;
		}

		bool emptyRowGroup = true;
		while (more && !fEndOfResult && emptyRowGroup)
		{
			if (cancelled())
			{
				while (more)
					more = fInputDL->next(fInputIterator, &rgDataIn);
				break;
			}

			fRowGroupIn.setData(&rgDataIn);
			rgDataOut.reinit(fRowGroupOut, fRowGroupIn.getRowCount());
			fRowGroupOut.setData(&rgDataOut);

			doHavingFilters();

			if (fRowGroupOut.getRowCount() > 0)
			{
				emptyRowGroup = false;
				fRowGroupOut.serializeRGData(bs);
				rowCount = fRowGroupOut.getRowCount();
			}
			else
			{
				more = fInputDL->next(fInputIterator, &rgDataIn);
			}
		}

		if (!more)
		{
			fEndOfResult = true;
		}
	}
	catch(const std::exception& ex)
	{
		catchHandler(ex.what(), tupleHavingStepErr, fErrorInfo, fSessionId);
		while (more)
			more = fInputDL->next(fInputIterator, &rgDataIn);
		fEndOfResult = true;
	}
	catch(...)
	{
		catchHandler("TupleHavingStep next band caught an unknown exception",
					 tupleHavingStepErr, fErrorInfo, fSessionId);
		while (more)
			more = fInputDL->next(fInputIterator, &rgDataIn);
		fEndOfResult = true;
	}

	if (fEndOfResult)
	{
		// send an empty / error band
		rgDataOut.reinit(fRowGroupOut, 0);
		fRowGroupOut.setData(&rgDataOut);
		fRowGroupOut.resetRowGroup(0);
		fRowGroupOut.setStatus(status());
		fRowGroupOut.serializeRGData(bs);

		dlTimes.setLastReadTime();
		dlTimes.setEndOfInputTime();

		if (traceOn())
			printCalTrace();
	}

	return rowCount;
}
Esempio n. 5
0
uint TupleAnnexStep::nextBand(messageqcpp::ByteStream &bs)
{
    RGData rgDataOut;
    bool more = false;
    uint rowCount = 0;

    try
    {
        bs.restart();

        more = fOutputDL->next(fOutputIterator, &rgDataOut);
        if (traceOn() && dlTimes.FirstReadTime().tv_sec ==0)
            dlTimes.setFirstReadTime();

        if (more && !cancelled())
        {
            fRowGroupDeliver.setData(&rgDataOut);
            fRowGroupDeliver.serializeRGData(bs);
            rowCount = fRowGroupDeliver.getRowCount();
        }
        else
        {
            if (more)
                more = fOutputDL->next(fOutputIterator, &rgDataOut);
            fEndOfResult = true;
        }
    }
    catch(const std::exception& ex)
    {
        catchHandler(ex.what(), fSessionId);
        if (status() == 0)
            status(ERR_IN_DELIVERY);
        while (more)
            more = fOutputDL->next(fOutputIterator, &rgDataOut);
        fEndOfResult = true;
    }
    catch(...)
    {
        catchHandler("TupleAnnexStep next band caught an unknown exception", fSessionId);
        if (status() == 0)
            status(ERR_IN_DELIVERY);
        while (more)
            more = fOutputDL->next(fOutputIterator, &rgDataOut);
        fEndOfResult = true;
    }

    if (fEndOfResult)
    {
        // send an empty / error band
        rgDataOut.reinit(fRowGroupDeliver, 0);
        fRowGroupDeliver.setData(&rgDataOut);
        fRowGroupDeliver.resetRowGroup(0);
        fRowGroupDeliver.setStatus(status());
        fRowGroupDeliver.serializeRGData(bs);

        if (traceOn())
        {
            dlTimes.setLastReadTime();
            dlTimes.setEndOfInputTime();
        }

        if (traceOn())
            printCalTrace();
    }

    return rowCount;
}