0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-109 rename clone() createChild()

This commit is contained in:
Aaron 2010-06-02 13:00:20 -07:00
parent 152d1a0609
commit 69cb3c068d
6 changed files with 15 additions and 15 deletions

View File

@ -115,7 +115,7 @@ namespace mongo {
}
}
virtual bool mayRecordPlan() const { return false; }
virtual QueryOp *clone() const { return new FindOne( requireIndex_ ); }
virtual QueryOp *createChild() const { return new FindOne( requireIndex_ ); }
BSONObj one() const { return one_; }
private:
bool requireIndex_;

View File

@ -88,8 +88,8 @@ namespace mongo {
}
}
virtual bool mayRecordPlan() const { return !justOne_; }
virtual QueryOp *clone() const {
bestCount_ = 0; // should be safe to reset this in contexts where clone() is called
virtual QueryOp *createChild() const {
bestCount_ = 0; // should be safe to reset this in contexts where createChild() is called
return new DeleteOp( justOne_, bestCount_ );
}
virtual shared_ptr<Cursor> newCursor() const { return qp().newCursor(); }
@ -420,7 +420,7 @@ namespace mongo {
}
c_->advance();
}
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
CountOp *ret = new CountOp( BSONObj() );
ret->count_ = count_;
ret->skip_ = skip_;
@ -732,7 +732,7 @@ namespace mongo {
virtual bool mayRecordPlan() const { return _pq.getNumToReturn() != 1; }
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
if ( _pq.isExplain() ) {
_eb.ensureStartScan();
}

View File

@ -487,14 +487,14 @@ namespace mongo {
vector< shared_ptr< QueryOp > > ops;
if ( plans_._bestGuessOnly ) {
shared_ptr< QueryOp > op( op_.clone() );
shared_ptr< QueryOp > op( op_.createChild() );
op->setQueryPlan( plans_.getBestGuess().get() );
ops.push_back( op );
} else {
if ( plans_.plans_.size() > 1 )
log(1) << " running multiple plans" << endl;
for( PlanSet::iterator i = plans_.plans_.begin(); i != plans_.plans_.end(); ++i ) {
shared_ptr< QueryOp > op( op_.clone() );
shared_ptr< QueryOp > op( op_.createChild() );
op->setQueryPlan( i->get() );
ops.push_back( op );
}
@ -533,7 +533,7 @@ namespace mongo {
PlanSet::iterator i = plans_.plans_.begin();
++i;
for( ; i != plans_.plans_.end(); ++i ) {
shared_ptr< QueryOp > op( op_.clone() );
shared_ptr< QueryOp > op( op_.createChild() );
op->setQueryPlan( i->get() );
ops.push_back( op );
initOp( *op );

View File

@ -96,7 +96,7 @@ namespace mongo {
the QueryOp of the winning plan from a given set will be cloned
to generate QueryOps for the subsequent plan set.
*/
virtual QueryOp *clone() const = 0;
virtual QueryOp *createChild() const = 0;
bool complete() const { return _complete; }
bool error() const { return _error; }
bool stopRequested() const { return _stopRequested; }
@ -340,7 +340,7 @@ namespace mongo {
virtual void init() { setComplete(); }
virtual void next() {}
virtual bool mayRecordPlan() const { return false; }
virtual QueryOp *clone() const { return new NoOp(); }
virtual QueryOp *createChild() const { return new NoOp(); }
virtual shared_ptr< Cursor > newCursor() const { return qp().newCursor(); }
virtual auto_ptr< CoveredIndexMatcher > newMatcher() const {
return auto_ptr< CoveredIndexMatcher >( new CoveredIndexMatcher( qp().query(), qp().indexKey() ) );

View File

@ -750,7 +750,7 @@ namespace mongo {
}
virtual bool mayRecordPlan() const { return false; }
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
return new UpdateOp( _hasPositionalField );
}
// already scanned to the first match, so return _c

View File

@ -827,7 +827,7 @@ namespace QueryOptimizerTests {
if ( ++i_ > 10 )
setComplete();
}
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
QueryOp *op = new TestOp( youThrow_, threw_ );
youThrow_ = !youThrow_;
return op;
@ -861,7 +861,7 @@ namespace QueryOptimizerTests {
virtual void next() {
massert( 10409 , "throw", false );
}
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
return new TestOp();
}
virtual bool mayRecordPlan() const { return true; }
@ -928,7 +928,7 @@ namespace QueryOptimizerTests {
virtual void next() {
setComplete();
}
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
return new TestOp();
}
virtual bool mayRecordPlan() const { return true; }
@ -963,7 +963,7 @@ namespace QueryOptimizerTests {
massert( 10410 , "throw", false );
setComplete();
}
virtual QueryOp *clone() const {
virtual QueryOp *createChild() const {
return new TestOp();
}
virtual bool mayRecordPlan() const { return true; }