summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2008-07-24 14:09:18 -0400
committerEliot Horowitz <eliot@10gen.com>2008-07-24 14:09:18 -0400
commit517956ab6056e0a378b4f33e82d62ee018bfef79 (patch)
tree08ec6733568f9e644ea07fc9fdfd789339a663b9
parentfa1bbbc78a382dd57f476f82c9f4ee7e83c7d531 (diff)
downloadmongo-517956ab6056e0a378b4f33e82d62ee018bfef79.tar.gz
hack namespace _hudsonSmall which uses small files so we can test file boundaries
-rw-r--r--db/pdfile.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index 5b68175d4d7..827d8465874 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -444,7 +444,7 @@ bool userCreateNS(const char *ns, JSObj& j, string& err) {
void PhysicalDataFile::open(int fn, const char *filename) {
int length;
-
+
if( fn <= 4 ) {
length = (64*1024*1024) << fn;
if( strstr(filename, "alleyinsider") && length < 1024 * 1024 * 1024 ) {
@@ -454,8 +454,19 @@ void PhysicalDataFile::open(int fn, const char *filename) {
}
} else
length = 0x7ff00000;
+
+ assert( length >= 64*1024*1024 );
+
+ if( strstr(filename, "_hudsonSmall") ) {
+ int mult = 1;
+ if ( fn > 1 && fn < 1000 )
+ mult = fn;
+ length = 1024 * 512 * mult;
+ cout << "Warning : using small files for _hudsonSmall" << endl;
+ }
+
- assert( length >= 64*1024*1024 && length % 4096 == 0 );
+ assert( length % 4096 == 0 );
assert(fn == fileNo);
header = (PDFHeader *) mmf.map(filename, length);