Silly question... Why? I mean while it is technically feasible to do, can you come up with a use case and then show how it is better than the alternatives?
Sent from a remote device. Please excuse any typos... Mike Segel On Nov 29, 2012, at 12:44 PM, Jonathan Hsieh <[email protected]> wrote: > Actually, I think we'd want to have repeated Conditions in to have multiple > check predicates, and would want to add repeated Conditions to multi > requests. > > This would let us have arbitrary number of checks and arbitrary number of > puts and deletes from an API point of view. > > Jon. > > On Mon, Nov 19, 2012 at 10:55 AM, Ted Yu <[email protected]> wrote: > >> Looking at hbase-server/src/main/protobuf/Client.proto in trunk, I tried >> the following formation to see if we can pass more than one qualifier: >> >> Index: hbase-server/src/main/protobuf/Client.proto >> =================================================================== >> --- hbase-server/src/main/protobuf/Client.proto (revision 1411337) >> +++ hbase-server/src/main/protobuf/Client.proto (working copy) >> @@ -97,7 +97,7 @@ >> message Condition { >> required bytes row = 1; >> required bytes family = 2; >> - required bytes qualifier = 3; >> + repeated bytes qualifier = 3; >> required CompareType compareType = 4; >> required Comparator comparator = 5; >> } >> >> protoc is able to compile the above code. >> This means we can potentially compare more than one qualifier in the check >> step. >> >> More discussion is needed to figure out the proper API which would be a >> superset of what we have today: >> public boolean checkAndPut(final byte [] row, >> final byte [] family, final byte [] qualifier, final byte [] value, >> final Put put) >> >> Cheers >> >> On Sat, Nov 17, 2012 at 10:28 PM, Mike Spreitzer <[email protected] >>> wrote: >> >>> I am not looking at the trunk. I am just a user looking at the interface >>> documented on the web site and wondering why the atomic composite >>> functionality is so limited. It is not hard to imagine an expanded >>> interface that allows checking an arbitrary set of columns and, if each >>> has a value specified for it, doing an arbitrary set of Mutations. >>> >>> Thanks, >>> Mike >>> >>> >>> >>> From: Ted Yu <[email protected]> >>> To: [email protected] >>> Date: 11/17/2012 11:44 PM >>> Subject: Re: Why only check1-and-putMany and >> check1-and-deleteMany? >>> >>> >>> >>> Are you looking at trunk code ? >>> >>> In trunk, take a look at HRegion.checkAndMutate() where you can specify >>> ByteArrayComparable which does the comparison (matching). >>> There is still the limit of single value: >>> } else if (result.size() == 1 && !valueIsNull) { >>> KeyValue kv = result.get(0); >>> >>> For the moment, only Put and Delete are supported: >>> >>> if (!isPut && !(w instanceof Delete)) >>> throw new DoNotRetryIOException("Action must be Put or Delete"); >>> If you have suggestion on how the check part can be more general, please >>> comment. >>> >>> Thanks >>> >>> On Sat, Nov 17, 2012 at 7:30 PM, Mike Spreitzer <[email protected]> >>> wrote: >>> >>>> If I understand correctly, an HTable has two composite atomic >>> operations, >>>> checkAndPut and checkAndDelete. The check part checks just a single >>>> column's value. Why not allow checking more than one column? >>>> >>>> Why no checkAndAppend? >>>> >>>> The checkAndPut operation can put to multiple columns, right? And the >>>> checkAndDelete operation can delete multiple columns, right? Why not >>> let >>>> them be mixed? Why not checkAndMutate? >>>> >>>> Thanks! >>>> Mike > > > > -- > // Jonathan Hsieh (shay) > // Software Engineer, Cloudera > // [email protected]
