瀏覽代碼

Remove TAKcountindex from the engines

The code hasn't been enabled by default for a very long time, so removing
since unlikely to be any workunits that use it.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 13 年之前
父節點
當前提交
5e7d9a5320

+ 0 - 1
common/commonext/commonext.cpp

@@ -202,7 +202,6 @@ MODULE_INIT(INIT_PRIORITY_STANDARD)
     kindArray[TAKwhen_action] = "when_action";
 
 //Non standard
-    kindArray[TAKcountindex] = "countindex";
     kindArray[TAKcountdisk] = "countdisk";
     kindArray[TAKsubgraph] = "subgraph";
 

+ 0 - 1
common/thorhelper/thorcommon.cpp

@@ -676,7 +676,6 @@ extern const char * getActivityText(ThorActivityKind kind)
     case TAKcsvfetch:               return "Csv Fetch";
     case TAKxmlwrite:               return "Xml Write";
     case TAKparse:                  return "Parse";
-    case TAKcountindex:             return "Count Index";
     case TAKcountdisk:              return "Count Disk";
     case TAKsideeffect:             return "Simple Action";
     case TAKtopn:                   return "Top N";

+ 1 - 16
ecl/eclagent/eclagent.cpp

@@ -1472,22 +1472,7 @@ void EclAgent::deleteFile(const char * logicalName)
 
 __int64 EclAgent::countIndex(__int64 id, IHThorCountIndexArg & arg)
 {
-    Owned<IHThorCountIndexArg> a = &arg;  // make sure it gets destroyed....
-
-    //MORE: This needs rewriting if it is to be called from a child query, but I expect the
-    //whole activity to be replaced with something else in that case.
-    try
-    {
-        arg.onCreate(queryCodeContext(), NULL, NULL);
-        arg.onStart(NULL, NULL);
-    }
-    catch(IException * e)
-    {
-        throw makeHThorException(TAKcountindex, (unsigned)id, 0, e);
-    }
-
-    Owned<IHThorActivity> counter = createCountIndexActivity(*this, (unsigned)id, 0, arg, TAKcountindex);
-    return counter->getCount();
+    throwUnexpected();
 }
 
 __int64 EclAgent::countDiskFile(__int64 id, IHThorCountFileArg & arg)

+ 0 - 1
ecl/eclagent/eclgraph.cpp

@@ -179,7 +179,6 @@ static IHThorActivity * createActivity(IAgentContext & agent, unsigned activityI
         return createXmlFetchActivity(agent, activityId, subgraphId, (IHThorXmlFetchArg &)arg, kind);
     case TAKmerge: 
         return createMergeActivity(agent, activityId, subgraphId, (IHThorMergeArg &)arg, kind);
-    case TAKcountindex: 
     case TAKcountdisk: 
         return NULL; // NOTE - activity gets created when needed
     case TAKhttp_rowdataset:

+ 0 - 2
ecl/hqlcpp/hqlcatom.cpp

@@ -129,7 +129,6 @@ _ATOM _conditionalRowMarker_Atom;
 _ATOM containerAtom;
 _ATOM cosAtom;
 _ATOM coshAtom;
-_ATOM countIndexAtom;
 _ATOM countProviderAtom;
 _ATOM countRoxieDiskFileAtom;
 _ATOM countRowsAtom;
@@ -834,7 +833,6 @@ MODULE_INIT(INIT_PRIORITY_HQLATOM)
     MAKEATOM(container);
     cosAtom = createAtom("_cos");
     coshAtom = createAtom("_cosh");
-    MAKEATOM(countIndex);
     MAKEATOM(countProvider);
     MAKEATOM(countRoxieDiskFile);
     MAKEATOM(countRows);

+ 0 - 1
ecl/hqlcpp/hqlcatom.hpp

@@ -129,7 +129,6 @@ extern _ATOM concatVUnicodeToUnicodeAtom;
 extern _ATOM _conditionalRowMarker_Atom;
 extern _ATOM cosAtom;
 extern _ATOM coshAtom;
-extern _ATOM countIndexAtom;
 extern _ATOM countProviderAtom;
 extern _ATOM countRoxieDiskFileAtom;
 extern _ATOM countRowsAtom;

+ 0 - 1
ecl/hqlcpp/hqlcpp.hpp

@@ -72,7 +72,6 @@ The following debug options are currently supported by the code generator:
 "spotCSE"                true   - Look for common sub-expressions in transforms/filters?
 "spotTopN"               true   - Convert choosen(sort()) into a topN activity.
 "spotLocalMerge"         false  - if local join, and both sides sorted generate a light-weight merge
-"countIndex"             false  - optimize count(index) into optimized version. (also requires optimizeThorCounts)
 "allowThroughSpill"      true   - allow through spills.
 "spillMultiCondition"    false  - another roxie variant.
 "spotThroughAggregate"   true   - whether aggregates are done as through aggregates (generally more efficient)

+ 0 - 1
ecl/hqlcpp/hqlcppsys.ecl

@@ -650,7 +650,6 @@ const char * cppSystemText[]  = {
     "   boolean fileExists(const varstring lfn) : gctxmethod,entrypoint='fileExists';",
     "   varstring getExpandLogicalName(const varstring lfn) : ctxmethod,entrypoint='getExpandLogicalName';",
     "   deleteFile(const varstring lfn) : gctxmethod,entrypoint='deleteFile';",
-    "   integer8 countIndex(integer8 id, boolean monitors) : ctxmethod,entrypoint='countIndex';",
     "   integer8 countRoxieDiskFile(unsigned4 id, boolean monitors) : ctxmethod,entrypoint='countDiskFile';",       // id is actually 8 bytes, for backward compatibility
     "   integer4 getRecoveringCount() : ctxmethod,entrypoint='getRecoveringCount';",
 

+ 0 - 1
ecl/hthor/hthor.hpp

@@ -147,7 +147,6 @@ extern HTHOR_API IHThorActivity *createCsvFetchActivity(IAgentContext &_agent, u
 extern HTHOR_API IHThorActivity *createParseActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorParseArg &arg, ThorActivityKind kind);
 extern HTHOR_API IHThorActivity *createEnthActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorEnthArg &arg, ThorActivityKind kind);
 extern HTHOR_API IHThorActivity *createTopNActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorTopNArg &arg, ThorActivityKind kind);
-extern HTHOR_API IHThorActivity *createCountIndexActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorCountIndexArg &arg, ThorActivityKind kind);
 extern HTHOR_API IHThorActivity *createXmlParseActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorXmlParseArg &arg, ThorActivityKind kind);
 extern HTHOR_API IHThorActivity *createXmlFetchActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorXmlFetchArg &arg, ThorActivityKind kind);
 extern HTHOR_API IHThorActivity *createMergeActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorMergeArg &arg, ThorActivityKind kind);

+ 0 - 157
ecl/hthor/hthorkey.cpp

@@ -4072,160 +4072,3 @@ extern HTHOR_API IHThorActivity *createKeyedJoinActivity(IAgentContext &_agent,
 {
     return new CHThorKeyedJoinActivity(_agent, _activityId, _subgraphId, arg, _kind);
 }
-
-//-------------------------------------------------------------------------------------------------------------
-
-class CHThorCountIndexActivity : public CHThorActivityBase
-{
-protected:
-    IHThorCountIndexArg &helper;
-    Owned<IKeyIndex> keyIndex;
-    Owned<IKeyManager> klManager;
-
-public:
-    IMPLEMENT_SINKACTIVITY;
-
-    CHThorCountIndexActivity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorCountIndexArg &_arg, ThorActivityKind _kind, IDistributedFilePart *keyFile)
-        : CHThorActivityBase(_agent, _activityId, _subgraphId, _arg, _kind), helper(_arg)
-    {
-        if (keyFile)
-        {
-            Owned<IDistributedFilePart> kf = keyFile; 
-            keyIndex.setown(openKeyFile(*kf));
-            klManager.setown(createKeyManager(keyIndex, 0, NULL));
-            helper.createSegmentMonitors(klManager);
-            klManager->finishSegmentMonitors();
-            klManager->reset();
-        }
-    
-    }
-
-    virtual __int64 getCount() 
-    {
-        if (!helper.canMatchAny())
-            return 0;
-        else if (helper.hasPostFilter())
-        {
-            __int64 ret = 0;
-            loop
-            {
-                agent.reportProgress(NULL);
-                if (!klManager->lookup(true))
-                    break;
-                offset_t recptr;
-                byte const * keyRow = klManager->queryKeyBuffer(recptr);
-                KLBlobProviderAdapter adapter(klManager);
-                if (helper.isValid(keyRow, recptr, &adapter))
-                    ret++;
-            }
-            return ret;
-        }
-        else
-            return klManager->getCount();
-    }
-
-};
-
-class CHThorMultiCountIndexBase : public CHThorCountIndexActivity
-{
-public:
-    CHThorMultiCountIndexBase(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorCountIndexArg &_arg, ThorActivityKind _kind, IDistributedFilePart *_tlk)
-        : CHThorCountIndexActivity(_agent, _activityId, _subgraphId, _arg, _kind, _tlk)
-    {
-    }
-
-    virtual __int64 getCount() 
-    {
-        __int64 ret = 0;
-        while (subKey)
-        {
-            ret += subKey->getCount();
-            nextSubKey();
-        }
-        return ret;
-    }
-
-protected:
-    Owned<CHThorCountIndexActivity> subKey;
-
-    virtual void nextSubKey() = 0;
-};
-
-class CHThorMultiCountIndexActivity : public CHThorMultiCountIndexBase
-{
-public:
-    CHThorMultiCountIndexActivity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorCountIndexArg &_arg, ThorActivityKind _kind, IDistributedFilePart *_tlk, IDistributedFile *_f)
-        : CHThorMultiCountIndexBase(_agent, _activityId, _subgraphId, _arg, _kind, _tlk), subKeys(_f)
-    {
-        nextSubKey();
-    }
-
-protected:
-    Owned<IDistributedFile> subKeys;
-
-    void nextSubKey()
-    {
-        subKey.clear();
-        while (klManager->lookup(false))
-        {
-            if (klManager->queryFpos())
-            {
-                subKey.setown(new CHThorCountIndexActivity(agent, activityId, subgraphId, helper, kind, subKeys->getPart((unsigned)(klManager->queryFpos()-1))));
-                break;
-            }
-        }
-    }
-};
-
-class CHThorSuperCountIndexActivity : public CHThorMultiCountIndexBase
-{
-public:
-    CHThorSuperCountIndexActivity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorCountIndexArg &_arg, ThorActivityKind _kind, IDistributedSuperFile *_super)
-        : CHThorMultiCountIndexBase(_agent, _activityId, _subgraphId, _arg, _kind, NULL), superIterator(_super->getSubFileIterator(true))
-    {
-        superIterator->first();
-        nextSubKey();
-    }
-
-private:
-    Owned<IDistributedFileIterator> superIterator;
-
-    void nextSubKey()
-    {
-        subKey.clear();
-        if (superIterator->isValid())
-        {
-            IDistributedFile &f = superIterator->query();
-            unsigned numParts = f.numParts();
-            if (numParts==1)
-                subKey.setown(new CHThorCountIndexActivity(agent, activityId, subgraphId, helper, kind, f.getPart(0)));
-            else
-                subKey.setown(new CHThorMultiCountIndexActivity(agent, activityId, subgraphId, helper, kind, f.getPart(numParts-1), LINK(&f)));
-            superIterator->next();
-        }
-    }
-};
-
-extern HTHOR_API IHThorActivity *createCountIndexActivity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorCountIndexArg &arg, ThorActivityKind _kind)
-{
-    // A logical filename for the key should refer to a single physical file - either the TLK or a monolithic key
-    arg.extractLookupFields();
-    const char *lfn = arg.getIndexFileName();
-    Owned<ILocalOrDistributedFile> ldFile = _agent.resolveLFN(lfn, "CountIndex");
-    IDistributedFile * dFile = ldFile->queryDistributedFile();
-
-    _agent.logFileAccess(dFile, "HThor", "READ");
-    IDistributedSuperFile *super = dFile->querySuperFile();
-    if (super)
-    {
-        return new CHThorSuperCountIndexActivity(_agent, _activityId, _subgraphId, arg, _kind, super);
-    }
-    else if (dFile->numParts() == 1)
-    {
-        return new CHThorCountIndexActivity(_agent, _activityId, _subgraphId, arg, _kind, dFile->getPart(0));
-    }
-    else
-    {
-        return new CHThorMultiCountIndexActivity(_agent, _activityId, _subgraphId, arg, _kind, dFile->getPart(ldFile->numParts()-1), LINK(dFile));
-    }
-}

+ 0 - 12
roxie/ccd/ccdserver.cpp

@@ -27470,18 +27470,6 @@ public:
     
     virtual __int64 countIndex(__int64 activityId, IHThorCountIndexArg & arg) 
     {
-        Owned<IHThorCountIndexArg> a = &arg;  // to make sure it gets released when I am done....
-        Owned<IRoxieServerActivityFactory> f = factory->getRoxieServerActivityFactory((unsigned) activityId);
-        if (f)
-        {
-            Owned<IRoxieServerActivity> fa = f->createFunction(*a.getClear(), NULL);
-            fa->onCreate(this, NULL);
-            fa->start(0, NULL, false);
-            __int64 ret = fa->evaluate();
-            fa->stop(false);
-            fa->reset();
-            return ret;
-        }
         throwUnexpected();
     }
 

+ 2 - 2
rtl/include/eclhelper.hpp

@@ -802,13 +802,13 @@ enum ThorActivityKind
     TAKcaseaction,
     TAKwhen_dataset,
     TAKwhen_action,
-    TAKunsued2,
+        TAKunused2,
     TAKindexgroupexists,
     TAKindexgroupcount,
     TAKhashdistributemerge,
     TAKselfjoinlight,
     TAKhttp_rowdataset,     // a source activity
-    TAKcountindex,
+        TAKunused3,
     TAKcountdisk,
     TAKstreamediterator,
     TAKexternalsource,