Permalink
Browse files

mongodb client updates for compatibility with mongodb-2.2.jar

  • Loading branch information...
1 parent 85c5af2 commit 0231452bb57827b7f05e701208f307a9e0f2542d @adamhadani adamhadani committed Oct 13, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 db/mongodb/src/com/yahoo/ycsb/db/MongoDbClient.java
@@ -24,7 +24,7 @@
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.Mongo;
-import com.mongodb.DB.WriteConcern;
+import com.mongodb.WriteConcern;
import com.yahoo.ycsb.DB;
import com.yahoo.ycsb.DBException;
@@ -61,7 +61,7 @@ public void init() throws DBException {
if ("none".equals(writeConcernType)) {
writeConcern = WriteConcern.NONE;
} else if ("strict".equals(writeConcernType)) {
- writeConcern = WriteConcern.STRICT;
+ writeConcern = WriteConcern.SAFE;
} else if ("normal".equals(writeConcernType)) {
writeConcern = WriteConcern.NORMAL;
}
@@ -100,7 +100,7 @@ public int delete(String table, String key) {
db.requestStart();
DBCollection collection = db.getCollection(table);
DBObject q = new BasicDBObject().append("_id", key);
- if (writeConcern.equals(WriteConcern.STRICT)) {
+ if (writeConcern.equals(WriteConcern.SAFE)) {
q.put("$atomic", true);
}
collection.remove(q);

0 comments on commit 0231452

Please sign in to comment.