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?

In trunk, take a look at HRegion.checkAndMutate() where you can specifyByteArrayComparable 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, pleasecomment.

> 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

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.

In trunk, take a look at HRegion.checkAndMutate() where you can specifyByteArrayComparable 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, pleasecomment.

> 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

Could you define what you mean by check and append? With respect to HBase, how would that be different from check and put? On Nov 18, 2012, at 12:28 AM, 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>

If you are asking why the HBase API has appends as well as puts, I am not going to play the expert here. Either there is a good reason for it, or not.

My goal in this line of questioning is to understand why there is not a more comprehensive composite atomic operation available. If there is a good reason for the API to include appends, then that reason applies here. If there is no such reason, then you may ignore the appends in my question.

Could you define what you mean by check and append? With respect to HBase, how would that be different from check and put? On Nov 18, 2012, at 12:28 AM, 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>

What I am asking is how you define an append in a system that doesn't support appends.

I'm trying to understand what it is that you wish to achieve.

To give you an answer which you will probably not like... HBase is still very primitive in terms of a full feature functionality. On Nov 19, 2012, at 10:19 AM, Mike Spreitzer <[EMAIL PROTECTED]> wrote:

> If you are asking why the HBase API has appends as well as puts, I am not > going to play the expert here. Either there is a good reason for it, or > not.> > My goal in this line of questioning is to understand why there is not a > more comprehensive composite atomic operation available. If there is a > good reason for the API to include appends, then that reason applies here. > If there is no such reason, then you may ignore the appends in my > question.> > Thanks,> Mike> > > > From: Michael Segel <[EMAIL PROTECTED]>> To: [EMAIL PROTECTED]> Date: 11/18/2012 03:15 PM> Subject: Re: Why only check1-and-putMany and check1-and-deleteMany?> > > > Ok, maybe this is a silly question on my part.... > > Could you define what you mean by check and append? > With respect to HBase, how would that be different from check and put? > > > On Nov 18, 2012, at 12:28 AM, 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>> > >

What I am asking is how you define an append in a system that doesn't support appends.

I'm trying to understand what it is that you wish to achieve.

To give you an answer which you will probably not like... HBase is still very primitive in terms of a full feature functionality. On Nov 19, 2012, at 10:19 AM, Mike Spreitzer <[EMAIL PROTECTED]> wrote:

> If you are asking why the HBase API has appends as well as puts, I am not > going to play the expert here. Either there is a good reason for it, or

> not.> > My goal in this line of questioning is to understand why there is not a > more comprehensive composite atomic operation available. If there is a > good reason for the API to include appends, then that reason applies here. > If there is no such reason, then you may ignore the appends in my > question.> > Thanks,> Mike> > > > From: Michael Segel <[EMAIL PROTECTED]>> To: [EMAIL PROTECTED]> Date: 11/18/2012 03:15 PM> Subject: Re: Why only check1-and-putMany and check1-and-deleteMany?> > > > Ok, maybe this is a silly question on my part.... > > Could you define what you mean by check and append? > With respect to HBase, how would that be different from check and put? > > > On Nov 18, 2012, at 12:28 AM, 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>> > >

Which is what I mean when I ask what you mean by an append. :-)On Nov 19, 2012, at 11:01 AM, Mike Spreitzer <[EMAIL PROTECTED]> wrote:

> I do not know what you mean about HBase not supporting appends. I see > this:> > http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HTableInterface.html#append%28org.apache.hadoop.hbase.client.Append%29> > However, the point of my question is not specific to appends. I am asking > why HBase does not have checkMany-and-mutateMany.> > Thanks,> Mike> > > > From: Michael Segel <[EMAIL PROTECTED]>> To: [EMAIL PROTECTED]> Date: 11/19/2012 11:54 AM> Subject: Re: Why only check1-and-putMany and check1-and-deleteMany?> > > > Mike, > > What I am asking is how you define an append in a system that doesn't > support appends. > > I'm trying to understand what it is that you wish to achieve. > > To give you an answer which you will probably not like... HBase is still > very primitive in terms of a full feature functionality. > > > On Nov 19, 2012, at 10:19 AM, Mike Spreitzer <[EMAIL PROTECTED]> wrote:> >> If you are asking why the HBase API has appends as well as puts, I am > not >> going to play the expert here. Either there is a good reason for it, or > >> not.>> >> My goal in this line of questioning is to understand why there is not a >> more comprehensive composite atomic operation available. If there is a >> good reason for the API to include appends, then that reason applies > here. >> If there is no such reason, then you may ignore the appends in my >> question.>> >> Thanks,>> Mike>> >> >> >> From: Michael Segel <[EMAIL PROTECTED]>>> To: [EMAIL PROTECTED]>> Date: 11/18/2012 03:15 PM>> Subject: Re: Why only check1-and-putMany and > check1-and-deleteMany?>> >> >> >> Ok, maybe this is a silly question on my part.... >> >> Could you define what you mean by check and append? >> With respect to HBase, how would that be different from check and put? >> >> >> On Nov 18, 2012, at 12:28 AM, 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>>> >> >> > >

protoc is able to compile the above code.This means we can potentially compare more than one qualifier in the checkstep.

More discussion is needed to figure out the proper API which would be asuperset of what we have today: public boolean checkAndPut(final byte [] row, final byte [] family, final byte [] qualifier, final byte [] value, final Put put)

> 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>>

+

Ted Yu 2012-11-19, 18:55

NEW: Monitor These Apps!

All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by Sematext