Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> passing a parameter to an observer coprocessor


Copy link to this message
-
Re: passing a parameter to an observer coprocessor
This will need you have to pass the attr with every Mutation. If this level
of dynamic nature you dont want, then as Andy said can impl Observer and
Endpoint and some Singleton object which both can share..

-Anoop-

On Fri, Aug 23, 2013 at 12:18 AM, Anoop John <[EMAIL PROTECTED]> wrote:

> Can use Mutation#setAttribute(String name, byte[] value)  ?    Based on
> this attr value can decide in CP which flow it should go with?
>
> -Anoop-
>
>  On Thu, Aug 22, 2013 at 11:33 PM, Vladimir Rodionov <
> [EMAIL PROTECTED]> wrote:
>
>> Sorry, CF must not be fake, I suppose (because its region coprocessor)
>>
>> put.add(REAL_COLUMN_FAMILY, "flag".getBytes(),"true".getBytes());
>>
>> 'flag' is the fake column. You have to process these columns in your
>> Coprocessor and extract them.
>>
>> Best regards,
>> Vladimir Rodionov
>> Principal Platform Engineer
>> Carrier IQ, www.carrieriq.com
>> e-mail: [EMAIL PROTECTED]
>>
>> ________________________________________
>> From: Vladimir Rodionov
>> Sent: Thursday, August 22, 2013 10:53 AM
>> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>> Subject: RE: passing a parameter to an observer coprocessor
>>
>> Add fake cf + column to your Put operation
>>
>> Put put = new Put(row);
>>
>> put.addFamily("COMMAND".getBytes(), "flag".getBytes(),"true".getBytes());
>>
>> Best regards,
>> Vladimir Rodionov
>> Principal Platform Engineer
>> Carrier IQ, www.carrieriq.com
>> e-mail: [EMAIL PROTECTED]
>>
>> ________________________________________
>> From: Wei Tan [[EMAIL PROTECTED]]
>> Sent: Thursday, August 22, 2013 9:36 AM
>> To: [EMAIL PROTECTED]
>> Subject: passing a parameter to an observer coprocessor
>>
>> Hi all,
>>
>>    I want to add some dynamic behavior to my observer cp, say:
>>
>> postPut(){
>>
>> if(flag) {do function1()};
>> else {do function2()}
>>
>> }
>>
>>   Is there a way to dynamically change the value of flag? One Feasible
>> approaches is to change a value in table descriptor, but then I need to
>> restart the table. Is there a way to pass a parameter using an API, say,
>> from an endpoint, to an observer? Another way to ask this question is, is
>> there a shared variable between an observer, and an endpoint, in a common
>> table?
>>
>> Thanks,
>> Wei
>>
>> Confidentiality Notice:  The information contained in this message,
>> including any attachments hereto, may be confidential and is intended to be
>> read only by the individual or entity to whom this message is addressed. If
>> the reader of this message is not the intended recipient or an agent or
>> designee of the intended recipient, please note that any review, use,
>> disclosure or distribution of this message or its attachments, in any form,
>> is strictly prohibited.  If you have received this message in error, please
>> immediately notify the sender and/or [EMAIL PROTECTED] and
>> delete or destroy any copy of this message and its attachments.
>>
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB