You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by "Liu, Ming (HPIT-GADSC)" <mi...@hp.com> on 2015/01/21 02:43:18 UTC

Given a Put object, is there any way to change the timestamp of it?

Hello, there,

I am developing a coprocessor under HBase 0.98.6. The client send a Put object to the coprocessor in Protobuf, when the coprocessor receive the message , it invokes ProtobufUtil.toPut to convert it to a Put object. Do various checking  and then put it into HBase table.
Now, I get a requirement to change the timestamp of that Put object, but I found no way to do this.

I was first try to generate a new Put object with a new timestamp, and try to copy the old one into this new object. But I found given a Put object, I have no way to get ALL its cells out if I don't know the column family and column qualifier name in advance. In my case, those CF/Column names are random as user defined. So I stuck here. Could anyone have idea how to workaround this?

The Mutation class has getTimestamp() method but no setTimestamp(). I wish there is a setTimestamp() for it. Is there any reason it is not provided? I hope in future release Mutation can expose a setTimestamp() method, is it possible? If so, my job will get much easier...

Thanks,
Ming

Re: Given a Put object, is there any way to change the timestamp of it?

Posted by Ted Yu <yu...@gmail.com>.
Put is marked @InterfaceStability.Stable though Mutation is marked with @
InterfaceStability.Evolving

I doubt setTimeStamp() would be added.


Cheers

On Wed, Jan 21, 2015 at 4:18 AM, Liu, Ming (HPIT-GADSC) <mi...@hp.com>
wrote:

> Thanks Ted!
> This is exactly what I need.
>
> This will be a memory copy, but it solves my problem. Hope HBase can
> provide a setTimeStamp() method in future release.
>
> Best Regards,
> Ming
>
> -----Original Message-----
> From: Ted Yu [mailto:yuzhihong@gmail.com]
> Sent: Wednesday, January 21, 2015 11:30 AM
> To: user@hbase.apache.org
> Subject: Re: Given a Put object, is there any way to change the timestamp
> of it?
>
> bq. I have no way to get ALL its cells out Mutation has the following
> method:
>
>   public NavigableMap<byte [], List<Cell>> getFamilyCellMap() {
>
> FYI
>
> On Tue, Jan 20, 2015 at 5:43 PM, Liu, Ming (HPIT-GADSC) <mi...@hp.com>
> wrote:
>
> > Hello, there,
> >
> > I am developing a coprocessor under HBase 0.98.6. The client send a
> > Put object to the coprocessor in Protobuf, when the coprocessor
> > receive the message , it invokes ProtobufUtil.toPut to convert it to a
> > Put object. Do various checking  and then put it into HBase table.
> > Now, I get a requirement to change the timestamp of that Put object,
> > but I found no way to do this.
> >
> > I was first try to generate a new Put object with a new timestamp, and
> > try to copy the old one into this new object. But I found given a Put
> > object, I have no way to get ALL its cells out if I don't know the
> > column family and column qualifier name in advance. In my case, those
> > CF/Column names are random as user defined. So I stuck here. Could
> > anyone have idea how to workaround this?
> >
> > The Mutation class has getTimestamp() method but no setTimestamp(). I
> > wish there is a setTimestamp() for it. Is there any reason it is not
> > provided? I hope in future release Mutation can expose a
> > setTimestamp() method, is it possible? If so, my job will get much
> easier...
> >
> > Thanks,
> > Ming
> >
>

RE: Given a Put object, is there any way to change the timestamp of it?

Posted by "Liu, Ming (HPIT-GADSC)" <mi...@hp.com>.
Thanks Ted!
This is exactly what I need. 

This will be a memory copy, but it solves my problem. Hope HBase can provide a setTimeStamp() method in future release.

Best Regards,
Ming

-----Original Message-----
From: Ted Yu [mailto:yuzhihong@gmail.com] 
Sent: Wednesday, January 21, 2015 11:30 AM
To: user@hbase.apache.org
Subject: Re: Given a Put object, is there any way to change the timestamp of it?

bq. I have no way to get ALL its cells out Mutation has the following method:

  public NavigableMap<byte [], List<Cell>> getFamilyCellMap() {

FYI

On Tue, Jan 20, 2015 at 5:43 PM, Liu, Ming (HPIT-GADSC) <mi...@hp.com>
wrote:

> Hello, there,
>
> I am developing a coprocessor under HBase 0.98.6. The client send a 
> Put object to the coprocessor in Protobuf, when the coprocessor 
> receive the message , it invokes ProtobufUtil.toPut to convert it to a 
> Put object. Do various checking  and then put it into HBase table.
> Now, I get a requirement to change the timestamp of that Put object, 
> but I found no way to do this.
>
> I was first try to generate a new Put object with a new timestamp, and 
> try to copy the old one into this new object. But I found given a Put 
> object, I have no way to get ALL its cells out if I don't know the 
> column family and column qualifier name in advance. In my case, those 
> CF/Column names are random as user defined. So I stuck here. Could 
> anyone have idea how to workaround this?
>
> The Mutation class has getTimestamp() method but no setTimestamp(). I 
> wish there is a setTimestamp() for it. Is there any reason it is not 
> provided? I hope in future release Mutation can expose a 
> setTimestamp() method, is it possible? If so, my job will get much easier...
>
> Thanks,
> Ming
>

Re: Given a Put object, is there any way to change the timestamp of it?

Posted by Ted Yu <yu...@gmail.com>.
bq. I have no way to get ALL its cells out
Mutation has the following method:

  public NavigableMap<byte [], List<Cell>> getFamilyCellMap() {

FYI

On Tue, Jan 20, 2015 at 5:43 PM, Liu, Ming (HPIT-GADSC) <mi...@hp.com>
wrote:

> Hello, there,
>
> I am developing a coprocessor under HBase 0.98.6. The client send a Put
> object to the coprocessor in Protobuf, when the coprocessor receive the
> message , it invokes ProtobufUtil.toPut to convert it to a Put object. Do
> various checking  and then put it into HBase table.
> Now, I get a requirement to change the timestamp of that Put object, but I
> found no way to do this.
>
> I was first try to generate a new Put object with a new timestamp, and try
> to copy the old one into this new object. But I found given a Put object, I
> have no way to get ALL its cells out if I don't know the column family and
> column qualifier name in advance. In my case, those CF/Column names are
> random as user defined. So I stuck here. Could anyone have idea how to
> workaround this?
>
> The Mutation class has getTimestamp() method but no setTimestamp(). I wish
> there is a setTimestamp() for it. Is there any reason it is not provided? I
> hope in future release Mutation can expose a setTimestamp() method, is it
> possible? If so, my job will get much easier...
>
> Thanks,
> Ming
>