• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ OwnedConstThorRow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中OwnedConstThorRow的典型用法代码示例。如果您正苦于以下问题:C++ OwnedConstThorRow类的具体用法?C++ OwnedConstThorRow怎么用?C++ OwnedConstThorRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了OwnedConstThorRow类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CATCH_NEXTROW

    CATCH_NEXTROW()
    {
        ActivityTimer t(totalCycles, timeActivities);
        if (abortSoon || eof)
            return NULL;
        eof = true;

        OwnedConstThorRow next = inputStream->ungroupedNextRow();
        RtlDynamicRowBuilder resultcr(queryRowAllocator());
        size32_t sz = helper->clearAggregate(resultcr);         
        if (next)
        {
            hadElement = true;
            sz = helper->processFirst(resultcr, next);
            if (container.getKind() != TAKexistsaggregate)
            {
                while (!abortSoon)
                {
                    next.setown(inputStream->ungroupedNextRow());
                    if (!next)
                        break;
                    sz = helper->processNext(resultcr, next);
                }
            }
        }
        doStopInput();
        if (!firstNode())
        {
            OwnedConstThorRow result(resultcr.finalizeRowClear(sz));
            sendResult(result.get(),queryRowSerializer(), 1); // send partial result
            return NULL;
        }
        OwnedConstThorRow ret = getResult(resultcr.finalizeRowClear(sz));
        if (ret)
        {
            dataLinkIncrement();
            return ret.getClear();
        }
        sz = helper->clearAggregate(resultcr);  
        return resultcr.finalizeRowClear(sz);
    }
开发者ID:kenrowland,项目名称:HPCC-Platform,代码行数:41,代码来源:thaggregateslave.cpp


示例2: CATCH_NEXTROW

    CATCH_NEXTROW()
    {
        ActivityTimer t(totalCycles, timeActivities);
        loop
        {
            OwnedConstThorRow row = input->ungroupedNextRow();
            if(!row || done || abortSoon)
                break;

            switch (helper->getRecordAction(row))
            {
            case 2:
                done = true;
                //fall through
            case 1:
                dataLinkIncrement();
                return row.getClear();
            }
        }
        return NULL;        
    }
开发者ID:RobertoMalatesta,项目名称:HPCC-Platform,代码行数:21,代码来源:thchoosesetsslave.cpp


示例3: CATCH_NEXTROW

 CATCH_NEXTROW()
 {
     ActivityTimer t(totalCycles, timeActivities, NULL);
     if (abortSoon || eoi)
         return NULL;
     OwnedConstThorRow row = out->nextRow();
     if (!row)
     {
         if (!container.queryGrouped())
         {
             eoi = true;
             return NULL;
         }
         out.setown(iLoader->loadGroup(input, abortSoon));
         if (0 == iLoader->numRows())
             eoi = true;
         return NULL; // eog marker
     }
     dataLinkIncrement();
     return row.getClear();
 }
开发者ID:AsherBond,项目名称:HPCC-Platform,代码行数:21,代码来源:thgroupsortslave.cpp


示例4: process

    void process()
    {
        processed = 0;

        input = inputs.item(0);
        startInput(input);

        processed = THORDATALINK_STARTED;

        OwnedConstThorRow row = input->ungroupedNextRow();
        CMessageBuffer mb;
        size32_t lenpos = mb.length(); // its 0 really
        mb.append((size32_t)0);
        if (row) {
            CMemoryRowSerializer msz(mb);
            ::queryRowSerializer(input)->serialize(msz,(const byte *)row.get());
            size32_t sz = mb.length()-lenpos-sizeof(size32_t);
            mb.writeDirect(lenpos,sizeof(size32_t),&sz);
            processed++;
        }
        container.queryJob().queryJobComm().send(mb, 0, masterMpTag);
    }
开发者ID:smeda,项目名称:HPCC-Platform,代码行数:22,代码来源:thresultslave.cpp


示例5: CATCH_NEXTROW

 CATCH_NEXTROW()
 {
     ActivityTimer t(totalCycles, timeActivities);
     loop {
         if(abortSoon)
             break;          
         if(eogNext) {
             eogNext = false;
             count = 0;
             if (anyThisGroup) { // ignore eogNext if none in group
                 anyThisGroup = false;
                 break;
             }
         }
         
         OwnedConstThorRow row = input->nextRow();
         if (!row)   {
             count = 0;
             if (anyThisGroup) {
                 anyThisGroup = false;
                 break;
             }
             row.setown(input->nextRow());
             if (!row)
                 break;
         }
         RtlDynamicRowBuilder ret(queryRowAllocator());
         size32_t thisSize = helper->transform(ret, anyThisGroup?prev.get():defaultLeft.get(), row, ++count);
         if (thisSize != 0)  {
             const void *r = ret.finalizeRowClear(thisSize);
             prev.set(r);
             dataLinkIncrement();
             anyThisGroup = true;
             return r;
         }
     }
     return NULL;
 }
开发者ID:hhy5277,项目名称:HPCC-Platform,代码行数:38,代码来源:thgroupiterateslave.cpp


示例6: STRAND_CATCH_NEXTROW

    STRAND_CATCH_NEXTROW()
    {
        ActivityTimer t(totalCycles, timeActivities);
        loop
        {
            if (parent.queryAbortSoon())
                return nullptr;
            OwnedConstThorRow in = inputStream->nextRow();
            if (!in)
            {
                if (numProcessedLastGroup == rowsProcessed)
                    in.setown(inputStream->nextRow());
                if (!in)
                {
                    numProcessedLastGroup = rowsProcessed;
                    return nullptr;
                }
            }

            RtlDynamicRowBuilder rowBuilder(allocator);
            size32_t outSize;
            try
            {
                outSize = helper->transform(rowBuilder, in);
            }
            catch (IException *e)
            {
                parent.ActPrintLog(e, "In helper->transform()");
                throw;
            }
            if (outSize)
            {
                rowsProcessed++;
                return rowBuilder.finalizeRowClear(outSize);
            }
        }
    }
开发者ID:bolaria,项目名称:HPCC-Platform,代码行数:37,代码来源:thprojectslave.cpp


示例7: IMPLEMENT_IINTERFACE_USING

IRowStream *createFirstNReadSeqVar(IRowStream *input, unsigned limit)
{
    class CFirstNReadSeqVar : public CSimpleInterface, implements IRowStream
    {
        IRowStream *input;
        unsigned limit, c;
        bool stopped;
    public:
        IMPLEMENT_IINTERFACE_USING(CSimpleInterface);

        CFirstNReadSeqVar(IRowStream *_input, unsigned _limit) : input(_input), limit(_limit), c(0), stopped(false) { }
        ~CFirstNReadSeqVar() { ::Release(input); }

// IRowStream
        const void *nextRow()
        {
            if (c<limit)
            {
                OwnedConstThorRow row = input->nextRow();
                if (row)
                {
                    c++;
                    return row.getClear();
                }
            }
            stop();
            return NULL;
        }
        virtual void stop()
        {
            if (!stopped)
            {
                stopped = true;
                input->stop();
            }
        }
    };
开发者ID:hszander,项目名称:HPCC-Platform,代码行数:37,代码来源:thtopnslave.cpp


示例8: set

 void operator = (const OwnedConstThorRow & other) { set(other.get());  }
开发者ID:afishbeck,项目名称:HPCC-Platform,代码行数:1,代码来源:thmem.hpp


示例9: OwnedConstThorRow

 inline OwnedConstThorRow(const OwnedConstThorRow & other)   { ptr = other.getLink(); }
开发者ID:afishbeck,项目名称:HPCC-Platform,代码行数:1,代码来源:thmem.hpp


示例10: process

    virtual void process() override
    {
        ActPrintLog("INDEXWRITE: Start");
        init();

        IRowStream *stream = inputStream;
        ThorDataLinkMetaInfo info;
        input->getMetaInfo(info);
        outRowAllocator.setown(getRowAllocator(helper->queryDiskRecordSize()));
        start();
        if (refactor)
        {
            assertex(isLocal);
            if (active)
            {
                unsigned targetWidth = partDesc->queryOwner().numParts()-(buildTlk?1:0);
                assertex(0 == container.queryJob().querySlaves() % targetWidth);
                unsigned partsPerNode = container.queryJob().querySlaves() / targetWidth;
                unsigned myPart = queryJobChannel().queryMyRank();

                IArrayOf<IRowStream> streams;
                streams.append(*LINK(stream));
                --partsPerNode;

 // Should this be merging 1,11,21,31 etc.
                unsigned p=0;
                unsigned fromPart = targetWidth+1 + (partsPerNode * (myPart-1));
                for (; p<partsPerNode; p++)
                {
                    streams.append(*createRowStreamFromNode(*this, fromPart++, queryJobChannel().queryJobComm(), mpTag, abortSoon));
                }
                ICompare *icompare = helper->queryCompare();
                assertex(icompare);
                Owned<IRowLinkCounter> linkCounter = new CThorRowLinkCounter;
                myInputStream.setown(createRowStreamMerger(streams.ordinality(), streams.getArray(), icompare, false, linkCounter));
                stream = myInputStream;
            }
            else // serve nodes, creating merged parts
                rowServer.setown(createRowServer(this, stream, queryJobChannel().queryJobComm(), mpTag));
        }
        processed = THORDATALINK_STARTED;

        // single part key support
        // has to serially pull all data fron nodes 2-N
        // nodes 2-N, could/should start pushing some data (as it's supposed to be small) to cut down on serial nature.
        unsigned node = queryJobChannel().queryMyRank();
        if (singlePartKey)
        {
            if (1 == node)
            {
                try
                {
                    open(*partDesc, false, helper->queryDiskRecordSize()->isVariableSize());
                    loop
                    {
                        OwnedConstThorRow row = inputStream->ungroupedNextRow();
                        if (!row)
                            break;
                        if (abortSoon) return;
                        processRow(row);
                    }

                    unsigned node = 2;
                    while (node <= container.queryJob().querySlaves())
                    {
                        Linked<IOutputRowDeserializer> deserializer = ::queryRowDeserializer(input);
                        CMessageBuffer mb;
                        Owned<ISerialStream> stream = createMemoryBufferSerialStream(mb);
                        CThorStreamDeserializerSource rowSource;
                        rowSource.setStream(stream);
                        bool successSR;
                        loop
                        {
                            {
                                BooleanOnOff tf(receivingTag2);
                                successSR = queryJobChannel().queryJobComm().sendRecv(mb, node, mpTag2);
                            }
                            if (successSR)
                            {
                                if (rowSource.eos())
                                    break;
                                Linked<IEngineRowAllocator> allocator = ::queryRowAllocator(input);
                                do
                                {
                                    RtlDynamicRowBuilder rowBuilder(allocator);
                                    size32_t sz = deserializer->deserialize(rowBuilder, rowSource);
                                    OwnedConstThorRow fRow = rowBuilder.finalizeRowClear(sz);
                                    processRow(fRow);
                                }
                                while (!rowSource.eos());
                            }
                        }
                        node++;
                    }
                }
                catch (CATCHALL)
                {
                    close(*partDesc, partCrc, true);
                    throw;
                }
//.........这里部分代码省略.........
开发者ID:bolaria,项目名称:HPCC-Platform,代码行数:101,代码来源:thindexwriteslave.cpp


示例11: CATCH_NEXTROW

 CATCH_NEXTROW()
 {
     ActivityTimer t(totalCycles, timeActivities);
     if (abortSoon)
         return NULL;
     if (eogNext)
     {
         eogNext = false;
         anyThisGroup = false;
         return NULL;
     }
     try
     {
         for (;;)
         {
             if (xmlParser)
             {
                 for (;;)
                 {
                     if (!xmlParser->next())
                     {
                         if (helper->searchTextNeedsFree())
                         {
                             rtlFree(searchStr);
                             searchStr = NULL;
                         }
                         xmlParser.clear();
                         break;
                     }
                     if (lastMatch)
                     {
                         RtlDynamicRowBuilder row(allocator);
                         size32_t sizeGot;
                         try { sizeGot = helper->transform(row, nxt, lastMatch); }
                         catch (IException *e) 
                         { 
                             ActPrintLog(e, "In helper->transform()");
                             throw;
                         }
                         lastMatch.clear();
                         if (sizeGot == 0)
                             continue; // not sure if this will ever be possible in this context.
                         dataLinkIncrement();
                         anyThisGroup = true;
                         OwnedConstThorRow ret = row.finalizeRowClear(sizeGot);
                         return ret.getClear();
                     }
                 }
             }
             nxt.setown(inputStream->nextRow());
             if (!nxt && !anyThisGroup)
                 nxt.setown(inputStream->nextRow());
             if (!nxt)
                 break;
             unsigned len;
             helper->getSearchText(len, searchStr, nxt);
             OwnedRoxieString xmlIteratorPath(helper->getXmlIteratorPath());
             xmlParser.setown(createXMLParse(searchStr, len, xmlIteratorPath, *this, ptr_noRoot, helper->requiresContents()));
         }
     }
     catch (IOutOfMemException *e)
     {
         StringBuffer s("XMLParse actId(");
         s.append(container.queryId()).append(") out of memory.").newline();
         s.append("INTERNAL ERROR ").append(e->errorCode()).append(": ");
         e->errorMessage(s);
         e->Release();
         throw MakeActivityException(this, 0, "%s", s.str());
     }
     catch (IException *e)
     {
         StringBuffer s("XMLParse actId(");
         s.append(container.queryId());
         s.append(") INTERNAL ERROR ").append(e->errorCode()).append(": ");
         e->errorMessage(s);
         e->Release();
         throw MakeActivityException(this, 0, "%s", s.str());
     }
     eogNext = false;
     anyThisGroup = false;
     return NULL;
 }
开发者ID:RogerDev,项目名称:HPCC-Platform,代码行数:82,代码来源:thxmlparseslave.cpp


示例12: run

 int run()
 {
     if (!started) {
         try {
             in->start();
             started = true;
         }
         catch(IException * e)
         {
             ActPrintLog(&activity, e, "ThorLookaheadCache starting input");
             startexception.setown(e);
             if (asyncstart) 
                 notify->onInputStarted(startexception);
             running = false;
             stopped = true;
             startsem.signal();
             return 0;
         }
     }
     try {
         StringBuffer temp;
         if (allowspill)
             GetTempName(temp,"lookahd",true);
         assertex(bufsize);
         if (allowspill)
             smartbuf.setown(createSmartBuffer(&activity, temp.toCharArray(), bufsize, queryRowInterfaces(in)));
         else
             smartbuf.setown(createSmartInMemoryBuffer(&activity, queryRowInterfaces(in), bufsize));
         if (notify) 
             notify->onInputStarted(NULL);
         startsem.signal();
         Linked<IRowWriter> writer = smartbuf->queryWriter();
         if (preserveLhsGrouping)
         {
             while (required&&running)
             {
                 OwnedConstThorRow row = in->nextRow();
                 if (!row)
                 {
                     row.setown(in->nextRow());
                     if (!row)
                         break;
                     else
                         writer->putRow(NULL); // eog
                 }
                 ++count;
                 writer->putRow(row.getClear());
                 if (required!=RCUNBOUND)
                     required--;
             }
         }
         else
         {
             while (required&&running)
             {
                 OwnedConstThorRow row = in->ungroupedNextRow();
                 if (!row)
                     break;
                 ++count;
                 writer->putRow(row.getClear());
                 if (required!=RCUNBOUND)
                     required--;
             }
         }
     }
     catch(IException * e)
     {
         ActPrintLog(&activity, e, "ThorLookaheadCache get exception");
         getexception.setown(e);
     }   
     if (notify)
         notify->onInputFinished(count);
     if (smartbuf)
         smartbuf->queryWriter()->flush();
     running = false;
     try {
         if (in)
             in->stop();
     }
     catch(IException * e)
     {
         ActPrintLog(&activity, e, "ThorLookaheadCache stop exception");
         if (!getexception.get())
             getexception.setown(e);
     }   
     return 0;
 }
开发者ID:afishbeck,项目名称:HPCC-Platform,代码行数:87,代码来源:thactivityutil.cpp


示例13: CATCH_NEXTROW

 CATCH_NEXTROW()
 {
     ActivityTimer t(totalCycles, timeActivities);
     OwnedConstThorRow ret;
     Owned<IException> exception;
     if (first) // only return 1!
     {
         try
         {
             first = false;
             initN();
             if (RCMAX==N) // indicates before start of dataset e.g. ds[0]
             {
                 RtlDynamicRowBuilder row(queryRowAllocator());
                 size32_t sz = helper->createDefault(row);
                 ret.setown(row.finalizeRowClear(sz));
                 N = 0; // return that processed all
             }
             else if (N)
             {
                 while (!abortSoon)
                 {
                     ret.setown(input->ungroupedNextRow());
                     if (!ret)
                         break;
                     N--;
                     {
                         SpinBlock block(spin);
                         if (lookaheadN<startN) // will not reach N==0, so don't bother continuing to read
                         {
                             N = startN-lookaheadN;
                             ret.clear();
                             break;
                         }
                     }
                     if (0==N)
                         break;
                 }
                 if ((N!=0)&&createDefaultIfFail)
                 {
                     N = 0; // return that processed all (i.e. none left)
                     RtlDynamicRowBuilder row(queryRowAllocator());
                     size32_t sz = helper->createDefault(row);
                     ret.setown(row.finalizeRowClear(sz));
                 }
             }
             if (startN && 0 == N)
                 seenNth = true;
         }
         catch (IException *e)
         {
             N=0;
             exception.setown(e);
         }
         sendN();
         if (exception.get())
             throw exception.getClear();
     }
     if (ret) 
         dataLinkIncrement();
     return ret.getClear();
 }
开发者ID:RobertoMalatesta,项目名称:HPCC-Platform,代码行数:62,代码来源:thselectnthslave.cpp


示例14: process

    virtual void process() override
    {
        ActPrintLog("INDEXWRITE: Start");
        init();

        IRowStream *stream = inputStream;
        ThorDataLinkMetaInfo info;
        input->getMetaInfo(info);
        outRowAllocator.setown(getRowAllocator(helper->queryDiskRecordSize()));
        start();
        if (refactor)
        {
            assertex(isLocal);
            if (active)
            {
                unsigned targetWidth = partDesc->queryOwner().numParts()-(buildTlk?1:0);
                assertex(0 == container.queryJob().querySlaves() % targetWidth);
                unsigned partsPerNode = container.queryJob().querySlaves() / targetWidth;
                unsigned myPart = queryJobChannel().queryMyRank();

                IArrayOf<IRowStream> streams;
                streams.append(*LINK(stream));
                --partsPerNode;

 // Should this be merging 1,11,21,31 etc.
                unsigned p=0;
                unsigned fromPart = targetWidth+1 + (partsPerNode * (myPart-1));
                for (; p<partsPerNode; p++)
                {
                    streams.append(*createRowStreamFromNode(*this, fromPart++, queryJobChannel().queryJobComm(), mpTag, abortSoon));
                }
                ICompare *icompare = helper->queryCompare();
                assertex(icompare);
                Owned<IRowLinkCounter> linkCounter = new CThorRowLinkCounter;
                myInputStream.setown(createRowStreamMerger(streams.ordinality(), streams.getArray(), icompare, false, linkCounter));
                stream = myInputStream;
            }
            else // serve nodes, creating merged parts
                rowServer.setown(createRowServer(this, stream, queryJobChannel().queryJobComm(), mpTag));
        }
        processed = THORDATALINK_STARTED;

        // single part key support
        // has to serially pull all data fron nodes 2-N
        // nodes 2-N, could/should start pushing some data (as it's supposed to be small) to cut down on serial nature.
        unsigned node = queryJobChannel().queryMyRank();
        if (singlePartKey)
        {
            if (1 == node)
            {
                try
                {
                    open(*partDesc, false, helper->queryDiskRecordSize()->isVariableSize());
                    for (;;)
                    {
                        OwnedConstThorRow row = inputStream->ungroupedNextRow();
                        if (!row)
                            break;
                        if (abortSoon) return;
                        processRow(row);
                    }

                    unsigned node = 2;
                    while (node <= container.queryJob().querySlaves())
                    {
                        Linked<IOutputRowDeserializer> deserializer = ::queryRowDeserializer(input);
                        CMessageBuffer mb;
                        Owned<ISerialStream> stream = createMemoryBufferSerialStream(mb);
                        CThorStreamDeserializerSource rowSource;
                        rowSource.setStream(stream);
                        bool successSR;
                        for (;;)
                        {
                            {
                                BooleanOnOff tf(receivingTag2);
                                successSR = queryJobChannel().queryJobComm().sendRecv(mb, node, mpTag2);
                            }
                            if (successSR)
                            {
                                if (rowSource.eos())
                                    break;
                                Linked<IEngineRowAllocator> allocator = ::queryRowAllocator(input);
                                do
                                {
                                    RtlDynamicRowBuilder rowBuilder(allocator);
                                    size32_t sz = deserializer->deserialize(rowBuilder, rowSource);
                                    OwnedConstThorRow fRow = rowBuilder.finalizeRowClear(sz);
                                    processRow(fRow);
                                }
                                while (!rowSource.eos());
                            }
                        }
                        node++;
                    }
                }
                catch (CATCHALL)
                {
                    close(*partDesc, partCrc, true);
                    throw;
                }
//.........这里部分代码省略.........
开发者ID:fnisswandt,项目名称:HPCC-Platform,代码行数:101,代码来源:thindexwriteslave.cpp



注:本文中的OwnedConstThorRow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OwnedIFile类代码示例发布时间:2022-05-31
下一篇:
C++ KeyValuePair类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap