|
|
@@ -38,15 +38,17 @@ var Pipeline = module.exports = (function(){
|
|
|
* @param {Object} cmdObj the command object sent from the client
|
|
|
* @returns {Array} the pipeline, if created, otherwise a NULL reference
|
|
|
**/
|
|
|
- klass.parseCommand = function parseCommand(cmdObj){
|
|
|
- var pipelineInstance = new (require("../Aggregator")).Pipeline(),
|
|
|
- pipeline = cmdObj;//munge: skipping the command parsing since all we care about is the pipeline
|
|
|
-
|
|
|
+ klass.parseCommand = function parseCommand(docSrcs, pipelineArgs){
|
|
|
+ //We are require()'ing this here in case the Pipeline class was overriden by someone else.
|
|
|
+ var pipelineInstance = new (require("../Aggregator")).Pipeline(pipelineArgs);
|
|
|
+
|
|
|
+ //Note: munge: skipping the command parsing since all we care about is the pipeline
|
|
|
+
|
|
|
var sourceVector = pipelineInstance.sourceVector,
|
|
|
- nSteps = pipeline.length;
|
|
|
+ nSteps = docSrcs.length;
|
|
|
for( var iStep = 0; iStep<nSteps; ++iStep){
|
|
|
/* pull out the pipeline element as an object */
|
|
|
- var pipeElement = pipeline[iStep];
|
|
|
+ var pipeElement = docSrcs[iStep];
|
|
|
if (!(pipeElement instanceof Object)){
|
|
|
throw new Error("pipeline element " + iStep + " is not an object; code 15942" );
|
|
|
}
|