summaryrefslogtreecommitdiff
path: root/src/mongo/db/pdfile.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-12-12 11:56:21 -0500
committerHari Khalsa <hkhalsa@10gen.com>2013-12-13 11:54:44 -0500
commitb0c2eab53f6733e87d69fe8c1f22324efa735952 (patch)
treedba7b2d628245a900e2c8486eb2f5fc8f2aa4cbd /src/mongo/db/pdfile.cpp
parentbf44f7690aadf1f99e7979adf6c33d4dea2f5464 (diff)
downloadmongo-b0c2eab53f6733e87d69fe8c1f22324efa735952.tar.gz
SERVER-10026 remove rest of dead code
Diffstat (limited to 'src/mongo/db/pdfile.cpp')
-rw-r--r--src/mongo/db/pdfile.cpp80
1 files changed, 0 insertions, 80 deletions
diff --git a/src/mongo/db/pdfile.cpp b/src/mongo/db/pdfile.cpp
index 34f55a24d3d..8cdd74e6aef 100644
--- a/src/mongo/db/pdfile.cpp
+++ b/src/mongo/db/pdfile.cpp
@@ -337,86 +337,6 @@ namespace mongo {
DataFileMgr::DataFileMgr(){}
- shared_ptr<Cursor> DataFileMgr::findAll(const StringData& ns, const DiskLoc &startLoc) {
- Database* db = cc().database();
- Collection* collection = db->getCollection( ns );
- if ( !collection )
- return shared_ptr<Cursor>(new BasicCursor(DiskLoc()));
- NamespaceDetails* d = collection->details();
- DiskLoc loc = d->firstExtent();
- if ( loc.isNull() )
- return shared_ptr<Cursor>(new BasicCursor(DiskLoc()));
- Extent *e = getExtent(loc);
-
- DEBUGGING {
- out() << "listing extents for " << ns << endl;
- DiskLoc tmp = loc;
- set<DiskLoc> extents;
-
- while ( 1 ) {
- Extent *f = db->getExtentManager().getExtent(tmp);
- out() << "extent: " << tmp.toString() << endl;
- extents.insert(tmp);
- tmp = f->xnext;
- if ( tmp.isNull() )
- break;
- f = db->getExtentManager().getNextExtent( f );
- }
-
- out() << endl;
- d->dumpDeleted(&extents);
- }
-
- if ( d->isCapped() )
- return shared_ptr<Cursor>( ForwardCappedCursor::make( d , startLoc ) );
-
- if ( !startLoc.isNull() )
- return shared_ptr<Cursor>(new BasicCursor( startLoc ));
-
- while ( e->firstRecord.isNull() && !e->xnext.isNull() ) {
- /* todo: if extent is empty, free it for reuse elsewhere.
- that is a bit complicated have to clean up the freelists.
- */
- RARELY out() << "info DFM::findAll(): extent " << loc.toString() << " was empty, skipping ahead. ns:" << ns << endl;
- // find a nonempty extent
- // it might be nice to free the whole extent here! but have to clean up free recs then.
- e = db->getExtentManager().getNextExtent( e );
- }
- return shared_ptr<Cursor>(new BasicCursor( e->firstRecord ));
- }
-
- /* get a table scan cursor, but can be forward or reverse direction.
- order.$natural - if set, > 0 means forward (asc), < 0 backward (desc).
- */
- shared_ptr<Cursor> findTableScan(const char *ns, const BSONObj& order, const DiskLoc &startLoc) {
- BSONElement el = order.getField("$natural"); // e.g., { $natural : -1 }
-
- if ( el.number() >= 0 )
- return DataFileMgr::findAll(ns, startLoc);
-
- // "reverse natural order"
- Database* db = cc().database();
- Collection* collection = db->getCollection( ns );
- if ( !collection )
- return shared_ptr<Cursor>(new BasicCursor(DiskLoc()));
-
- NamespaceDetails* d = collection->details();
-
- if ( !d->isCapped() ) {
- if ( !startLoc.isNull() )
- return shared_ptr<Cursor>(new ReverseCursor( startLoc ));
- Extent *e = d->lastExtent().ext();
- while ( e->lastRecord.isNull() && !e->xprev.isNull() ) {
- OCCASIONALLY out() << " findTableScan: extent empty, skipping ahead" << endl;
- e = db->getExtentManager().getPrevExtent(e);
- }
- return shared_ptr<Cursor>(new ReverseCursor( e->lastRecord ));
- }
- else {
- return shared_ptr<Cursor>( new ReverseCappedCursor( d, startLoc ) );
- }
- }
-
/* deletes a record, just the pdfile portion -- no index cleanup, no cursor cleanup, etc.
caller must check if capped
*/