[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Status: Patch Available (was: Open) > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Attachment: HBASE_7221.patch > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nick Dimiduk updated HBASE-7221: Component/s: util > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Attachment: hbase-common_hbase_7221_v4.patch Attaching v4 patch with requested refactoring and some other things. Changed package - org.apache.hbase.schema (formerly was in util). There are more classes and I thought adding all of it to util would be too much. Handles multiple hash-functions (now Murmur as well as MD5) Strategy pattern for data conversion (i.e., the -1/0/1 sorting issue with Bytes utility). If you want your own, you can subclass and plug in on RowKeySchema. Builder pattern on RowKeySchema. Changed RowKey to FixedLengthRowKey (this is still stateful because it has both write and read support). > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Status: Open (was: Patch Available) See previous comment about MurmurHash. > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Attachment: hbase-server_hbase_7221_v5.patch Ok, sorry about the previous confusion. Summary of changes from the previous reviews: Changed package - org.apache.hbase.schema (formerly was in util). There are more classes and I thought adding all of it to util would be too much. Handles multiple hash-functions (now Murmur as well as MD5) Strategy pattern for data conversion (i.e., the -1/0/1 sorting issue with Bytes utility). If you want your own, you can subclass and plug in on RowKeySchema. Builder pattern on RowKeySchema. Changed RowKey to FixedLengthRowKey (this is still stateful because it has both write and read support). ALSO: moved from hbase-common to hbase-server. This was a necessity because MurmurHash is in hbase-server. > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch, > hbase-server_hbase_7221_v5.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Status: Patch Available (was: Open) > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch, > hbase-server_hbase_7221_v5.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Attachment: hbase-server_hbase_7221_v6.patch Made RowKeyDataConverter an abstract class Created RowKeyBytesDataConverter the default implementation (i.e., uses Bytes utility) Added Javadoc explanation of the implications of Bytes sort order in RowKeyBytesDataConverter. Added reference in RowKeySchema that RowKeyBytesDataConverter is the default strategy. > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch, > hbase-server_hbase_7221_v5.patch, hbase-server_hbase_7221_v6.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Attachment: hbase-common_hbase_7221_2.patch Moved from server to common, renamed class name to RowKeyBuilder. (7221_2.patch) > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Attachment: hbase-common_hbase_7221_v3.patch Ok, I think this one's a winner. :-) There is a RowKeySchema and a RowKey. This creates fixed-length keys without delimiters (generally considered to be a best practice), and enforces the defined lengths when the elements are set. It's also bi-directional, so that you can pass in a byte-array (i.e., rowkey) from a table and then read the key elements back. Creation example... {code} int elements[] = {RowKeySchema.SIZEOF_MD5_HASH, RowKeySchema.SIZEOF_INT, RowKeySchema.SIZEOF_LONG}; RowKeySchema schema = new RowKeySchema(elements); RowKey rowkey = schema.createRowKey(); rowkey.setHash(0, hashVal); rowkey.setInt(1, intVal); rowkey.setLong(2, longVal); byte bytes[] = rowkey.getBytes(); {code} > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: - Resolution: Won't Fix Status: Resolved (was: Patch Available) Marking as "won't fix" per conference call on the HBase client on 3-5-2013 with folks on this ticket. This ticket will be linked from a new Jira to be created on serialized types and rowkey utility construction and schemas. > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch, > hbase-server_hbase_7221_v5.patch, hbase-server_hbase_7221_v6.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction
[ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nick Dimiduk updated HBASE-7221: Issue Type: Sub-task (was: Improvement) Parent: HBASE-8089 > RowKey utility class for rowkey construction > > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Sub-task > Components: util >Reporter: Doug Meil >Assignee: Doug Meil >Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, > hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch, > hbase-server_hbase_7221_v5.patch, hbase-server_hbase_7221_v6.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly > composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to > you to sensibly populate that byte-array, and that's where things tend to go > off the rails. > The intent of this RowKey utility class isn't meant to add functionality into > Put/Get/Scan, but rather make it simpler for folks to construct said arrays. > Example: > {code} >RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); >key.addHash(a); >key.add(b); >byte bytes[] = key.getBytes(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira