hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Irfan Mohammed <irfan...@gmail.com>
Subject Re: table data is lost after the server is restarted
Date Sat, 20 Jun 2009 19:36:26 GMT
doesnt look that the latest fixes the problem ... See the following trial. When I use the incrementColumnValue,
the cell value with "timestamp=9223372036854775807" is there before the server is restarted
but after the server is restarted, it is not there.

irfan@damascus:~/thirdparty/src/hbase/hbase-core-trunk$ hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Version: 0.20.0-dev, r786695, Sat Jun 20 15:19:53 EDT 2009
hbase(main):001:0> 
hbase(main):002:0* get 'test_transaction_impression', '8219_0_2009061216', { COLUMN =>
'publisher_id:', VERSIONS => 100 }
09/06/20 15:24:18 INFO zookeeper.ZooKeeperWrapper: Quorum servers: localhost:2181
timestamp=9223372036854775807, value=\000\000\000\000\000\000\000\003                    
                    
timestamp=1245523808930, value=\000\000\000\000\000\000\000\001                          
                    
timestamp=1245523746893, value=\000\000\000\000\000\000\000\001                          
                    
3 row(s) in 0.0410 seconds

hbase(main):003:0> irfan@damascus:~/thirdparty/src/hbase/hbase-core-trunk$ stop-hbase.sh

stopping master....................................................
localhost: stopping zookeeper.

irfan@damascus:~/thirdparty/src/hbase/hbase-core-trunk$ start-hbase.sh 
localhost: starting zookeeper, logging to /home/irfan/apps/hbase-latest/bin/../logs/hbase-irfan-zookeeper-damascus.out
starting master, logging to /home/irfan/apps/hbase-latest/bin/../logs/hbase-irfan-master-damascus.out
localhost: starting regionserver, logging to /home/irfan/apps/hbase-latest/bin/../logs/hbase-irfan-regionserver-damascus.out

irfan@damascus:~/thirdparty/src/hbase/hbase-core-trunk$ hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Version: 0.20.0-dev, r786695, Sat Jun 20 15:19:53 EDT 2009
hbase(main):001:0>  get 'test_transaction_impression', '8219_0_2009061216', { COLUMN =>
'publisher_id:', VERSIONS => 100 }
09/06/20 15:34:36 INFO zookeeper.ZooKeeperWrapper: Quorum servers: localhost:2181
timestamp=1245523808930, value=\000\000\000\000\000\000\000\001                          
                    
timestamp=1245523746893, value=\000\000\000\000\000\000\000\001                          
                    
2 row(s) in 0.0400 seconds
hbase(main):002:0> 

----- Original Message -----
From: "Ryan Rawson" <ryanobjc@gmail.com>
To: hbase-dev@hadoop.apache.org
Sent: Saturday, June 20, 2009 3:05:29 PM GMT -05:00 US/Canada Eastern
Subject: Re: table data is lost after the server is restarted

This is hbase 1547.

Is it committed yet? I didn't do it, but I think someone else did...

Update to tip to trunk and try again!

On Jun 20, 2009 12:01 PM, "Irfan Mohammed" <irfan.ma@gmail.com> wrote:

i shutdown hbase using the following command

$ $HBASE_HOME/bin/stop-hbase.sh
and it shuts down properly after a few seconds.

here is my observation since last night. If I user TableRecordWriter1 uses
HTable.incrementColumnValue, then the table data is not persisted across
restarts but if I use TableRecordWriter2 then the table data is persisted
across the restarts.

Any clues ...

Thanks,
Irfan

   protected static class TableRecordWriter extends
RecordWriter<ImmutableBytesWritable, Put> {
       ...
       ...
       ...

       /**
        * {@inheritDoc}
        */
       @Override
       public void write(ImmutableBytesWritable key, Put put) throws
IOException
       {
           byte[] row = put.getRow();

           for (Map.Entry<byte[], List<KeyValue>> familyEntry :
put.getFamilyMap().entrySet()) {
               byte[] family = familyEntry.getKey();

               for (KeyValue keyValue : familyEntry.getValue()) {
                   byte[] qualifier = keyValue.getQualifier();

                   long amount = Bytes.toLong(keyValue.getValue());

                   this.table_.incrementColumnValue(row, family, qualifier,
amount);
               }
           }
       }
   }

.........................

   protected static class TableRecordWriter2 extends
RecordWriter<ImmutableBytesWritable, Put> {
       ...
       ...
       ...

       /**
        * {@inheritDoc}
        */
       public void write(ImmutableBytesWritable key, Put put) throws
IOException {
           this.table_.put(new Put(put));

} } ----- Original Message ----- From: "Andrew Purtell" <apurtell@apache.org>
To: hbase...

Sent: Saturday, June 20, 2009 1:09:14 PM GMT -05:00 US/Canada Eastern
Subject: Re: table data is los...

Mime
View raw message