[jira] [Commented] (HBASE-2004) Client javadoc suggestion: add code examples about obtaining historical values
[ https://issues.apache.org/jira/browse/HBASE-2004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373689#comment-16373689 ] Hudson commented on HBASE-2004: --- FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #4632 (See [https://builds.apache.org/job/HBase-Trunk_matrix/4632/]) Revert "HBASE-2004 TestClientClusterStatus is flakey" Revert to fix JIRA (stack: rev 3d2e9e2125ec29c6959c98157ad378d5c53f911d) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java HBASE-20044 TestClientClusterStatus is flakey" Revert "Revert (stack: rev 3434e99e6c728d59ba99141df3730f3e70e0059c) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java > Client javadoc suggestion: add code examples about obtaining historical > values > --- > > Key: HBASE-2004 > URL: https://issues.apache.org/jira/browse/HBASE-2004 > Project: HBase > Issue Type: Improvement > Components: Client >Affects Versions: 0.20.1 >Reporter: Doug Meil >Priority: Minor > > The implicit support HBase provides for versioning of values is very > powerful, but it's not all that obvious for application programmers to use it > to obtain the historical values. > I would like to suggest adding some comments and sample code to the Result > class (org.apache.hadoop.hbase.client.Result) Javadoc. I know this seems > sort of obvious to people that regularly use HBase, but I think that for new > folks having code examples available in Javadoc is helpful because it's "one > stop shopping" for documentation (i.e., as opposed to looking to an external > writeup). Arguably, this type of example could also go in the HTable class > javadoc. > e.g., > HTable table = new HTable(config, "mytable"); > Scan scan = new Scan(); // no arguments indicates will scan all rows > scan.setMaxVersions( 5 ); // setting this to 1 only returns > current version > ResultScanner rs = table.getScanner(scan); > for (Iterator i = rs.iterator(); i.hasNext(); ) { > Result r = i.next(); > // obtains current value from 'family:column' > byte b[] = r.getValue( Bytes.toBytes("family"), Bytes.toBytes("column") > ); > KeyValue kv[] = r.raw(); > for (int j = 0; j < kv.length; j++) { > >byte bv[] = kv[j].getValue(); > // this loop returns both current and historical values >byte bc[] = kv[j].getColumn(); >// returns 'family:column' > } >} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (HBASE-2004) Client javadoc suggestion: add code examples about obtaining historical values
[ https://issues.apache.org/jira/browse/HBASE-2004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16372347#comment-16372347 ] Hudson commented on HBASE-2004: --- FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #4627 (See [https://builds.apache.org/job/HBase-Trunk_matrix/4627/]) HBASE-20042 TestRegionServerAbort flakey (stack: rev 3f82098d4b7ae595aa6702d3fb7cc2fac682691b) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbort.java HBASE-2004 TestClientClusterStatus is flakey (stack: rev 3a3994223c5d634bdd7ef01ef7f31ff860849575) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java HBASE-20042 TestRegionServerAbort flakey; ADDENDUM, RETRY (stack: rev 13223c217ca6cb84a96f3c70b8c38ec19eca729f) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbort.java > Client javadoc suggestion: add code examples about obtaining historical > values > --- > > Key: HBASE-2004 > URL: https://issues.apache.org/jira/browse/HBASE-2004 > Project: HBase > Issue Type: Improvement > Components: Client >Affects Versions: 0.20.1 >Reporter: Doug Meil >Priority: Minor > > The implicit support HBase provides for versioning of values is very > powerful, but it's not all that obvious for application programmers to use it > to obtain the historical values. > I would like to suggest adding some comments and sample code to the Result > class (org.apache.hadoop.hbase.client.Result) Javadoc. I know this seems > sort of obvious to people that regularly use HBase, but I think that for new > folks having code examples available in Javadoc is helpful because it's "one > stop shopping" for documentation (i.e., as opposed to looking to an external > writeup). Arguably, this type of example could also go in the HTable class > javadoc. > e.g., > HTable table = new HTable(config, "mytable"); > Scan scan = new Scan(); // no arguments indicates will scan all rows > scan.setMaxVersions( 5 ); // setting this to 1 only returns > current version > ResultScanner rs = table.getScanner(scan); > for (Iterator i = rs.iterator(); i.hasNext(); ) { > Result r = i.next(); > // obtains current value from 'family:column' > byte b[] = r.getValue( Bytes.toBytes("family"), Bytes.toBytes("column") > ); > KeyValue kv[] = r.raw(); > for (int j = 0; j < kv.length; j++) { > >byte bv[] = kv[j].getValue(); > // this loop returns both current and historical values >byte bc[] = kv[j].getColumn(); >// returns 'family:column' > } >} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)