Explorar el Código

HPCC-14656 Split concepts of an input and a row stream

Initial work - introduce IEngineRowStream class (replacing ISimpleInputBase)
and add it into thor hierarchy.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman hace 9 años
padre
commit
a3941fa38c

+ 2 - 2
common/thorhelper/roxiehelper.cpp

@@ -414,7 +414,7 @@ bool CRHLimitedCompareHelper::getGroup(OwnedRowArray &group, const void *left)
 //=========================================================================================
 
 // default implementations - can be overridden for efficiency...
-bool ISimpleInputBase::nextGroup(ConstPointerArray & group)
+bool IEngineRowStream::nextGroup(ConstPointerArray & group)
 {
     // MORE - this should be replaced with a version that reads to a builder
     const void * next;
@@ -425,7 +425,7 @@ bool ISimpleInputBase::nextGroup(ConstPointerArray & group)
     return false;
 }
 
-void ISimpleInputBase::readAll(RtlLinkedDatasetBuilder &builder)
+void IEngineRowStream::readAll(RtlLinkedDatasetBuilder &builder)
 {
     loop
     {

+ 2 - 13
common/thorhelper/roxiehelper.ipp

@@ -19,23 +19,12 @@
 #define ROXIEHELPER_IPP
 
 #include "thorhelper.hpp"
-#include "rtlds_imp.hpp"
+#include "roxiestream.hpp"
 #include "jlog.hpp"
-#include "jio.hpp"
 
 extern THORHELPER_API unsigned traceLevel;
-
-//---------------------------------------------------
-// Base classes for all Roxie/HThor activities
-//---------------------------------------------------
-struct THORHELPER_API ISimpleInputBase : public IRowStream //base for IInputBase and IHThorSimpleInput
-{
-    virtual bool nextGroup(ConstPointerArray & group);      // note: default implementation can be overridden for efficiency...
-    virtual void readAll(RtlLinkedDatasetBuilder &builder); // note: default implementation can be overridden for efficiency...
-};
-
 interface IOutputMetaData;
-struct IInputBase : public ISimpleInputBase  //base for IRoxieInput and IHThorInput
+struct IInputBase : public IEngineRowStream  //base for IRoxieInput and IHThorInput
 {
     virtual IOutputMetaData * queryOutputMeta() const = 0;
 };

+ 35 - 0
common/thorhelper/roxiestream.hpp

@@ -0,0 +1,35 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+#ifndef ROXIESTREAM_HPP
+#define ROXIESTREAM_HPP
+
+#include "thorhelper.hpp"
+#include "rtlds_imp.hpp"
+#include "jio.hpp"
+
+//---------------------------------------------------
+// Base classes for all Roxie/HThor/Thor input streams
+//---------------------------------------------------
+
+interface THORHELPER_API IEngineRowStream : public IRowStream //base for IInputBase and IHThorSimpleInput
+{
+    virtual bool nextGroup(ConstPointerArray & group);      // note: default implementation can be overridden for efficiency...
+    virtual void readAll(RtlLinkedDatasetBuilder &builder); // note: default implementation can be overridden for efficiency...
+};
+
+#endif // ROXIESTREAM_HPP

+ 1 - 1
ecl/hthor/hthor.hpp

@@ -39,7 +39,7 @@ void HTHOR_API setHThorRowManager(roxiemem::IRowManager * manager); // do not ca
 class PointerArray;
 class EclGraphElement;
 
-inline const void * ungroupedNextRow(ISimpleInputBase * input)
+inline const void * ungroupedNextRow(IEngineRowStream * input)
 {
     const void * ret = input->nextRow();
     if (!ret)

+ 3 - 3
ecl/hthor/hthor.ipp

@@ -2565,7 +2565,7 @@ protected:
 };
 
 
-class LocalResultInput : public CInterfaceOf<ISimpleInputBase>
+class LocalResultInput : public CInterfaceOf<IEngineRowStream>
 {
 public:
     void init(IHThorGraphResult * _result)      
@@ -2590,7 +2590,7 @@ protected:
 
 
 
-class ConstPointerArrayInput : public CInterfaceOf<ISimpleInputBase>
+class ConstPointerArrayInput : public CInterfaceOf<IEngineRowStream>
 {
 public:
     void init(ConstPointerArray * _array)       { array = _array; curRow = 0; }
@@ -2619,7 +2619,7 @@ protected:
 class CHThorLoopActivity : public CHThorSimpleActivityBase
 {
     IHThorLoopArg &helper;
-    ISimpleInputBase * curInput;
+    IEngineRowStream * curInput;
     ConstPointerArray loopPending; //MORE: would be safer and neater to use an OwnedRowArray, but would need to change prototype of IHThorBoundLoopGraph::execute
     ConstPointerArrayInput arrayInput;
     LocalResultInput resultInput; 

+ 2 - 1
thorlcr/slave/slave.hpp

@@ -36,6 +36,7 @@
 #include "eclhelper.hpp"        // for IRecordSize
 #include "thgraph.hpp"
 #include "thorstep.hpp"
+#include "roxiestream.hpp"
 
 
 /* ---- To implement IThorDataLink you need ----
@@ -73,7 +74,7 @@ struct ThorDataLinkMetaInfo
 #endif
 class CActivityBase;
 
-interface IThorDataLink : extends IRowStream
+interface IThorDataLink : extends IEngineRowStream
 {
     virtual void start() = 0;
     virtual bool isGrouped() = 0;