You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Jonathan Gray (JIRA)" <ji...@apache.org> on 2010/09/01 04:24:53 UTC
[jira] Created: (HBASE-2946) Increment multiple columns in a row at
once
Increment multiple columns in a row at once
-------------------------------------------
Key: HBASE-2946
URL: https://issues.apache.org/jira/browse/HBASE-2946
Project: HBase
Issue Type: New Feature
Components: client, regionserver
Reporter: Jonathan Gray
Fix For: 0.90.0
Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904889#action_12904889 ]
stack commented on HBASE-2946:
------------------------------
I like idea of an Increment class -- could it subclass Put?
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Fix For: 0.90.0
>
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924728#action_12924728 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: "Jonathan Gray" <jg...@apache.org>
bq. On 2010-10-24 21:41:48, khemani wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/client/Increment.java, line 45
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15904#file15904line45>
bq. >
bq. > setWriteToWal() is missing?
yup. will add.
bq. On 2010-10-24 21:41:48, khemani wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/client/Increment.java, lines 46-47
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15904#file15904line46>
bq. >
bq. > why a navigable map? why not just a map?
u can do things like tailMap[() with it.
bq. On 2010-10-24 21:41:48, khemani wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java, line 3012
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15907#file15907line3012>
bq. >
bq. > I am not sure how it is ensured that the order of iteration over the columns in family.getValue.entrySet() is same as the order of results returned?
bq. >
bq. > Also, if get finds multiple matches then will it return all of them? If yes then this will not work.
familyMap and the map of columns to amounts are both TreeMaps ordered with Bytes.BYTES_COMPARATOR. Results are also guaranteed to be in order. And our Get has maxVersions=1 so we will not get multiple matches per column.
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904884#action_12904884 ]
Jonathan Gray commented on HBASE-2946:
--------------------------------------
Forgot the amount in the second API but you get the picture.
Also, it would be nice if the multiple increments to a row would either all pass or all fail, so this would still be atomic. Should be okay from WAL perspective but since it uses memstoreTS=0, not sure that will jive with the RWCC business. @Ryan, thoughts on that?
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Fix For: 0.90.0
>
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Gray resolved HBASE-2946.
----------------------------------
Resolution: Fixed
Fix Version/s: 0.90.0
Hadoop Flags: [Reviewed]
Committed. Thanks Ryan and Prakash for the reviews!
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
> Fix For: 0.90.0
>
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HBASE-2946) Increment multiple columns in a row at
once
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack updated HBASE-2946:
-------------------------
Fix Version/s: (was: 0.90.0)
Moving out of 0.90.
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904883#action_12904883 ]
Jonathan Gray commented on HBASE-2946:
--------------------------------------
There are two general approaches from an API perspective.
One would be just adding another single HTable call, something like:
{noformat}
long [] incrementColumns(byte [] row, byte [][] families, byte [][] qualifiers, long [] amounts)
{noformat}
The other would be to upgrade our increment friend to his own Increment class. Then he'd operate like Gets/Puts:
{noformat}
long [] increment(new Increment(byte [] row).addColumn(family, qualifier1).addColumn(family, qualifier2))
{noformat}
The latter would be more amenable to HBASE-2947.
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Fix For: 0.90.0
>
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925064#action_12925064 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: thekhemani@facebook.com
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/#review1670
-----------------------------------------------------------
Ship it!
I take back my last comment. This looks great.
- khemani
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Work started: (HBASE-2946) Increment multiple columns in a
row at once
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on HBASE-2946 started by Jonathan Gray.
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924433#action_12924433 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: "Jonathan Gray" <jg...@apache.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/
-----------------------------------------------------------
Review request for hbase, stack and khemani.
Summary
-------
Adds a new Increment class that allows multiple columns (each w/ own increment amount) in a single row being incremented in one call.
The big wins here are being able to do multiple columns in a row in a single RPC and having it be appended/synced to the WAL in a single call.
The current trade-off is that you lose atomicity to readers (ie. this does not currently use RWCC). Eventually it could but for the current use case I am building this for, it's okay like this.
This addresses bug HBASE-2946.
http://issues.apache.org/jira/browse/HBASE-2946
Diffs
-----
trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/client/Increment.java PRE-CREATION
trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java 1026930
trunk/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java 1026930
trunk/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java 1026930
Diff: http://review.cloudera.org/r/1088/diff
Testing
-------
Added TestFromClientSide.testIncrement() which adds some client-side tests of Increment (and mixing w/ original icv call). That passes and most the way through a test suite run.
Thanks,
Jonathan
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924737#action_12924737 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: "Ryan Rawson" <ry...@gmail.com>
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java, line 495
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15909#file15909line495>
bq. >
bq. > yeah you cant compare against memstoreTS because if you have this in here you wont be able to ever increment values that were inserted into the future. you'd just leave them there and continually see it in the 'get' part and then in this code bit leave it in place and create a new KV that is masked by the future KV.
bq. >
bq. > It won't be possible for that insert to be part of an uncommitted change because of the rowlock however. So no atomic-rules will have been broken.
bq.
bq. Jonathan Gray wrote:
bq. i'm not sure i follow. am i doing it wrong? this should be exactly the same as what's there.
bq.
bq. also, we are breaking the atomic-rules across the Increment. Each column is not broken but across them it is (for reads not writes).
bq.
bq. It seems like we could use RWCC though for increments. I think it's fine that if you're using increment you can never write data into it w/ another API (or really, with manual timestamps).
there is no easy way to include RWCC right now, because you have to be careful about 'committing' the new values before removing the old ones. This is a bit tricky because normally the RWCC 'commit' happens at the HRegion level, and right now we are inside memstore/store. Hopefully people won't need atomic reads of multi incremented values. If one is doing counters this would be the case. Javadoc should definitely yell about this.
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java, line 377
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15909#file15909line377>
bq. >
bq. > I'm not sure how this code is optional for your new 'upsert', here are some use cases that I found painful:
bq. >
bq. > - when the KV is in snapshot we can create new KVs in memstore with the same TS. This means you have a dup and before we had this new 'dup' code it ruined counts badly.
bq. > - the Math.max() bit it to ensure the new KV isnt being created in the past a bit and accidently duplicating a timestamp inside the snapshot.
bq.
bq. Jonathan Gray wrote:
bq. what do you mean by optional? there shouldn't be any real difference. this code is basically the exact same code that was there but now pulled into a method that can be reused.
The original updateColumnValue code was structured like this:
- look in snapshot
- loop over kvset
Create new KV, insert it
- loop over kvset
But you only included the 2nd half. Your new 'upsert' only includes half the implementation of updateColumnValue.
This comes up in this scenario:
- increment at TS=100
- snapshot, now we have kvset={} and a KV, TS=100 in snapshot
- increment at TS=100
Without the code i have above we'll end up with 2 KVs, both of TS=100, one in kvset, one in snapshot, which then becomes a HFile.
When future reads happen, if they don't see the 'correct' KV, you will end up with lost updates.
In theory the 'read memstore first' and 'order duplicate TS KVs' patches should resolve this. Lost updates reallllllly suck though. I'd probably recommend the conservative course, because I already went thru this and it sucks. If you decide that you are willing to risk it, I might recommend this particular test case:
- increment some data at TS=X
- snapshot at TS=X
- increment some data at TS=X, now you have 2 * KV, TS=X
- flush to hfile
- increment at TS=X, ensure you dont lose any updates
- snapshot/flush with TS=X in kvset->snapshot->hfile
- compact the 2 hfiles both with TS=X in them
- do read and make sure the value is what you expect.
By using the manual environment edge you can control the currentTimeMillis() returned inside HRegion and down.
This covers the worst case scenario I think, since normally one would get increments and you shouldn't get TS=X * 2 in a single HFile.
- Ryan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/#review1641
-----------------------------------------------------------
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924751#action_12924751 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: "Jonathan Gray" <jg...@apache.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/
-----------------------------------------------------------
(Updated 2010-10-25 15:06:49.931026)
Review request for hbase, stack and khemani.
Changes
-------
Changes from Ryan and Prakash reviews.
We could use a nice test of this concurrent w/ snapshotting, flushing, etc... I don't have much time to do that now but would like to get this committed. It works in general and does not change anything in the existing incrementColumnValue call, it's only the Increment that skips the snapshot check.
Trying to get this committed so we can push it out to some clusters and start hammering it.
Summary
-------
Adds a new Increment class that allows multiple columns (each w/ own increment amount) in a single row being incremented in one call.
The big wins here are being able to do multiple columns in a row in a single RPC and having it be appended/synced to the WAL in a single call.
The current trade-off is that you lose atomicity to readers (ie. this does not currently use RWCC). Eventually it could but for the current use case I am building this for, it's okay like this.
This addresses bug HBASE-2946.
http://issues.apache.org/jira/browse/HBASE-2946
Diffs (updated)
-----
trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/client/Increment.java PRE-CREATION
trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java 1026935
trunk/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java 1026935
trunk/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java 1026935
Diff: http://review.cloudera.org/r/1088/diff
Testing
-------
Added TestFromClientSide.testIncrement() which adds some client-side tests of Increment (and mixing w/ original icv call). That passes and most the way through a test suite run.
Thanks,
Jonathan
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924441#action_12924441 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: "Jonathan Gray" <jg...@apache.org>
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java, line 195
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15905#file15905line195>
bq. >
bq. > adding trailing spaces
bq. >
that's my patch removing trailing spaces
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java, line 201
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15905#file15905line201>
bq. >
bq. > adding more trailing spaces, your ide should have a feature to strip these
same here... i'm on the right :)
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java, line 495
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15909#file15909line495>
bq. >
bq. > yeah you cant compare against memstoreTS because if you have this in here you wont be able to ever increment values that were inserted into the future. you'd just leave them there and continually see it in the 'get' part and then in this code bit leave it in place and create a new KV that is masked by the future KV.
bq. >
bq. > It won't be possible for that insert to be part of an uncommitted change because of the rowlock however. So no atomic-rules will have been broken.
i'm not sure i follow. am i doing it wrong? this should be exactly the same as what's there.
also, we are breaking the atomic-rules across the Increment. Each column is not broken but across them it is (for reads not writes).
It seems like we could use RWCC though for increments. I think it's fine that if you're using increment you can never write data into it w/ another API (or really, with manual timestamps).
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java, line 377
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15909#file15909line377>
bq. >
bq. > I'm not sure how this code is optional for your new 'upsert', here are some use cases that I found painful:
bq. >
bq. > - when the KV is in snapshot we can create new KVs in memstore with the same TS. This means you have a dup and before we had this new 'dup' code it ruined counts badly.
bq. > - the Math.max() bit it to ensure the new KV isnt being created in the past a bit and accidently duplicating a timestamp inside the snapshot.
what do you mean by optional? there shouldn't be any real difference. this code is basically the exact same code that was there but now pulled into a method that can be reused.
bq. On 2010-10-24 20:05:55, Ryan Rawson wrote:
bq. > trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java, line 466
bq. > <http://review.cloudera.org/r/1088/diff/2/?file=15909#file15909line466>
bq. >
bq. > im not sure i like the name upsert, it is too rdbms-y for me.
bq. >
bq. > I need to poke more at this, but i prever the matchingRow() call, it encapsulates the getRowOffset junk, which leaks wayyy too much all over the place.
bq. >
bq. >
Sure, could use those calls. Not even sure why I changed this, wrote that part of this patch a few weeks ago.
And it's an "update if it exists, insert if not" operation which I think of as an upsert operation. Open to whatever tho.
- Jonathan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/#review1641
-----------------------------------------------------------
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Gray reassigned HBASE-2946:
------------------------------------
Assignee: Jonathan Gray
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
> Fix For: 0.90.0
>
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925047#action_12925047 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: thekhemani@facebook.com
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/#review1669
-----------------------------------------------------------
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
<http://review.cloudera.org/r/1088/#comment5545>
This might not work if getLastIncrement() returns fewer counters in the result than what was queried.
- khemani
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904890#action_12904890 ]
Jonathan Gray commented on HBASE-2946:
--------------------------------------
It could I suppose. Put is a list of KVs. We could actually munge it into a list of KVs but otherwise it'd be more like a Get with a familyMap.
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Fix For: 0.90.0
>
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2946) Increment multiple columns in a row
at once
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924753#action_12924753 ]
HBase Review Board commented on HBASE-2946:
-------------------------------------------
Message from: "Ryan Rawson" <ry...@gmail.com>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1088/#review1660
-----------------------------------------------------------
trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
<http://review.cloudera.org/r/1088/#comment5541>
your logic is correct, and normally this is an issue, but there is this line a few down:
now = Math.max(now, kv.getTimestamp());
I havent played with the new sorting thing, the big problem is you get lost updates via ICV if things dont go right.
I just had a notion, when we do the 'get from memstore first' how do we handle duplicate TSs in snapshot and kvset... looking at the memstore scanner, i see this:
return getLower(kvsetNextRow,
snapshotNextRow);
and inside the implementation of getLower(), we return 'kvsetNextRow' when the two compare to the same. So it should be ok. If it doesn't work out, the worst case scenario is probably losing 1ms worth of updates.
- Ryan
> Increment multiple columns in a row at once
> -------------------------------------------
>
> Key: HBASE-2946
> URL: https://issues.apache.org/jira/browse/HBASE-2946
> Project: HBase
> Issue Type: New Feature
> Components: client, regionserver
> Reporter: Jonathan Gray
> Assignee: Jonathan Gray
>
> Currently there is no way to do multiple increments to a single row in one RPC. This jira is about adding an HTable and HRegionInterface method to increment multiple columns within a single row at once.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.