summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-09-30 15:55:20 -0400
committerDwight <dwight@10gen.com>2010-09-30 15:55:20 -0400
commit07c7c19a4dd4f6c3792c19bc2ec912a56be270b2 (patch)
treed4b7b84b40e8fa581543a66ea53038f352b644df
parentd73a18dec8708a728fd85ead6b279ba4c12cbe17 (diff)
downloadmongo-07c7c19a4dd4f6c3792c19bc2ec912a56be270b2.tar.gz
remove more files
-rw-r--r--SConstruct2
-rw-r--r--db/db.vcxproj2
-rwxr-xr-xdb/db.vcxproj.filters6
-rw-r--r--dbtests/test.vcxproj1
-rwxr-xr-xdbtests/test.vcxproj.filters3
-rw-r--r--util/mmap.h7
-rw-r--r--util/ramstore.cpp93
-rw-r--r--util/ramstore.h86
8 files changed, 5 insertions, 195 deletions
diff --git a/SConstruct b/SConstruct
index b647f1b7c4d..3888472fb81 100644
--- a/SConstruct
+++ b/SConstruct
@@ -416,7 +416,7 @@ if GetOption( "full" ):
# ------ SOURCE FILE SETUP -----------
commonFiles = Split( "pch.cpp buildinfo.cpp db/common.cpp db/jsobj.cpp db/json.cpp db/lasterror.cpp db/nonce.cpp db/queryutil.cpp shell/mongo.cpp" )
-commonFiles += [ "util/background.cpp" , "util/mmap.cpp" , "util/ramstore.cpp", "util/sock.cpp" , "util/util.cpp" , "util/message.cpp" ,
+commonFiles += [ "util/background.cpp" , "util/mmap.cpp" , "util/sock.cpp" , "util/util.cpp" , "util/message.cpp" ,
"util/assert_util.cpp" , "util/log.cpp" , "util/httpclient.cpp" , "util/md5main.cpp" , "util/base64.cpp", "util/concurrency/vars.cpp", "util/concurrency/task.cpp", "util/debug_util.cpp",
"util/concurrency/thread_pool.cpp", "util/password.cpp", "util/version.cpp", "util/signal_handlers.cpp",
"util/histogram.cpp", "util/concurrency/spin_lock.cpp", "util/text.cpp" , "util/stringutils.cpp" , "util/processinfo.cpp" ,
diff --git a/db/db.vcxproj b/db/db.vcxproj
index c725ebdff7d..8e57da0c7ab 100644
--- a/db/db.vcxproj
+++ b/db/db.vcxproj
@@ -523,7 +523,6 @@
<ClCompile Include="pdfile.cpp" />
<ClCompile Include="query.cpp" />
<ClCompile Include="queryoptimizer.cpp" />
- <ClCompile Include="..\util\ramstore.cpp" />
<ClCompile Include="security.cpp" />
<ClCompile Include="security_commands.cpp" />
<ClCompile Include="tests.cpp" />
@@ -611,6 +610,7 @@
<ClInclude Include="..\util\concurrency\mvar.h" />
<ClInclude Include="..\util\concurrency\task.h" />
<ClInclude Include="..\util\concurrency\thread_pool.h" />
+ <ClInclude Include="..\util\mongoutils\checksum.h" />
<ClInclude Include="..\util\mongoutils\html.h" />
<ClInclude Include="..\util\mongoutils\str.h" />
<ClInclude Include="..\util\ramlog.h" />
diff --git a/db/db.vcxproj.filters b/db/db.vcxproj.filters
index ae14bfb1db7..05367aa9590 100755
--- a/db/db.vcxproj.filters
+++ b/db/db.vcxproj.filters
@@ -268,9 +268,6 @@
<ClCompile Include="queryoptimizer.cpp">
<Filter>db\core</Filter>
</ClCompile>
- <ClCompile Include="..\util\ramstore.cpp">
- <Filter>db\storage engine</Filter>
- </ClCompile>
<ClCompile Include="repl_block.cpp">
<Filter>repl_old</Filter>
</ClCompile>
@@ -767,6 +764,9 @@
<ClInclude Include="namespace-inl.h">
<Filter>db\core\h</Filter>
</ClInclude>
+ <ClInclude Include="..\util\mongoutils\checksum.h">
+ <Filter>util\mongoutils</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="libs">
diff --git a/dbtests/test.vcxproj b/dbtests/test.vcxproj
index abf1a97d18d..7abe3de0c05 100644
--- a/dbtests/test.vcxproj
+++ b/dbtests/test.vcxproj
@@ -568,7 +568,6 @@
<ClCompile Include="..\db\query.cpp" />
<ClCompile Include="..\db\queryoptimizer.cpp" />
<ClCompile Include="..\util\processinfo.cpp" />
- <ClCompile Include="..\util\ramstore.cpp" />
<ClCompile Include="..\db\repl.cpp" />
<ClCompile Include="..\db\security.cpp" />
<ClCompile Include="..\db\security_commands.cpp" />
diff --git a/dbtests/test.vcxproj.filters b/dbtests/test.vcxproj.filters
index 966d514a8e7..29f8e49f63c 100755
--- a/dbtests/test.vcxproj.filters
+++ b/dbtests/test.vcxproj.filters
@@ -413,9 +413,6 @@
<ClCompile Include="..\db\queryoptimizer.cpp">
<Filter>db\cpp</Filter>
</ClCompile>
- <ClCompile Include="..\util\ramstore.cpp">
- <Filter>db\cpp</Filter>
- </ClCompile>
<ClCompile Include="..\db\repl.cpp">
<Filter>db\cpp</Filter>
</ClCompile>
diff --git a/util/mmap.h b/util/mmap.h
index 870ef85f0fe..c622df3fe28 100644
--- a/util/mmap.h
+++ b/util/mmap.h
@@ -145,13 +145,6 @@ namespace mongo {
void printMemInfo( const char * where );
-#include "ramstore.h"
-
-//#define _RAMSTORE
-#if defined(_RAMSTORE)
- typedef RamStoreFile MMF;
-#else
typedef MemoryMappedFile MMF;
-#endif
} // namespace mongo
diff --git a/util/ramstore.cpp b/util/ramstore.cpp
deleted file mode 100644
index 0bdf2e21f76..00000000000
--- a/util/ramstore.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
-* Copyright (C) 2008 10gen Inc.info
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License, version 3,
-* as published by the Free Software Foundation.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "pch.h"
-#include "mmap.h"
-
-namespace mongo {
-
- //extern bool checkNsFilesOnLoad;
-
-static set<RamStoreFile*> files;
-
-void RamStoreFile::grow(int offset, int len) {
- cout << "GROW ofs:" << offset << " len:" << len;
- assert( len > 0 );
- Node& n = _m[offset];
- cout << " oldlen:" << n.len << endl;
- assert( n.len > 0 );
- if( len > n.len ) {
- n.p = (char *) realloc(n.p, len);
- memset(((char *)n.p) + n.len, 0, len - n.len);
- n.len = len;
- }
-}
-
-/* maxLen can be -1 for existing data */
-void* RamStoreFile::at(int offset, int maxLen) {
- if( offset != _last ) {
- if( _m.count(_last) ) {
- _m[_last].check();
- if( !(offset < _last || offset >= _last + _m[_last].len) ) {
- cout << offset << ' ' << _last << ' ' << _m[_last].len << endl;
- assert(false);
- }
- }
- }
- _last = offset;
-
- Node& n = _m[offset];
- if( n.len == 0 ) {
- // create
- if( strstr(name, ".ns") == 0 )
- cout << "CREATE " << name << " ofs:" << offset << " len:" << maxLen << endl;
- assert( maxLen >= 0 );
- n.p = (char *) calloc(maxLen+1, 1);
- n.len = maxLen;
- }
- assert( n.len >= maxLen );
- n.check();
- return n.p;
- }
-
-void RamStoreFile::Node::check() {
- assert( p[len] == 0 );
-}
-
-void RamStoreFile::check() {
- for( std::map<int,Node>::iterator i = _m.begin(); i != _m.end(); i++ ) {
- i->second.check();
- }
-}
-
-void RamStoreFile::validate() {
- for( set<RamStoreFile*>::iterator i = files.begin(); i != files.end(); i++ ) {
- (*i)->check();
- }
-}
-
-RamStoreFile::~RamStoreFile() {
- check();
- files.erase(this);
-}
-
-RamStoreFile::RamStoreFile() : _len(0) {
- // checkNsFilesOnLoad = false;
- files.insert(this);
-}
-
-}
-
diff --git a/util/ramstore.h b/util/ramstore.h
deleted file mode 100644
index f75a57a5a69..00000000000
--- a/util/ramstore.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// ramstore.h
-
-// mmap.h
-
-/* Copyright 2009 10gen Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-extern bool checkNsFilesOnLoad;
-
-class RamStoreFile : public MongoFile {
- char name[256];
- struct Node {
- char *p;
- int len;
- Node() : len(0) { }
- void check();
- };
- std::map<int,Node> _m;
- long _len;
-
- static void validate();
- void check();
-
- int _last;
-
- void grow(int offset, int len);
-
- /* maxLen can be -1 for existing data */
- void* at(int offset, int maxLen);
-
-protected:
- virtual void close() {
- cout << "ramstore dealloc not yet implemented" << endl;
- if( _len ) {
- _len = 0;
- }
- }
- virtual void flush(bool sync) { }
-
-public:
- ~RamStoreFile();
- RamStoreFile();
-
- virtual long length() { return _len; }
-
- class Pointer {
- RamStoreFile* _f;
- friend class RamStoreFile;
- public:
- void* at(int offset, int len) {
- assert( len <= /*MaxBSONObjectSize*/4*1024*1024 + 128 );
- return _f->at(offset,len);
- }
- void grow(int offset, int len) {
- assert( len <= /*MaxBSONObjectSize*/4*1024*1024 + 128 );
- _f->grow(offset,len);
- }
- bool isNull() const { return _f == 0; }
- };
-
- Pointer map( const char *filename ) {
- assert(false); return Pointer();
- }
- Pointer map(const char *_filename, long &length, int options=0) {
- strncpy(name, _filename, sizeof(name)-1);
- Pointer p;
- p._f = this;
- return p;
- }
-
- static bool exists(boost::filesystem::path p) {
- return false;
- }
-};