From 8ac01ac9dc4046a04aeff48df58e670e8ea324e1 Mon Sep 17 00:00:00 2001 From: Dwight Date: Mon, 17 May 2010 10:38:36 -0400 Subject: [PATCH] remove reccache (mostly) --- SConstruct | 2 +- db/database.h | 2 +- db/db.cpp | 9 +++++---- db/db.vcxproj | 1 - db/db.vcxproj.filters | 3 --- db/instance.cpp | 6 +++--- db/rec.h | 2 +- db/reccache.cpp | 6 ++++-- db/reccache.h | 2 ++ db/recstore.h | 2 ++ db/storage.cpp | 18 +++++++++++------- dbtests/test.vcxproj | 1 - dbtests/test.vcxproj.filters | 3 --- 13 files changed, 30 insertions(+), 27 deletions(-) diff --git a/SConstruct b/SConstruct index f9dd53fac55..d30b9828ffb 100644 --- a/SConstruct +++ b/SConstruct @@ -406,7 +406,7 @@ coreServerFiles = [ "util/message_server_port.cpp" , "util/message_server_asio.c "client/parallel.cpp" , "db/matcher.cpp" , "db/indexkey.cpp" , "db/dbcommands_generic.cpp" ] -serverOnlyFiles = Split( "db/query.cpp db/update.cpp db/introspect.cpp db/btree.cpp db/clientcursor.cpp db/tests.cpp db/repl.cpp db/repl/replset.cpp db/repl/consensus.cpp db/repl/rs_initiate.cpp db/repl/replset_commands.cpp db/repl/manager.cpp db/repl/health.cpp db/repl/rs_config.cpp db/oplog.cpp db/repl_block.cpp db/btreecursor.cpp db/cloner.cpp db/namespace.cpp db/matcher_covered.cpp db/dbeval.cpp db/dbwebserver.cpp db/dbhelpers.cpp db/instance.cpp db/client.cpp db/database.cpp db/pdfile.cpp db/cursor.cpp db/security_commands.cpp db/security.cpp util/miniwebserver.cpp db/storage.cpp db/reccache.cpp db/queryoptimizer.cpp db/extsort.cpp db/mr.cpp s/d_util.cpp db/cmdline.cpp" ) +serverOnlyFiles = Split( "db/query.cpp db/update.cpp db/introspect.cpp db/btree.cpp db/clientcursor.cpp db/tests.cpp db/repl.cpp db/repl/replset.cpp db/repl/consensus.cpp db/repl/rs_initiate.cpp db/repl/replset_commands.cpp db/repl/manager.cpp db/repl/health.cpp db/repl/rs_config.cpp db/oplog.cpp db/repl_block.cpp db/btreecursor.cpp db/cloner.cpp db/namespace.cpp db/matcher_covered.cpp db/dbeval.cpp db/dbwebserver.cpp db/dbhelpers.cpp db/instance.cpp db/client.cpp db/database.cpp db/pdfile.cpp db/cursor.cpp db/security_commands.cpp db/security.cpp util/miniwebserver.cpp db/storage.cpp db/queryoptimizer.cpp db/extsort.cpp db/mr.cpp s/d_util.cpp db/cmdline.cpp" ) serverOnlyFiles += [ "db/index.cpp" ] + Glob( "db/index_*.cpp" ) diff --git a/db/database.h b/db/database.h index e4ec3354a81..ef181613b90 100644 --- a/db/database.h +++ b/db/database.h @@ -114,7 +114,7 @@ namespace mongo { namespaceIndex.init(); if ( n < 0 || n >= DiskLoc::MaxFiles ) { out() << "getFile(): n=" << n << endl; -#if !defined(_RECSTORE) +#if 0 if( n >= RecCache::Base && n <= RecCache::Base+1000 ) massert( 10294 , "getFile(): bad file number - using recstore db w/nonrecstore db build?", false); #endif diff --git a/db/db.cpp b/db/db.cpp index 85c53c09e98..5f77a3c1db4 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -74,7 +74,7 @@ namespace mongo { void startReplSets(); void startReplication(); void pairWith(const char *remoteEnd, const char *arb); - void setRecCacheSize(unsigned MB); + //void setRecCacheSize(unsigned MB); void exitCleanly( ExitCode code ); @@ -886,7 +886,8 @@ int main(int argc, char* argv[], char *envp[] ) if (params.count("cacheSize")) { long x = params["cacheSize"].as(); uassert( 10037 , "bad --cacheSize arg", x > 0); - setRecCacheSize(x); + log() << "--cacheSize option not currently supported" << endl; + //setRecCacheSize(x); } if (params.count("port") == 0 ) { if( params.count("configsvr") ) { @@ -1131,5 +1132,5 @@ BOOL CtrlHandler( DWORD fdwCtrlType ) } // namespace mongo -#include "recstore.h" -#include "reccache.h" +//#include "recstore.h" +//#include "reccache.h" diff --git a/db/db.vcxproj b/db/db.vcxproj index 32c233d5a71..d123929d282 100644 --- a/db/db.vcxproj +++ b/db/db.vcxproj @@ -443,7 +443,6 @@ - diff --git a/db/db.vcxproj.filters b/db/db.vcxproj.filters index 40ec865bcab..8323c07e6e4 100755 --- a/db/db.vcxproj.filters +++ b/db/db.vcxproj.filters @@ -154,9 +154,6 @@ src - - src - src diff --git a/db/instance.cpp b/db/instance.cpp index aa1c503e781..00de8fe14ba 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -27,7 +27,7 @@ #include "lasterror.h" #include "security.h" #include "json.h" -#include "reccache.h" +//#include "reccache.h" #include "replpair.h" #include "../s/d_logic.h" #include "../util/file_allocator.h" @@ -606,7 +606,7 @@ namespace mongo { return new DBDirectClient(); } - void recCacheCloseAll(); + //void recCacheCloseAll(); mongo::mutex exitMutex; int numExitCalls = 0; @@ -692,7 +692,7 @@ namespace mongo { rawOut( ss3.str() ); // should we be locked here? we aren't. might be ok as-is. - recCacheCloseAll(); + //recCacheCloseAll(); #if !defined(_WIN32) && !defined(__sunos__) if ( lockFile ){ diff --git a/db/rec.h b/db/rec.h index 2485f4061f8..7b79c73fd67 100644 --- a/db/rec.h +++ b/db/rec.h @@ -28,7 +28,7 @@ #pragma once #include "reci.h" -#include "reccache.h" +//#include "reccache.h" namespace mongo { diff --git a/db/reccache.cpp b/db/reccache.cpp index f690a856da7..eb20728b0c6 100644 --- a/db/reccache.cpp +++ b/db/reccache.cpp @@ -18,13 +18,15 @@ #include "pch.h" #include "pdfile.h" -#include "reccache.h" +//#include "reccache.h" #include "rec.h" #include "db.h" +#error deprecated - do not include in project + namespace mongo { -RecCache theRecCache(BucketSize); +//RecCache theRecCache(BucketSize); // 100k * 8KB = 800MB unsigned RecCache::MAXNODES = 50000; diff --git a/db/reccache.h b/db/reccache.h index b8094f31ae3..d0fd1185112 100644 --- a/db/reccache.h +++ b/db/reccache.h @@ -32,6 +32,8 @@ #pragma once +#error deprecated + #include "reci.h" #include "recstore.h" diff --git a/db/recstore.h b/db/recstore.h index bdb3d773830..913070f4b40 100644 --- a/db/recstore.h +++ b/db/recstore.h @@ -18,6 +18,8 @@ #pragma once +#error deprecated + #include "../util/file.h" namespace mongo { diff --git a/db/storage.cpp b/db/storage.cpp index 502772ac02d..63e7639fe6d 100644 --- a/db/storage.cpp +++ b/db/storage.cpp @@ -18,18 +18,12 @@ #include "pch.h" #include "pdfile.h" -#include "reccache.h" +//#include "reccache.h" #include "rec.h" #include "db.h" namespace mongo { -void writerThread(); - -#if defined(_RECSTORE) - static int inited; -#endif - // pick your store for indexes by setting this typedef // this doesn't need to be an ifdef, we can make it dynamic #if defined(_RECSTORE) @@ -38,6 +32,14 @@ RecStoreInterface *btreeStore = new CachedBasicRecStore(); MongoMemMapped_RecStore *btreeStore = new MongoMemMapped_RecStore(); #endif +#if 0 + +#if defined(_RECSTORE) + static int inited; +#endif + +void writerThread(); + void BasicRecStore::init(const char *fn, unsigned recsize) { massert( 10394 , "compile packing problem recstore?", sizeof(RecStoreHeader) == 8192); @@ -74,4 +76,6 @@ void BasicRecStore::init(const char *fn, unsigned recsize) #endif } +#endif + } diff --git a/dbtests/test.vcxproj b/dbtests/test.vcxproj index e639a765250..fc9a6365477 100644 --- a/dbtests/test.vcxproj +++ b/dbtests/test.vcxproj @@ -499,7 +499,6 @@ - diff --git a/dbtests/test.vcxproj.filters b/dbtests/test.vcxproj.filters index 132139883a9..525cfa0e744 100755 --- a/dbtests/test.vcxproj.filters +++ b/dbtests/test.vcxproj.filters @@ -325,9 +325,6 @@ misc and third party\pcre - - storage related - storage related