You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Vamshi Krishna <va...@gmail.com> on 2011/11/16 15:41:06 UTC

Not able to change the VERSION of hbase row

Hi,
i am trying to create and inserting data to hbase table. when i wanted to
change the maximum number of versions of row in hbase from default to 1, it
worked well, i.e whenever i add new row to table, the latest value is seen.
But when i tried to change using hbase shell like the following i couldn't
increase the number of versions to be stored to 4.

hbase shell command:      i disabled the table---> disable 'T'

alter 'T', {NAME => 'F', VERSIONS => 4}

enable 'T'

now i scanned the table after inserting the same row with different values
3 times. Still i could see only the last inserted row only..  i tried even
changing the maximum number of versions using
    HColumnDescriptor hcd= new HColumnDescriptor("F");
   F.setMaxVersions(4);


Still i could not change the number of versions to be maintained for any
roe , even for any newly created tables also..

Please can anybody help..?



-- 
*Regards*
*
Vamshi Krishna
*

Re: Not able to change the VERSION of hbase row

Posted by Doug Meil <do...@explorysmedical.com>.
Also, there is a versioned Get example here...

http://hbase.apache.org/book.html#get







On 11/16/11 12:34 PM, "Jean-Daniel Cryans" <jd...@apache.org> wrote:

>You need to tell the Get or Scan to fetch more versions. For example,
>the help for the get commands gives this example:
>
>  hbase> get 't1', 'r1', {COLUMN => 'c1', TIMERANGE => [ts1, ts2],
>VERSIONS => 4}
>
>In the API you would use
>http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html#se
>tMaxVersions(int)
>
>Hope this helps,
>
>J-D
>
>On Wed, Nov 16, 2011 at 6:41 AM, Vamshi Krishna <va...@gmail.com>
>wrote:
>> Hi,
>> i am trying to create and inserting data to hbase table. when i wanted
>>to
>> change the maximum number of versions of row in hbase from default to
>>1, it
>> worked well, i.e whenever i add new row to table, the latest value is
>>seen.
>> But when i tried to change using hbase shell like the following i
>>couldn't
>> increase the number of versions to be stored to 4.
>>
>> hbase shell command:      i disabled the table---> disable 'T'
>>
>> alter 'T', {NAME => 'F', VERSIONS => 4}
>>
>> enable 'T'
>>
>> now i scanned the table after inserting the same row with different
>>values
>> 3 times. Still i could see only the last inserted row only..  i tried
>>even
>> changing the maximum number of versions using
>>    HColumnDescriptor hcd= new HColumnDescriptor("F");
>>   F.setMaxVersions(4);
>>
>>
>> Still i could not change the number of versions to be maintained for any
>> roe , even for any newly created tables also..
>>
>> Please can anybody help..?
>>
>>
>>
>> --
>> *Regards*
>> *
>> Vamshi Krishna
>> *
>>
>



Re: Not able to change the VERSION of hbase row

Posted by Doug Meil <do...@explorysmedical.com>.
Also, there is an example of a versioned get here...

http://hbase.apache.org/book.html#get




On 11/16/11 12:34 PM, "Jean-Daniel Cryans" <jd...@apache.org> wrote:

>You need to tell the Get or Scan to fetch more versions. For example,
>the help for the get commands gives this example:
>
>  hbase> get 't1', 'r1', {COLUMN => 'c1', TIMERANGE => [ts1, ts2],
>VERSIONS => 4}
>
>In the API you would use
>http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html#se
>tMaxVersions(int)
>
>Hope this helps,
>
>J-D
>
>On Wed, Nov 16, 2011 at 6:41 AM, Vamshi Krishna <va...@gmail.com>
>wrote:
>> Hi,
>> i am trying to create and inserting data to hbase table. when i wanted
>>to
>> change the maximum number of versions of row in hbase from default to
>>1, it
>> worked well, i.e whenever i add new row to table, the latest value is
>>seen.
>> But when i tried to change using hbase shell like the following i
>>couldn't
>> increase the number of versions to be stored to 4.
>>
>> hbase shell command:      i disabled the table---> disable 'T'
>>
>> alter 'T', {NAME => 'F', VERSIONS => 4}
>>
>> enable 'T'
>>
>> now i scanned the table after inserting the same row with different
>>values
>> 3 times. Still i could see only the last inserted row only..  i tried
>>even
>> changing the maximum number of versions using
>>    HColumnDescriptor hcd= new HColumnDescriptor("F");
>>   F.setMaxVersions(4);
>>
>>
>> Still i could not change the number of versions to be maintained for any
>> roe , even for any newly created tables also..
>>
>> Please can anybody help..?
>>
>>
>>
>> --
>> *Regards*
>> *
>> Vamshi Krishna
>> *
>>
>



Re: Not able to change the VERSION of hbase row

Posted by Jean-Daniel Cryans <jd...@apache.org>.
You need to tell the Get or Scan to fetch more versions. For example,
the help for the get commands gives this example:

  hbase> get 't1', 'r1', {COLUMN => 'c1', TIMERANGE => [ts1, ts2],
VERSIONS => 4}

In the API you would use
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html#setMaxVersions(int)

Hope this helps,

J-D

On Wed, Nov 16, 2011 at 6:41 AM, Vamshi Krishna <va...@gmail.com> wrote:
> Hi,
> i am trying to create and inserting data to hbase table. when i wanted to
> change the maximum number of versions of row in hbase from default to 1, it
> worked well, i.e whenever i add new row to table, the latest value is seen.
> But when i tried to change using hbase shell like the following i couldn't
> increase the number of versions to be stored to 4.
>
> hbase shell command:      i disabled the table---> disable 'T'
>
> alter 'T', {NAME => 'F', VERSIONS => 4}
>
> enable 'T'
>
> now i scanned the table after inserting the same row with different values
> 3 times. Still i could see only the last inserted row only..  i tried even
> changing the maximum number of versions using
>    HColumnDescriptor hcd= new HColumnDescriptor("F");
>   F.setMaxVersions(4);
>
>
> Still i could not change the number of versions to be maintained for any
> roe , even for any newly created tables also..
>
> Please can anybody help..?
>
>
>
> --
> *Regards*
> *
> Vamshi Krishna
> *
>