Skip to content
Snippets Groups Projects
Commit e81ced5d authored by Andy Kruth's avatar Andy Kruth
Browse files

Merge pull request #577 from kruthar/orientdb-properties

[orientdb] properties cleanup
parents a5da0860 50173ebe
No related branches found
No related tags found
No related merge requests found
<!--
Copyright (c) 2012 YCSB contributors. All rights reserved.
Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
......@@ -41,13 +41,17 @@ See the next section for the list of configuration parameters for OrientDB.
## OrientDB Configuration Parameters
### `OrientDB.url` (default: `local:C:/temp/databases/ycsb`)
### `OrientDB.user` (default `admin`)
### `OrientDB.password` (default `admin`)
* ```orientdb.url``` - (required) The address to your database.
* Supported storage types: memory, plocal
* EX. ```plocal:/path/to/database```
* ```orientdb.user``` - The user to connect to the database with.
* Default: ```admin```
* ```orientdb.password``` - The password to connect to the database with.
* Default: ```admin```
* ```orientdb.newdb``` - Create the database if it does not exists, or overwrite the database if it does exist.
* Default: ```false```
## Known Issues
* There is a performance issue around the scan operation. This binding uses OIndex.iterateEntriesMajor() which will return unnecessarily large iterators. This has a performance impact as the recordcount goes up. There are ideas in the works to fix it, track it here: [#568](https://github.com/brianfrankcooper/YCSB/issues/568).
* The OIndexCursor used to run the scan operation currently seems to be broken. Because of this, if the startkey and recordcount combination on a particular operation were to cause the iterator to go to the end, a NullPointerException is thrown. With sufficiently high record counts, this does not happen very often, but it could cause false negatives. Track that issue here: https://github.com/orientechnologies/orientdb/issues/5541.
\ No newline at end of file
* The OIndexCursor used to run the scan operation currently seems to be broken. Because of this, if the startkey and recordcount combination on a particular operation were to cause the iterator to go to the end, a NullPointerException is thrown. With sufficiently high record counts, this does not happen very often, but it could cause false negatives. Track that issue here: https://github.com/orientechnologies/orientdb/issues/5541.
......@@ -15,13 +15,6 @@
* LICENSE file.
*/
/**
* OrientDB client binding for YCSB.
*
* Submitted by Luca Garulli on 5/10/2012.
*
*/
package com.yahoo.ycsb.db;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
......@@ -47,16 +40,6 @@ import java.util.Vector;
/**
* OrientDB client for YCSB framework.
*
* Properties to set:
*
* orientdb.url=local:C:/temp/databases or remote:localhost:2424 <br>
* orientdb.database=ycsb <br>
* orientdb.user=admin <br>
* orientdb.password=admin <br>
*
* @author Luca Garulli
*
*/
public class OrientDBClient extends DB {
......@@ -64,22 +47,31 @@ public class OrientDBClient extends DB {
protected ODatabaseDocumentTx db;
private ODictionary<ORecord> dictionary;
private static final String URL_PROPERTY = "orientdb.url";
private static final String USER_PROPERTY = "orientdb.user";
private static final String USER_PROPERTY_DEFAULT = "admin";
private static final String PASSWORD_PROPERTY = "orientdb.password";
private static final String PASSWORD_PROPERTY_DEFAULT = "admin";
private static final String NEWDB_PROPERTY = "orientdb.newdb";
private static final String NEWDB_PROPERTY_DEFAULT = "false";
/**
* Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread.
*/
public void init() throws DBException {
// initialize OrientDB driver
Properties props = getProperties();
String url;
if (System.getProperty("os.name").toLowerCase().contains("win"))
url = props.getProperty("orientdb.url", "plocal:C:/temp/databases/ycsb");
else
url = props.getProperty("orientdb.url", "plocal:/temp/databases/ycsb");
String url = props.getProperty(URL_PROPERTY);
String user = props.getProperty(USER_PROPERTY, USER_PROPERTY_DEFAULT);
String password = props.getProperty(PASSWORD_PROPERTY, PASSWORD_PROPERTY_DEFAULT);
Boolean newdb = Boolean.parseBoolean(props.getProperty(NEWDB_PROPERTY, NEWDB_PROPERTY_DEFAULT));
String user = props.getProperty("orientdb.user", "admin");
String password = props.getProperty("orientdb.password", "admin");
Boolean newdb = Boolean.parseBoolean(props.getProperty("orientdb.newdb", "false"));
if (url == null) {
throw new DBException(String.format("Required property \"%s\" missing for OrientDBClient", URL_PROPERTY));
}
try {
System.out.println("OrientDB loading database url = " + url);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment