You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Sreeram <sr...@gmail.com> on 2017/01/28 12:23:33 UTC

Question on WALEdit

Hi,

TL;DR:  In my use case I am setting attributes for Puts and Deletes using
setAttribute(). I would like to know if it is possible to get the
attributes that I had set from the WALEdit ?

Here is my use case in detail: I have a replicated cluster A which gets
replicated to cluster B. From cluster B, I would like to track the events
as they get written to B. I set the event-id as an attribute to the
mutation in cluster A.

I will have a coProcessor in cluster B that gets invoked on postWALWrite,
If I can retrieve the event-id from the WALEdit, I would be able to track
those events that got replicated successfully in cluster B.

I went through the WALEdit API and it is not obvious to me if it is
possible to retrieve the attributes set on the row mutation.

Kindly let me know your suggestions.

Regards,
Sreeram

Re: Question on WALEdit

Posted by Anoop John <an...@gmail.com>.
Attributes added to Mutation (via setAttribute) will NOT get
persistent in cells..  As Ted suggested, tags is the way..   There is
no way to pass Tags from client as of now.. I believe u have eventId
thing in server side only.. So  u can add Tags to cells at server side
only  (via some CP hooks).  Tags getting persisted in HFiles, WAL and
getting replicated also.

-Anoop-

On Mon, Jan 30, 2017 at 8:24 AM, Sreeram <sr...@gmail.com> wrote:
> Thank you very much Ted.  I understand fetching the tags will fetch the
> associated attributes for a mutation. Will try out the same.
>
> Regards,
> Sreeram
>
> On 29 Jan 2017 00:37, "Ted Yu" <yu...@gmail.com> wrote:
>
> In CellUtil, there is the following method:
>
>   public static Tag getTag(Cell cell, byte type){
>
>
> In MobUtils, you can find sample usage:
>
>   public static Tag getTableNameTag(Cell cell) {
>
>     if (cell.getTagsLength() > 0) {
>
>       return CellUtil.getTag(cell, TagType.MOB_TABLE_NAME_TAG_TYPE);
>
> FYI
>
> On Sat, Jan 28, 2017 at 8:29 AM, Ted Yu <yu...@gmail.com> wrote:
>
>> I haven't found the API you were looking for.
>>
>> Which release of hbase are you using ?
>> I assume it supports tags.
>>
>> If you use tag to pass event-id, you can retrieve thru this method of
>> WALEdit:
>>
>>   public ArrayList<Cell> getCells() {
>>
>> From Cell, there're 3 methods for retrieving tag starting with:
>>
>>   byte[] getTagsArray();
>>
>> Cheers
>>
>> On Sat, Jan 28, 2017 at 4:23 AM, Sreeram <sr...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> TL;DR:  In my use case I am setting attributes for Puts and Deletes using
>>> setAttribute(). I would like to know if it is possible to get the
>>> attributes that I had set from the WALEdit ?
>>>
>>> Here is my use case in detail: I have a replicated cluster A which gets
>>> replicated to cluster B. From cluster B, I would like to track the events
>>> as they get written to B. I set the event-id as an attribute to the
>>> mutation in cluster A.
>>>
>>> I will have a coProcessor in cluster B that gets invoked on postWALWrite,
>>> If I can retrieve the event-id from the WALEdit, I would be able to track
>>> those events that got replicated successfully in cluster B.
>>>
>>> I went through the WALEdit API and it is not obvious to me if it is
>>> possible to retrieve the attributes set on the row mutation.
>>>
>>> Kindly let me know your suggestions.
>>>
>>> Regards,
>>> Sreeram
>>>
>>
>>

Re: Question on WALEdit

Posted by Sreeram <sr...@gmail.com>.
Thank you very much Ted.  I understand fetching the tags will fetch the
associated attributes for a mutation. Will try out the same.

Regards,
Sreeram

On 29 Jan 2017 00:37, "Ted Yu" <yu...@gmail.com> wrote:

In CellUtil, there is the following method:

  public static Tag getTag(Cell cell, byte type){


In MobUtils, you can find sample usage:

  public static Tag getTableNameTag(Cell cell) {

    if (cell.getTagsLength() > 0) {

      return CellUtil.getTag(cell, TagType.MOB_TABLE_NAME_TAG_TYPE);

FYI

On Sat, Jan 28, 2017 at 8:29 AM, Ted Yu <yu...@gmail.com> wrote:

> I haven't found the API you were looking for.
>
> Which release of hbase are you using ?
> I assume it supports tags.
>
> If you use tag to pass event-id, you can retrieve thru this method of
> WALEdit:
>
>   public ArrayList<Cell> getCells() {
>
> From Cell, there're 3 methods for retrieving tag starting with:
>
>   byte[] getTagsArray();
>
> Cheers
>
> On Sat, Jan 28, 2017 at 4:23 AM, Sreeram <sr...@gmail.com> wrote:
>
>> Hi,
>>
>> TL;DR:  In my use case I am setting attributes for Puts and Deletes using
>> setAttribute(). I would like to know if it is possible to get the
>> attributes that I had set from the WALEdit ?
>>
>> Here is my use case in detail: I have a replicated cluster A which gets
>> replicated to cluster B. From cluster B, I would like to track the events
>> as they get written to B. I set the event-id as an attribute to the
>> mutation in cluster A.
>>
>> I will have a coProcessor in cluster B that gets invoked on postWALWrite,
>> If I can retrieve the event-id from the WALEdit, I would be able to track
>> those events that got replicated successfully in cluster B.
>>
>> I went through the WALEdit API and it is not obvious to me if it is
>> possible to retrieve the attributes set on the row mutation.
>>
>> Kindly let me know your suggestions.
>>
>> Regards,
>> Sreeram
>>
>
>

Re: Question on WALEdit

Posted by Ted Yu <yu...@gmail.com>.
In CellUtil, there is the following method:

  public static Tag getTag(Cell cell, byte type){


In MobUtils, you can find sample usage:

  public static Tag getTableNameTag(Cell cell) {

    if (cell.getTagsLength() > 0) {

      return CellUtil.getTag(cell, TagType.MOB_TABLE_NAME_TAG_TYPE);

FYI

On Sat, Jan 28, 2017 at 8:29 AM, Ted Yu <yu...@gmail.com> wrote:

> I haven't found the API you were looking for.
>
> Which release of hbase are you using ?
> I assume it supports tags.
>
> If you use tag to pass event-id, you can retrieve thru this method of
> WALEdit:
>
>   public ArrayList<Cell> getCells() {
>
> From Cell, there're 3 methods for retrieving tag starting with:
>
>   byte[] getTagsArray();
>
> Cheers
>
> On Sat, Jan 28, 2017 at 4:23 AM, Sreeram <sr...@gmail.com> wrote:
>
>> Hi,
>>
>> TL;DR:  In my use case I am setting attributes for Puts and Deletes using
>> setAttribute(). I would like to know if it is possible to get the
>> attributes that I had set from the WALEdit ?
>>
>> Here is my use case in detail: I have a replicated cluster A which gets
>> replicated to cluster B. From cluster B, I would like to track the events
>> as they get written to B. I set the event-id as an attribute to the
>> mutation in cluster A.
>>
>> I will have a coProcessor in cluster B that gets invoked on postWALWrite,
>> If I can retrieve the event-id from the WALEdit, I would be able to track
>> those events that got replicated successfully in cluster B.
>>
>> I went through the WALEdit API and it is not obvious to me if it is
>> possible to retrieve the attributes set on the row mutation.
>>
>> Kindly let me know your suggestions.
>>
>> Regards,
>> Sreeram
>>
>
>

Re: Question on WALEdit

Posted by Ted Yu <yu...@gmail.com>.
I haven't found the API you were looking for.

Which release of hbase are you using ?
I assume it supports tags.

If you use tag to pass event-id, you can retrieve thru this method of
WALEdit:

  public ArrayList<Cell> getCells() {

From Cell, there're 3 methods for retrieving tag starting with:

  byte[] getTagsArray();

Cheers

On Sat, Jan 28, 2017 at 4:23 AM, Sreeram <sr...@gmail.com> wrote:

> Hi,
>
> TL;DR:  In my use case I am setting attributes for Puts and Deletes using
> setAttribute(). I would like to know if it is possible to get the
> attributes that I had set from the WALEdit ?
>
> Here is my use case in detail: I have a replicated cluster A which gets
> replicated to cluster B. From cluster B, I would like to track the events
> as they get written to B. I set the event-id as an attribute to the
> mutation in cluster A.
>
> I will have a coProcessor in cluster B that gets invoked on postWALWrite,
> If I can retrieve the event-id from the WALEdit, I would be able to track
> those events that got replicated successfully in cluster B.
>
> I went through the WALEdit API and it is not obvious to me if it is
> possible to retrieve the attributes set on the row mutation.
>
> Kindly let me know your suggestions.
>
> Regards,
> Sreeram
>