-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[azuredocumentdb] Added support for Azure DocumentDB #838
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look pretty good. I had a few minor comments. Can you squash your commits and start the commit with [documentdb]
<artifactId>documentdb-binding</artifactId> | ||
<name>DocumentDB Binding</name> | ||
|
||
<properties> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed?
@@ -0,0 +1,220 @@ | |||
|
|||
package com.yahoo.ycsb.db; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be in a documentdb package? (com.yahoo.ycsb.db.documentdb
)
@@ -0,0 +1,48 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- | |||
Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2016
@@ -0,0 +1,220 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing license header
@@ -0,0 +1,22 @@ | |||
/* | |||
* Copyright 2015-2016 YCSB Contributors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 2016
Looks like #837 has azure as well. What is the difference between table storage and documentdb? |
The binding should probably be something like |
@k1xme - any plans to update this PR? |
@risdenk Sorry! I totally forgot this. Will submit the changes by the end of this week. |
[azuredocumentdb] Refactored code and added license header [azuredocumentdb] deleted unused class
@risdenk Sorry for the late update. I've fixed the nits and style problem you mentioned. This PR is ready for integration now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the package changes didn't seem to be complete. See comments.
/** | ||
* The YCSB binding for Azure DocumentDB. | ||
*/ | ||
package com.yahoo.ycsb.db; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package incorrect now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also needs to be moved into the package folder
* for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.yahoo.ycsb.db.azuredocumentdb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the package was updated the file needs to be in the folder:
azuredocumentdb/src/main/java/com/yahoo/ycsb/db/azuredocumentdb/AzureDocumentDBClient.java
@@ -35,6 +35,7 @@ cassandra-cql:com.yahoo.ycsb.db.CassandraCQLClient | |||
cassandra2-cql:com.yahoo.ycsb.db.CassandraCQLClient | |||
couchbase:com.yahoo.ycsb.db.CouchbaseClient | |||
couchbase2:com.yahoo.ycsb.db.couchbase2.Couchbase2Client | |||
azuredocumentdb:com.yahoo.ycsb.db.AzureDocumentDBClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be updated to new package location
@@ -60,6 +60,7 @@ DATABASES = { | |||
"cassandra2-cql": "com.yahoo.ycsb.db.CassandraCQLClient", | |||
"couchbase" : "com.yahoo.ycsb.db.CouchbaseClient", | |||
"couchbase2" : "com.yahoo.ycsb.db.couchbase2.Couchbase2Client", | |||
"documentdb" : "com.yahoo.ycsb.db.DocumentDBClient", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be updated to new package location and should be azuredocumentdb
instead of just documentdb
@risdenk Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@k1xme I missed a few items from my previous review:
- Error messages should go to stderr
- checkstyle enforcement should be enabled
- There is one error handling spot that just prints instead of exiting?
|
||
<artifactId>azuredocumentdb-binding</artifactId> | ||
<name>Azure DocumentDB Binding</name> | ||
<properties> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This properties section should be removed. Any checkstyle errors should be fixed as well after this is removed.
// TODO: Something has gone terribly wrong - the app wasn't | ||
// able to query or create the collection. | ||
// Verify your connection, endpoint, and key. | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These errors should be sent to stderr. An example is here:
e.printStackTrace(System.err);
Another option would be to use a logging framework but that would be a bigger change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done for the other places w/ e.printStackTrace()
// TODO: Something has gone terribly wrong - the app wasn't | ||
// able to query or create the collection. | ||
// Verify your connection, endpoint, and key. | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this throw an exception or error? Instead of just printing the message?
@risdenk fixed style check errors and exception handling nits per request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @k1xme
Support Azure DocumentDB.
scan
operation is not supported currently.