Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

OpLog can use replica sets #49

Closed
wants to merge 1 commit into from

2 participants

@yegeniy

Still defaults to 'oplog.$main' for the OpLog collection name, but can be 'oplog.rs' if masterSlaveReplication is false
See docs at http://www.mongodb.org/display/DOCS/Replication+Oplog+Length

cc/ @dvingo, @yegeniy, @matthewfitz

@yegeniy yegeniy OpLog can use replica sets
Still defaults to 'oplog.$main' for the OpLog collection name, but can be 'oplog.rs' if masterSlaveReplication is false
See docs at http://www.mongodb.org/display/DOCS/Replication+Oplog+Length

@author @dvingo, @yegeniy
2e36150
@rozza rozza referenced this pull request from a commit in rozza/casbah
@rozza rozza MongoOpLog updates
Uses new MongoClient and defaults to replciaSet oplog database
Based on mongodb/casbah#49
c08b275
@rozza
Collaborator

Thanks for the code - this will be in 2.5.0 - slightly different than the example - defaulting to be replicaSets

@rozza rozza closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2012
  1. @yegeniy

    OpLog can use replica sets

    yegeniy authored
    Still defaults to 'oplog.$main' for the OpLog collection name, but can be 'oplog.rs' if masterSlaveReplication is false
    See docs at http://www.mongodb.org/display/DOCS/Replication+Oplog+Length
    
    @author @dvingo, @yegeniy
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 casbah-core/src/main/scala/util/OpLog.scala
View
5 casbah-core/src/main/scala/util/OpLog.scala
@@ -30,12 +30,13 @@ import scala.util.control.Exception._
class MongoOpLog(mongo: MongoConnection = MongoConnection(),
startTimestamp: Option[BSONTimestamp] = None,
- namespace: Option[String] = None) extends Iterator[MongoOpLogEntry] with Logging {
+ namespace: Option[String] = None,
+ masterSlaveReplication: Boolean = true) extends Iterator[MongoOpLogEntry] with Logging {
implicit object BSONTimestampOk extends ValidDateOrNumericType[org.bson.types.BSONTimestamp]
protected val local = mongo("local")
- protected val oplog = local("oplog.$main")
+ protected val oplog = local("oplog." if masterSlaveReplication "$main" else "rs")
val tsp = verifyOpLog
Something went wrong with that request. Please try again.