-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add API to update multiple counters at once #35
Comments
Unfortunately the Thrift API does not support it. :-(
(Sent from my phone. Please ignore the typos.) saintthor [email protected] schreef:
|
The latest Hbase.thrift definition file has a new method |
thank you. |
@saintthor If it's added in recent versions, there is no way this can be supported in the much older HBase 0.90 release. |
Thanks @nkeyes for the pointer. It looks like the The other function is (The increment value for the |
Here's how I did it in ok_hbase: I added methods on the Connection, Table, and Row classes:
You're right, there doesn't appear to be a way to use increment or incrementRows within a batch request, but incrementRows is sort of a batch request in itself. I think of incrementRows as a special case, and if the developer decides they need it, they understand that it is not batchable with other mutations. |
Relevant Thrift API:
|
Thanks @nkeyes for the explanation. |
Do you happen to know which version introduced this API? Currently HappyBase has '0.90' and '0.92' compatibility modes; this probably needs to be extended when adding API only available in more recent versions. |
I think it came wit 0.94, I don't see it in the 0.92 docs. 0.92 (candidate?): |
what a regret. thanks. |
@wbolster, have you added the feature that writing counters in batch? is it for hbase 0.92 or 0.94? is there docs or examples? |
No, there is no code for this currently. It would require a new compat mode, a new BatchIncrement class, like the current Batch class, tests, and updated docs, but I haven't found time/motivation yet to work on this... so much else to do. :) |
it is all python codes to add this feature, right? i may try it. |
Yes it is, but it may require regenerating the Thrift code using a newer .thrift definition file.
(Sent from my phone. Please ignore the typos.) saintthor [email protected] schreef:
|
do you mean to generate the hbase module with thrift? 2013/10/25 Wouter Bolsterlee [email protected]
|
Yes, because this requires API that was not available when the current version was generated.
(Sent from my tablet. Please ignore the typos.) saintthor [email protected]:
|
Fwiw, I've just updated the Thrift API bundled with HappyBase in dd7878c, so the new Thrift API is now available inside HappyBase (but not exposed in the public API). |
i have added the method in happybase connection module last week. class Connection(object): it works well. if you think it is ok. please add it into happybase. this will make our deployment simpler. |
for a mass data, i use batches to write lines. it is efficient. but the counters take too much time. is there any way to set counters in batch?
The text was updated successfully, but these errors were encountered: