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

[jdbc] Assorted cleanup/fixes around batching and supporting different databases #842

Merged
merged 3 commits into from
Sep 30, 2016

Conversation

joshelser
Copy link
Contributor

A couple of things included in this PR. Happy to split them out if that is preferred. I just came across all of these in some recent testing.

  • Builds on @enis's commit which didn't make it upstream. Implements a "flavor" for Apache Phoenix (which only provides UPSERT to write data, no INSERT)
  • Some basic cleanup of JdbcDBClient (rip out all of the flavors logic into their own files)
  • De-couples batching APIs and autocommit. Again, trying to support Phoenix better, but not break JDBC semantics.
  • Finally, fixes an issue with the existing batching support where the CoreWorkload treated Status.BATCHED_OK as an error (not the same as Status.OK)

@joshelser
Copy link
Contributor Author

@busbey this is the changeset I was referring to earlier today in private chat.

@joshelser
Copy link
Contributor Author

Also, I forgot to mention the testing I had done..

  1. Verified that both thick and thin JDBC drivers work with expected performance after these changes
  2. MySQL works before and after changes with similar perf (workloada)

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.

Overall the changes look good. There are a few minor copyright things that should probably be addressed.

@@ -0,0 +1,65 @@
/**
* 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.

This is a new file?

@@ -0,0 +1,98 @@
/**
* 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.

This is a new file?

@@ -0,0 +1,69 @@
/**
* 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.

New file?

@@ -0,0 +1,110 @@
/**
* Copyright (c) 2010 - 2016 Yahoo! Inc. 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.

New file?

@@ -184,7 +184,7 @@ public Status scan(String table, String startkey, int recordcount,
private void measure(String op, Status result, long intendedStartTimeNanos,
long startTimeNanos, long endTimeNanos) {
String measurementName = op;
if (result != Status.OK) {
if (result == null || !result.isOk()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update copyright on changed file?

@@ -79,6 +79,14 @@ public boolean equals(Object obj) {
return true;
}

/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update copyright on changed file?

@joshelser
Copy link
Contributor Author

Hi @risdenk! Thanks for taking a look -- it's greatly appreciated.

You're entirely right about the license headers: it was not clear to me what the copyright notice should be on new files. I just made a best guess on context. I am happy to fix with proper guidance.

@risdenk
Copy link
Collaborator

risdenk commented Sep 27, 2016

New files are usually:

Copyright (c) 2016 YCSB contributors. All rights reserved.

An example of one that got modified would be something like this:

Copyright (c) 2010 Yahoo! Inc., 2016 YCSB contributors. All rights reserved.

I'm just reciting what I've seen previously. Not sure this is set in stone. Maybe @busbey has an opinion?

@busbey
Copy link
Collaborator

busbey commented Sep 27, 2016

yep, those suggested copyright statements look correct.

@joshelser
Copy link
Contributor Author

yep, those suggested copyright statements look correct.

Great. Thanks @busbey and @risdenk! I'll fix these changes shortly with those recommendations.

enis and others added 3 commits September 28, 2016 13:14
Tried to simplify the distinction between using JDBC's addBatch()/executeBatch()
API calls and "batching" updates via autoCommit=false and a manual commit() after
a given number of updates.

Breaks out flavors into their own package to reduce bloat in JdbcDBClient.

Encompasses changes from Enis Soztutar.
@joshelser
Copy link
Contributor Author

Just updated things with more correct-er license headers. Thanks again for the close look, @risdenk!

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.

Changes look good to me now. Thanks @joshelser. I'll leave this open till Friday in case any other contributors have comments. If no comments and tests pass, I'll merge.

@risdenk risdenk self-assigned this Sep 28, 2016
@risdenk risdenk merged commit dfe0c64 into brianfrankcooper:master Sep 30, 2016
@risdenk
Copy link
Collaborator

risdenk commented Sep 30, 2016

@joshelser thanks for the PR!

@busbey busbey mentioned this pull request Sep 30, 2016
@joshelser
Copy link
Contributor Author

Thanks for the review and merge, @risdenk !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants