Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase, mail # user - attributes - basic question


+
Toby Lazar 2013-02-22, 18:41
+
Harsh J 2013-02-22, 21:24
+
Toby Lazar 2013-02-22, 22:37
+
Anoop Sam John 2013-02-23, 05:15
Copy link to this message
-
Re: attributes - basic question
James Taylor 2013-02-23, 05:21
Same with us on Phoenix - we use the setAttribute on the client side and
the getAttribute on the server side to pickup state on the Scan being
executed. Works great. One thing to keep in mind, though: for a region
observer coprocessor, the state you set on the client side will be sent
to each region individually, so if you have some large global state, you
might want to use a different mechanism to get it over to the server side.

     James

On 02/22/2013 09:15 PM, Anoop Sam John wrote:
> We have used setAttribute() along with Scan which we are using in the CP.  Ya it will work fine.
> Pls try with ur use case and if finding any issue pls report
>
> -Anoop-
> ________________________________________
> From: Toby Lazar [[EMAIL PROTECTED]]
> Sent: Saturday, February 23, 2013 4:07 AM
> To: [EMAIL PROTECTED]
> Subject: Re: attributes - basic question
>
> Your last point was exactly what I was looking for.  I am thinking about
> using attributes along with coprocessors to impose some application-level
> authorization constraints.  For example, in a get, I can pass username and
> credential attributes and have the coprocessor filter results based on some
> rules or group membership.  Of course, I'll need to make sure that that
> step doesn't violate regular good practices for coprocessors.  If anyone
> has used attributes for any similar purpose, I'd be interested in hearing
> about those experiences.
>
> Thanks,
>
> Toby
>
>
>
> On Fri, Feb 22, 2013 at 4:24 PM, Harsh J <[EMAIL PROTECTED]> wrote:
>
>> The attributes are serialized along with the base operation request.
>> There's perhaps no immediate client-side usage of this, it is used by
>> the Mutation class to set a cluster ID in HBase's Replication context:
>>
>> http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Mutation.java?view=markup
>>
>> I suppose it could also be used to tag client requests, and used along
>> with Coprocessors that way for some behavior differences.
>>
>> On Sat, Feb 23, 2013 at 12:11 AM, Toby Lazar <[EMAIL PROTECTED]> wrote:
>>> What is the purpose of the getAttribute and setAttribute methods for
>>> classes implementing OperationWithAttributes?  I don't see much
>>> documentation about them, haven't seen much discussion on this list about
>>> them, and am wondering what people use them for.  Or, are they mostly
>> just
>>> used internally?  Any insights about these methods are appreciated.
>>>
>>> Thanks!
>>>
>>> Toby
>>
>>
>> --
>> Harsh J
> >