mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
Merge branch 'master' of github.com:mongodb/mongo
This commit is contained in:
commit
5c05c7a81d
@ -378,18 +378,6 @@ private:
|
||||
massert( 10334 , s , 0 );
|
||||
}
|
||||
}
|
||||
/*
|
||||
#pragma pack(1)
|
||||
static struct EmptyObject {
|
||||
EmptyObject() {
|
||||
len = 5;
|
||||
jstype = EOO;
|
||||
}
|
||||
int len;
|
||||
char jstype;
|
||||
} emptyObject;
|
||||
#pragma pack()
|
||||
*/
|
||||
};
|
||||
ostream& operator<<( ostream &s, const BSONObj &o );
|
||||
ostream& operator<<( ostream &s, const BSONElement &e );
|
||||
|
@ -20,7 +20,6 @@
|
||||
namespace mongo {
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/** Object ID type.
|
||||
BSON objects typically have an _id field for the object id. This field should be the first
|
||||
member of the object when present. class OID is a special type that is a 12 byte id which
|
||||
|
@ -561,7 +561,7 @@ found:
|
||||
/* remove a key from the index */
|
||||
bool BtreeBucket::unindex(const DiskLoc& thisLoc, IndexDetails& id, BSONObj& key, const DiskLoc& recordLoc ) {
|
||||
if ( key.objsize() > KeyMax ) {
|
||||
OCCASIONALLY problem() << "unindex: key too large to index, skipping " << id.indexNamespace() << /* ' ' << key.toString() << */ '\n';
|
||||
OCCASIONALLY problem() << "unindex: key too large to index, skipping " << id.indexNamespace() << /* ' ' << key.toString() << */ endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -904,7 +904,7 @@ found:
|
||||
{
|
||||
if ( toplevel ) {
|
||||
if ( key.objsize() > KeyMax ) {
|
||||
problem() << "Btree::insert: key too large to index, skipping " << idx.indexNamespace().c_str() << ' ' << key.objsize() << ' ' << key.toString() << '\n';
|
||||
problem() << "Btree::insert: key too large to index, skipping " << idx.indexNamespace().c_str() << ' ' << key.objsize() << ' ' << key.toString() << endl;
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
@ -1033,7 +1033,7 @@ namespace mongo {
|
||||
if ( ! b->_pushBack(loc, key, ordering, DiskLoc()) ){
|
||||
// no room
|
||||
if ( key.objsize() > KeyMax ) {
|
||||
problem() << "Btree::insert: key too large to index, skipping " << idx.indexNamespace().c_str() << ' ' << key.objsize() << ' ' << key.toString() << '\n';
|
||||
problem() << "Btree::insert: key too large to index, skipping " << idx.indexNamespace().c_str() << ' ' << key.objsize() << ' ' << key.toString() << endl;
|
||||
}
|
||||
else {
|
||||
// bucket was full
|
||||
|
13
db/btree.h
13
db/btree.h
@ -26,7 +26,6 @@
|
||||
namespace mongo {
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct _KeyNode {
|
||||
DiskLoc prevChildBucket; // the lchild
|
||||
DiskLoc recordLoc; // location of the record associated with the key
|
||||
@ -60,7 +59,6 @@ namespace mongo {
|
||||
return !isUnused();
|
||||
}
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
class BucketBasics;
|
||||
@ -75,7 +73,6 @@ namespace mongo {
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/* this class is all about the storage management */
|
||||
class BucketBasics {
|
||||
friend class BtreeBuilder;
|
||||
@ -187,7 +184,9 @@ namespace mongo {
|
||||
}
|
||||
char data[4];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
#pragma pack(1)
|
||||
class BtreeBucket : public BucketBasics {
|
||||
friend class BtreeCursor;
|
||||
public:
|
||||
@ -262,13 +261,15 @@ namespace mongo {
|
||||
// simply builds and returns a dup key error message string
|
||||
static string dupKeyError( const IndexDetails& idx , const BSONObj& key );
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
class BtreeCursor : public Cursor {
|
||||
public:
|
||||
BtreeCursor( NamespaceDetails *_d, int _idxNo, const IndexDetails&, const BSONObj &startKey, const BSONObj &endKey, bool endKeyInclusive, int direction );
|
||||
|
||||
BtreeCursor( NamespaceDetails *_d, int _idxNo, const IndexDetails& _id, const BoundList &_bounds, int _direction );
|
||||
|
||||
~BtreeCursor(){
|
||||
}
|
||||
virtual bool ok() {
|
||||
return !bucket.isNull();
|
||||
}
|
||||
@ -287,7 +288,6 @@ namespace mongo {
|
||||
otherwise, marks loc as sent.
|
||||
@return true if the loc has not been seen
|
||||
*/
|
||||
set<DiskLoc> dups;
|
||||
virtual bool getsetdup(DiskLoc loc) {
|
||||
if( multikey ) {
|
||||
pair<set<DiskLoc>::iterator, bool> p = dups.insert(loc);
|
||||
@ -375,6 +375,7 @@ namespace mongo {
|
||||
void initInterval();
|
||||
|
||||
friend class BtreeBucket;
|
||||
set<DiskLoc> dups;
|
||||
NamespaceDetails *d;
|
||||
int idxNo;
|
||||
BSONObj startKey;
|
||||
@ -392,9 +393,9 @@ namespace mongo {
|
||||
BoundList bounds_;
|
||||
unsigned boundIndex_;
|
||||
const IndexSpec& _spec;
|
||||
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
inline bool IndexDetails::hasKey(const BSONObj& key) {
|
||||
return head.btree()->exists(*this, head, key, Ordering::make(keyPattern()));
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
namespace mongo {
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
class Record;
|
||||
class DeletedRecord;
|
||||
@ -34,6 +33,7 @@ namespace mongo {
|
||||
class BtreeBucket;
|
||||
class MongoDataFile;
|
||||
|
||||
#pragma pack(1)
|
||||
class DiskLoc {
|
||||
int fileNo; /* this will be volume, file #, etc. */
|
||||
int ofs;
|
||||
@ -151,7 +151,6 @@ namespace mongo {
|
||||
|
||||
MongoDataFile& pdf() const;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
const DiskLoc minDiskLoc(0, 1);
|
||||
|
8
debian/mongo.1
vendored
8
debian/mongo.1
vendored
@ -17,16 +17,16 @@ If JavaScript files are specified on the command line, the shell will run non\-i
|
||||
.B mongo
|
||||
start the shell, connecting to the server at localhost:27017 and using the test database
|
||||
.TP
|
||||
.B mongod foo
|
||||
.B mongo foo
|
||||
start the shell using the foo database at localhost:27017
|
||||
.TP
|
||||
.B mongod 192.169.0.5/foo
|
||||
.B mongo 192.169.0.5/foo
|
||||
start the shell using the foo database at 192.169.0.5:27017
|
||||
.TP
|
||||
.B mongod 192.169.0.5:9999/foo
|
||||
.B mongo 192.169.0.5:9999/foo
|
||||
start the shell using the foo database at 192.169.0.5:9999
|
||||
.TP
|
||||
.B mongod script1.js script2.js script3.js
|
||||
.B mongo script1.js script2.js script3.js
|
||||
run three scripts and exit
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
|
Loading…
Reference in New Issue
Block a user