Skip to content
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

Merged
merged 9 commits into from
Dec 16, 2016

Conversation

k1xme
Copy link
Contributor

@k1xme k1xme commented Sep 4, 2016

Support Azure DocumentDB.

scan operation is not supported currently.

Copy link
Collaborator

@risdenk risdenk left a 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>
Copy link
Collaborator

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;
Copy link
Collaborator

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.
Copy link
Collaborator

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 @@

Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 2016

@risdenk
Copy link
Collaborator

risdenk commented Sep 27, 2016

Looks like #837 has azure as well. What is the difference between table storage and documentdb?

@risdenk
Copy link
Collaborator

risdenk commented Sep 27, 2016

The binding should probably be something like azuredocumentdb

@risdenk risdenk added the db-new label Sep 27, 2016
@risdenk
Copy link
Collaborator

risdenk commented Oct 31, 2016

@k1xme - any plans to update this PR?

@k1xme
Copy link
Contributor Author

k1xme commented Nov 1, 2016

@risdenk Sorry! I totally forgot this. Will submit the changes by the end of this week.

@risdenk risdenk changed the title Added support for Azure DocumentDB [azuredocumentdb] Added support for Azure DocumentDB Nov 28, 2016
[azuredocumentdb] Refactored code and added license header

[azuredocumentdb] deleted unused class
@k1xme
Copy link
Contributor Author

k1xme commented Dec 13, 2016

@risdenk Sorry for the late update. I've fixed the nits and style problem you mentioned. This PR is ready for integration now.

Copy link
Collaborator

@risdenk risdenk left a 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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package incorrect now?

Copy link
Collaborator

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;
Copy link
Collaborator

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
Copy link
Collaborator

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",
Copy link
Collaborator

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

@k1xme
Copy link
Contributor Author

k1xme commented Dec 14, 2016

@risdenk Done!

Copy link
Collaborator

@risdenk risdenk left a 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>
Copy link
Collaborator

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();
Copy link
Collaborator

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.

Copy link
Collaborator

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();
Copy link
Collaborator

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?

@k1xme
Copy link
Contributor Author

k1xme commented Dec 16, 2016

@risdenk fixed style check errors and exception handling nits per request.

Copy link
Collaborator

@risdenk risdenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @k1xme

@risdenk risdenk merged commit a37bc78 into brianfrankcooper:master Dec 16, 2016
tzm41 pushed a commit to tzm41/YCSB that referenced this pull request May 7, 2017
@manolama manolama mentioned this pull request Sep 22, 2017
@busbey busbey mentioned this pull request May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants