Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MongoOpLog updates

Uses new MongoClient and defaults to replciaSet oplog database
Based on mongodb/casbah#49
  • Loading branch information...
commit c08b2753be1010f1037a0dee3b21a40299c76593 1 parent 3df65e5
@rozza rozza authored
View
3  AUTHORS
@@ -22,4 +22,5 @@ that much better:
* Hitoshi Asai
* Ilya (intracer)
* Tom Vaughan
-* Brennan Saeta (saeta)
+* Brennan Saeta (saeta)
+* Eugene Wolfson (yegeniy)
View
10 casbah-core/src/main/scala/util/OpLog.scala
@@ -31,14 +31,16 @@ import com.mongodb.casbah.commons.Logging
import scala.util.control.Exception._
-class MongoOpLog(mongo: MongoConnection = MongoConnection(),
+class MongoOpLog(mongoClient: MongoClient = MongoClient(),
startTimestamp: Option[BSONTimestamp] = None,
- namespace: Option[String] = None) extends Iterator[MongoOpLogEntry] with Logging {
+ namespace: Option[String] = None,
+ replicaSet: 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 local = mongoClient("local")
+ protected val oplogName : String = if (replicaSet) "oplog.rs" else "oplog.$main"
+ protected val oplog = local(oplogName)
val tsp = verifyOpLog
View
1  src/sphinx/changelog.rst
@@ -13,6 +13,7 @@ Changes in Version 2.5.0
- Added unidoc and updated documentation
- Updated MongoDBList to handle immutable params
- Maven Documentation fix (SCALA-71)
+- MongoOpLog - uses new MongoClient and defaults to replciaSet oplog database
Changes in Version 2.4.1
------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.