85
At a rough level of detail, the pipeline engine works by repeatedly
scanning through all of the
CNKProc objects. For each CNKProc, the
engine calls
CNKProc::isReady(). If this returns true (non-zero), then
CNKProc::execute() is called to execute the CNKProc once. The
engine repeatedly processes all of the
CNKProc objects in this way,
until none of them are "ready", indicating that either they are done
processing, or there is a problem.
setDone and isDone access an internal flag, indicating whether the
CNKProc is done processing all of its data, and need never be executed
again. The
execute method would normally call setDone(1) after it
had processed all available data from its inputs, and the input
CNKBuf
objects had all reached their
EOF (according to
CNKBufReader::getEOF()).
The default definition of
execute() does nothing. The default
definition of
isReady() returns true (non-zero) if getError() is NULL,
isDone() is false, and all of the input and output bufs are ready,
meaning that their row requests are satisfied. Creating a new
CNKProc
means at least defining a new
execute() method, and possibly a new
isReady() method. The details of writing an execute() method that
accesses its inputs and outputs correctly is described in a section
below.
CNKProc::
virtual INT64 getRowsDone();
virtual void setRowsDone(INT64 val);
virtual void incrementRowsDone(long rows);
Each CNKProc maintains a field counting the number of rows that
have been processed, initialized to zero in
init(). The current value
is accessed by
getRowsDone(). This value is normally changed by
calls from
execute() to setRowsDone or incrementRowsDone. This
concept is not well defined. In particular, it is unclear what this
means when there are multiple inputs. Currently, this is used
primarily for debugging, to check how much data is flowing through a
CNKProc.
CNKProc::
virtual long getExecuteCount();
virtual void setExecuteCount(long val);
virtual void incrementExecuteCount();
Comentarios a estos manuales