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 2DF299907 for ; Wed, 28 Dec 2011 02:42:42 +0000 (UTC) Received: (qmail 54943 invoked by uid 500); 28 Dec 2011 02:42:40 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 54916 invoked by uid 500); 28 Dec 2011 02:42:40 -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 54908 invoked by uid 99); 28 Dec 2011 02:42:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 02:42:39 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of harsh@cloudera.com designates 209.85.210.169 as permitted sender) Received: from [209.85.210.169] (HELO mail-iy0-f169.google.com) (209.85.210.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 02:42:34 +0000 Received: by iacb35 with SMTP id b35so25406044iac.14 for ; Tue, 27 Dec 2011 18:42:13 -0800 (PST) Received: by 10.50.188.166 with SMTP id gb6mr33819993igc.18.1325040133608; Tue, 27 Dec 2011 18:42:13 -0800 (PST) Received: from [192.168.1.2] ([59.92.45.42]) by mx.google.com with ESMTPS id aq5sm69916113igc.5.2011.12.27.18.42.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Dec 2011 18:42:13 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: checkAndPut behavior question From: Harsh J In-Reply-To: Date: Wed, 28 Dec 2011 08:12:03 +0530 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@hbase.apache.org X-Mailer: Apple Mail (2.1084) Hey Joe, Perhaps in spirit of http://xkcd.com/979/ you'd like to share the answer = as well, for folks who won't immediately understand what the problem = was? :) On 28-Dec-2011, at 3:37 AM, Joe Stein wrote: > figured this one out too, never mind. >=20 > hoping to publish a getting started for scala devs with relative = functions > in a tes framework and the rest, lowering the curve to getting going >=20 > cheers >=20 > On Tue, Dec 27, 2011 at 3:50 PM, Joe Stein > wrote: >=20 >> So I have this code which when runs is doing what I expect from a new = row >>=20 >> val table =3D new HTable(conf, "mytable") >>=20 >> val theput=3D new Put(Bytes.toBytes("rowkey1")) >>=20 >>=20 >> = theput.add(Bytes.toBytes("ids"),Bytes.toBytes("id2"),Bytes.toBytes("one"))= >>=20 >> println("check and put 1" + >> = table.checkAndPut(Bytes.toBytes("rowkey1"),Bytes.toBytes("ids"),Bytes.toBy= tes("id2"),null,theput)) >>=20 >> println("check and put 2" + >> = table.checkAndPut(Bytes.toBytes("rowkey1"),Bytes.toBytes("ids"),Bytes.toBy= tes("id2"),null,theput)) >>=20 >> check and put 1true >> check and put 2false >>=20 >> when I run my test app again, I would expect false and false (since = the >> row already has the column there) >>=20 >> check and put 1true >> check and put 2false >>=20 >> I don't understand I thought it would be >>=20 >> check and put 1false >> check and put 2false >>=20 >> hbase(main):012:0> scan 'mytable' >> ROW COLUMN+CELL >>=20 >>=20 >> rowkey1 column=3Dids:id2, >> timestamp=3D1325018846038, value=3Done >>=20 >> 1 row(s) in 1.1010 seconds >>=20 >>=20 >> -- >>=20 >> /* >> Joe Stein >> http://www.linkedin.com/in/charmalloc >> Twitter: @allthingshadoop >> */ >>=20 >=20 >=20 >=20 > --=20 >=20 > /* > Joe Stein > http://www.linkedin.com/in/charmalloc > Twitter: @allthingshadoop > */