[ https://issues.apache.org/jira/browse/HBASE-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13163923#comment-13163923 ]
jirapos...@reviews.apache.org commented on HBASE-4605: ------------------------------------------------------ ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2579/#review3653 ----------------------------------------------------------- Answering most of the big issues on HBASE-4605 since there is a clean summary there by Ted. src/main/java/org/apache/hadoop/hbase/constraint/BaseConstraint.java <https://reviews.apache.org/r/2579/#comment8150> Done src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java <https://reviews.apache.org/r/2579/#comment8151> Done src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java <https://reviews.apache.org/r/2579/#comment8153> this could definitely be an extension. +1 on future considerations. src/main/java/org/apache/hadoop/hbase/constraint/ConstraintException.java <https://reviews.apache.org/r/2579/#comment8152> Done src/main/java/org/apache/hadoop/hbase/constraint/ConstraintProcessor.java <https://reviews.apache.org/r/2579/#comment8154> done src/main/java/org/apache/hadoop/hbase/constraint/Constraints.java <https://reviews.apache.org/r/2579/#comment8147> I think we pulled getValueAsBytes() from HTD since this was the only use case. Agreed that it is a bit awkward, but we figured that since this is really the only use case for it, it didn't make sense to keep that function around. Adding this back in makes it easier to remove guava, since that ser/deser can be kept entirely under the covers. src/main/java/org/apache/hadoop/hbase/constraint/Constraints.java <https://reviews.apache.org/r/2579/#comment8148> +1 on using the configuration. Originally, this was done to ensure that the configuration could be completely open to the user, but constraining (no pun intended) the conf by a couple values is not a big deal. However, again we are at the question of keeping it human readable or not. See top comment. src/main/java/org/apache/hadoop/hbase/constraint/IntegerConstraint.java <https://reviews.apache.org/r/2579/#comment8149> Moved to documentation. - Jesse On 2011-11-29 20:19:41, Jesse Yates wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/2579/ bq. ----------------------------------------------------------- bq. bq. (Updated 2011-11-29 20:19:41) bq. bq. bq. Review request for hbase. bq. bq. bq. Summary bq. ------- bq. bq. Most of the implementation for adding constraints as a coprocessor. bq. bq. Looking for general comments on style/structure, though nitpicks are ok too. bq. bq. Currently missing implementation for disableConstraints() since that will require adding removeCoprocessor() to HTD (also comments on if this is worth it would be good). bq. bq. bq. This addresses bug HBASE-4605. bq. https://issues.apache.org/jira/browse/HBASE-4605 bq. bq. bq. Diffs bq. ----- bq. bq. src/docbkx/book.xml 3c12169 bq. src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java 84a0d1a bq. src/main/java/org/apache/hadoop/hbase/constraint/BaseConstraint.java PRE-CREATION bq. src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java PRE-CREATION bq. src/main/java/org/apache/hadoop/hbase/constraint/ConstraintException.java PRE-CREATION bq. src/main/java/org/apache/hadoop/hbase/constraint/ConstraintProcessor.java PRE-CREATION bq. src/main/java/org/apache/hadoop/hbase/constraint/Constraints.java PRE-CREATION bq. src/main/java/org/apache/hadoop/hbase/constraint/IntegerConstraint.java PRE-CREATION bq. src/main/java/org/apache/hadoop/hbase/constraint/package-info.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/AllFailConstraint.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/AllPassConstraint.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/CheckConfigurationConstraint.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/IntegrationTestConstraint.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/RuntimeFailConstraint.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/TestConstraints.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/TestIntegerConstraint.java PRE-CREATION bq. src/test/java/org/apache/hadoop/hbase/constraint/WorksConstraint.java PRE-CREATION bq. bq. Diff: https://reviews.apache.org/r/2579/diff bq. bq. bq. Testing bq. ------- bq. bq. Adding IntegrationTestConstraint and unit tests for Constraints and IntegerConstraint. All of those pass. bq. bq. bq. Thanks, bq. bq. Jesse bq. bq. > Constraints > ----------- > > Key: HBASE-4605 > URL: https://issues.apache.org/jira/browse/HBASE-4605 > Project: HBase > Issue Type: Improvement > Components: client, coprocessors > Affects Versions: 0.94.0 > Reporter: Jesse Yates > Assignee: Jesse Yates > Attachments: 4605.v7, constraint_as_cp.txt, java_Constraint_v2.patch, > java_HBASE-4605_v1.patch, java_HBASE-4605_v2.patch, java_HBASE-4605_v3.patch > > > From Jesse's comment on dev: > {quote} > What I would like to propose is a simple interface that people can use to > implement a 'constraint' (matching the classic database definition). This > would help ease of adoption by helping HBase more easily check that box, help > minimize code duplication across organizations, and lead to easier adoption. > Essentially, people would implement a 'Constraint' interface for checking > keys before they are put into a table. Puts that are valid get written to the > table, but if not people can will throw an exception that gets propagated > back to the client explaining why the put was invalid. > Constraints would be set on a per-table basis and the user would be expected > to ensure the jars containing the constraint are present on the machines > serving that table. > Yes, people could roll their own mechanism for doing this via coprocessors > each time, but this would make it easier to do so, so you only have to > implement a very minimal interface and not worry about the specifics. > {quote} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira