Skip to content

Instantly share code, notes, and snippets.

@vaibhaw-
vaibhaw- / gist:505058ab8aa16a6cd7e8
Last active July 5, 2019 09:22
Simple change to add auth to YCSB MongoDB (by ScaleGrid, formerly MongoDirector)
// Visit: http://scalegrid.io (Formerly http://mongodirector.com)
// With Reference:
// https://github.com/brianfrankcooper/YCSB
// commit: 5659fc582c8280e1431ebcfa0891979f806c70ed pulled 1 April 2015.
// The current MongoDB driver code @ mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java doesn't handle MongoDB auth.
// It is also really old. I didn't not want to go and change the entire set of deprecated calls but wanted auth to work for me.
// So I added a new property called mongodb.auth (boolean) and wrote basically 10 lines of code to enable it.
// Putting this out here so that it might help someone else. It's a simple diff.
// Build: mvn clean install
// Remember to comment out/delete the mapkeeper.version entries from the pom.xml to get the mvn build to complete.