Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30C1FDCA0 for ; Tue, 23 Oct 2012 22:02:31 +0000 (UTC) Received: (qmail 78580 invoked by uid 500); 23 Oct 2012 22:02:28 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 78533 invoked by uid 500); 23 Oct 2012 22:02:28 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 78524 invoked by uid 99); 23 Oct 2012 22:02:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2012 22:02:28 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=MIME_QP_LONG_LINE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pengyunmomo@gmail.com designates 209.85.161.169 as permitted sender) Received: from [209.85.161.169] (HELO mail-gg0-f169.google.com) (209.85.161.169) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2012 22:02:20 +0000 Received: by mail-gg0-f169.google.com with SMTP id i1so944215ggm.14 for ; Tue, 23 Oct 2012 15:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version; bh=60m0yOxA931HoDe1YgFQd9xJxIRiH2zp0cdhBV7Swio=; b=lQeZ29OygnOFKtMlktf3DE1yJKjD3CPr9nhuntC5rZ/MVFZ15L81n6vt4hy/x4AFg3 Ep42QHO8P/5XrHrS4/xX0kyP0MQpyHl8aC8lrYlxWQb9tyPveGhemoigAayYFisWkADN c6xQRHf1TRu4amAAlh10T6p7gZ814i/c/ZQL2g59F1yWImaJE5s+aHJEG8jYs9OHGxKC 8sGfITRn+dT/M5UW9//A0TBGfQeFxdArge6U3PtpJXNsIZbbHYV8FsbZK/xtcZJhMfhm tNLjvxkE8oi/5TXhJS/CNADIWSJx/sJk/nSasD2Z6oG6xziyTj8V1ZeuprK0wpBf4MuM 9yDg== Received: by 10.236.78.106 with SMTP id f70mr13239210yhe.51.1351029718879; Tue, 23 Oct 2012 15:01:58 -0700 (PDT) Received: from [10.0.0.4] (c-76-17-119-179.hsd1.ga.comcast.net. [76.17.119.179]) by mx.google.com with ESMTPS id f15sm9295424yhi.11.2012.10.23.15.01.57 (version=SSLv3 cipher=OTHER); Tue, 23 Oct 2012 15:01:58 -0700 (PDT) Subject: Re: How to config hbase0.94.2 to retain deleted data References: <1350860663.36064.YahooMailNeo@web121702.mail.ne1.yahoo.com> <1350880449.32084.YahooMailNeo@web121702.mail.ne1.yahoo.com> From: PG Content-Type: text/plain; charset=us-ascii X-Mailer: iPad Mail (10A403) In-Reply-To: <1350880449.32084.YahooMailNeo@web121702.mail.ne1.yahoo.com> Message-Id: Date: Tue, 23 Oct 2012 18:01:59 -0400 To: "user@hbase.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Virus-Checked: Checked by ClamAV on apache.org The comment clear things up. Configuration through Java code is also working= too. Thanks. Yun On Oct 22, 2012, at 12:34 AM, lars hofhansl wrote: > There currently is not. You have setup your column families to support thi= s (Note that you only need to do that once per column family!). > This was done for flexibility, because in many cases only some of the tabl= es need to retain deleted cells. >=20 > These blog posts might be helpful: > http://hadoop-hbase.blogspot.com/2011/12/deletion-in-hbase.html > http://hadoop-hbase.blogspot.com/2011/12/hbase-data-rentention-options.htm= l >=20 > -- Lars >=20 >=20 >=20 >=20 > ----- Original Message ----- > From: yun peng > To: user@hbase.apache.org > Cc:=20 > Sent: Sunday, October 21, 2012 5:20 PM > Subject: Re: How to config hbase0.94.2 to retain deleted data >=20 > Hi, Lars, that is great point. It works if I update the > tabledescriptor with the table disabled. It looks online updating > table descriptor generally not working... >=20 > Besides, in addition to the java API, is there any xml knob (in > hbase0942) that can config keepdeletedcells? >=20 > Thanks a lot. > Yun >=20 > On Sun, Oct 21, 2012 at 7:04 PM, lars hofhansl wrote= : >> Not sure that you can change the Table or Column Descriptors this way thr= ough a coprocessor. >> Did you try to create (or alter) the table such that keepDeleteCells is t= rue: >>=20 >> hbase(main):026:0> create 'usertable', {NAME=3D>'cf', KEEP_DELETED_CELLS=3D= >true} >> 0 row(s) in 1.1660 seconds >>=20 >> hbase(main):027:0> put 'usertable', "key1", 'cf:c1', "v1", 99 >> 0 row(s) in 0.0320 seconds >>=20 >> hbase(main):028:0> delete 'usertable', "key1", 'cf:c1', 100 >> 0 row(s) in 0.0050 seconds >>=20 >> hbase(main):029:0> get 'usertable', 'key1', {COLUMN =3D> 'cf:c1', TIMESTA= MP=3D> 99, VERSIONS =3D> 4} >> COLUMN CELL >> cf:c1 timestamp=3D99, value=3Dv1 >> 1 row(s) in 0.0150 seconds >>=20 >> Let me know how this works for you (generally). This is a new feature I a= dded to 0.94 to support true time-range queries. >>=20 >> -- Lars >>=20 >>=20 >> ----- Original Message ----- >> From: yun peng >> To: user@hbase.apache.org >> Cc: >> Sent: Sunday, October 21, 2012 1:53 PM >> Subject: How to config hbase0.94.2 to retain deleted data >>=20 >> Hi, All, >> I want to retain all deleted key-value pairs in hbase. I have tried to >> config HColumnDescript as follow to make it return deleted. >>=20 >> public void postOpen(ObserverContext e) {= >> HTableDescriptor htd =3D e.getEnvironment().getRegion().getTableDesc= (); >> HColumnDescriptor hcd =3D htd.getFamily(Bytes.toBytes("cf")); >> hcd.setKeepDeletedCells(true); >> hcd.setBlockCacheEnabled(false); >> } >>=20 >> However, it does not work for me, as when I issued a delete and then quer= y >> by an older timestamp, the old data does not show up. >>=20 >> hbase(main):119:0> put 'usertable', "key1", 'cf:c1', "v1", 99 >> hbase(main):120:0> put 'usertable', "key1", 'cf:c1', "v2", 101 >> hbase(main):121:0> delete 'usertable', "key1", 'cf:c1', 100 >> hbase(main):122:0> get 'usertable', 'key1', {COLUMN =3D> 'cf:c1', TIMESTA= MP >> =3D> 99, VERSIONS =3D> 4} >> COLUMN CELL >>=20 >> 0 row(s) in 0.0040 seconds >>=20 >> hbase(main):123:0> get 'usertable', 'key1', {COLUMN =3D> 'cf:c1', TIMESTA= MP >> =3D> 100, VERSIONS =3D> 4} >> COLUMN CELL >>=20 >> 0 row(s) in 0.0050 seconds >>=20 >> hbase(main):124:0> get 'usertable', 'key1', {COLUMN =3D> 'cf:c1', TIMESTA= MP >> =3D> 101, VERSIONS =3D> 4} >> COLUMN CELL >>=20 >> cf:c1 timestamp=3D101, value=3Dv2 >>=20 >> 1 row(s) in 0.0050 seconds >>=20 >> Note this is a new feature in 0.94.2 >> (HBASE-4536), >> I did not find too many sample code online, so... any one here has >> experience in using HBASE-4536. How should one config >> hbase to enable this feature in hbase? >>=20 >> Thanks >> Yun >=20