summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2015-04-03 13:41:34 -0400
committerEric Milkie <milkie@10gen.com>2015-04-06 08:26:04 -0400
commit9668b2dd7440adcd129ae395d57ea021b3623b01 (patch)
tree21648e044ff8b1c0377188d5bbc293c5fd9e17ba /src/mongo/bson
parentf366e1ecec16bae959f04287f40adfb87711e8af (diff)
downloadmongo-9668b2dd7440adcd129ae395d57ea021b3623b01.tar.gz
SERVER-17880 remove ReplTime
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bson_db.h5
-rw-r--r--src/mongo/bson/bsonobjbuilder.h7
-rw-r--r--src/mongo/bson/optime.h17
3 files changed, 1 insertions, 28 deletions
diff --git a/src/mongo/bson/bson_db.h b/src/mongo/bson/bson_db.h
index bd0cdb44bc4..3d9a37639d2 100644
--- a/src/mongo/bson/bson_db.h
+++ b/src/mongo/bson/bson_db.h
@@ -44,11 +44,6 @@
namespace mongo {
- /**
- Timestamps are a special BSON datatype that is used internally for replication.
- Append a timestamp element to the object being ebuilt.
- @param time - in millis (but stored in seconds)
- */
inline BSONObjBuilder& BSONObjBuilder::appendTimestamp( StringData fieldName , unsigned long long time , unsigned int inc ) {
OpTime t( (unsigned) (time / 1000) , inc );
appendTimestamp( fieldName , t.asDate() );
diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h
index b6e667e3322..50ad4480669 100644
--- a/src/mongo/bson/bsonobjbuilder.h
+++ b/src/mongo/bson/bsonobjbuilder.h
@@ -472,13 +472,6 @@ namespace mongo {
*/
BSONObjBuilder& append(StringData fieldName, OpTime optime);
- /**
- * Alternative way to store an OpTime in BSON. Pass the OpTime as a Date, as follows:
- *
- * builder.appendTimestamp("field", optime.asDate());
- *
- * This captures both the secs and inc fields.
- */
BSONObjBuilder& appendTimestamp( StringData fieldName , unsigned long long val ) {
_b.appendNum( (char) Timestamp );
_b.appendStr( fieldName );
diff --git a/src/mongo/bson/optime.h b/src/mongo/bson/optime.h
index 8871f7c4488..d090c57867e 100644
--- a/src/mongo/bson/optime.h
+++ b/src/mongo/bson/optime.h
@@ -40,12 +40,6 @@ namespace mongo {
ClockSkewException() : DBException( "clock skew exception" , 20001 ) {}
};
- /* replsets used to use RSOpTime.
- M/S uses OpTime.
- But this is useable from both.
- */
- typedef unsigned long long ReplTime;
-
/* Operation sequence #. A combination of current second plus an ordinal value.
*/
#pragma pack(4)
@@ -64,10 +58,7 @@ namespace mongo {
reinterpret_cast<unsigned long long&>(*this) = date.millis;
dassert( (int)secs >= 0 );
}
- OpTime(ReplTime x) {
- reinterpret_cast<unsigned long long&>(*this) = x;
- dassert( (int)secs >= 0 );
- }
+
OpTime(unsigned a, unsigned b) {
secs = a;
i = b;
@@ -86,12 +77,6 @@ namespace mongo {
// Maximum OpTime value.
static OpTime max();
- /* We store OpTime's in the database as BSON Date datatype -- we needed some sort of
- 64 bit "container" for these values. While these are not really "Dates", that seems a
- better choice for now than say, Number, which is floating point. Note the BinData type
- is perhaps the cleanest choice, lacking a true unsigned64 datatype, but BinData has 5
- bytes of overhead.
- */
unsigned long long asDate() const {
return reinterpret_cast<const unsigned long long*>(&i)[0];
}