Skip to content
Prev Previous commit
Next Next commit
Get flags from command line
  • Loading branch information
k1xme committed Dec 12, 2016
commit fa62f1968e257ac714e18825655f1bee05f6203a
23 changes: 18 additions & 5 deletions documentdb/src/main/java/com/yahoo/ycsb/db/DocumentDBClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,30 @@
import java.util.List;

public class DocumentDBClient extends DB {
private static String HOST;
private static String MASTER_KEY;
private static String DATABASE_ID;
private static String COLLECTION_ID;
private static String host;
private static String masterKey;
private static String databaseId;
private static Database database;
private static DocumentClient documentClient;
private static DocumentCollection collection;

@Override
public void init() throws DBException {
documentClient = new DocumentClient(HOST, MASTER_KEY,
host = getProperties().getProperty("documentdb.host", null);
masterKey = getProperties().getProperty("documentdb.masterKey", null);

if (host == null) {
System.err.println("ERROR: 'documentdb.host' must be set!");
System.exit(1);
}

if (masterKey == null) {
System.err.println("ERROR: 'documentdb.masterKey' must be set!");
System.exit(1);
}

databaseId = getProperties().getProperty("documentdb.databaseId", "ycsb");
documentClient = new DocumentClient(host, masterKey,
ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);
// Initialize test database and collection.
getDatabase();
Expand Down