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 C4B7491DF for ; Wed, 9 May 2012 21:29:36 +0000 (UTC) Received: (qmail 4547 invoked by uid 500); 9 May 2012 21:29:35 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 4502 invoked by uid 500); 9 May 2012 21:29:35 -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 4493 invoked by uid 99); 9 May 2012 21:29:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2012 21:29:35 +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 (nike.apache.org: domain of doug.meil@explorysmedical.com designates 213.199.154.141 as permitted sender) Received: from [213.199.154.141] (HELO db3outboundpool.messaging.microsoft.com) (213.199.154.141) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2012 21:29:27 +0000 Received: from mail67-db3-R.bigfish.com (10.3.81.236) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.23; Wed, 9 May 2012 21:29:07 +0000 Received: from mail67-db3 (localhost [127.0.0.1]) by mail67-db3-R.bigfish.com (Postfix) with ESMTP id 2DCDA34056E for ; Wed, 9 May 2012 21:29:07 +0000 (UTC) X-SpamScore: -1 X-BigFish: PS-1(zzbb2dI9371I1432N98dKzz1202hzz8275bh8275dh132fberz2fh2a8h668h839h944he5bh) X-Forefront-Antispam-Report: CIP:157.56.244.181;KIP:(null);UIP:(null);IPV:NLI;H:CH1PRD0410HT004.namprd04.prod.outlook.com;RD:none;EFVD:NLI Received-SPF: pass (mail67-db3: domain of explorysmedical.com designates 157.56.244.181 as permitted sender) client-ip=157.56.244.181; envelope-from=doug.meil@explorysmedical.com; helo=CH1PRD0410HT004.namprd04.prod.outlook.com ;.outlook.com ; Received: from mail67-db3 (localhost.localdomain [127.0.0.1]) by mail67-db3 (MessageSwitch) id 1336598944442745_12807; Wed, 9 May 2012 21:29:04 +0000 (UTC) Received: from DB3EHSMHS016.bigfish.com (unknown [10.3.81.251]) by mail67-db3.bigfish.com (Postfix) with ESMTP id 64B9B10009E for ; Wed, 9 May 2012 21:29:04 +0000 (UTC) Received: from CH1PRD0410HT004.namprd04.prod.outlook.com (157.56.244.181) by DB3EHSMHS016.bigfish.com (10.3.87.116) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 9 May 2012 21:29:03 +0000 Received: from CH1PRD0410MB392.namprd04.prod.outlook.com ([169.254.11.13]) by CH1PRD0410HT004.namprd04.prod.outlook.com ([10.255.147.39]) with mapi id 14.16.0152.000; Wed, 9 May 2012 21:29:02 +0000 From: Doug Meil To: "user@hbase.apache.org" Subject: Re: Looking for a single row - HTable.get(Get) or Scan(Get) Thread-Topic: Looking for a single row - HTable.get(Get) or Scan(Get) Thread-Index: AQHNLiEfblIpMGQHy0CdfRCFCTrpNpbB7J4AgAABB4D//8iDgA== Date: Wed, 9 May 2012 21:29:01 +0000 Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.255.147.4] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: explorysmedical.com Also, there is multi-Get support as of 0.90.x to further optimize the RPC calls if you need to make a bunch of calls. On 5/9/12 4:47 PM, "Jean-Daniel Cryans" wrote: >What Bryan said, also Scan(Get) is used internally in the region >server code so that's probably why that constructor exists. > >But as a user you need to create the scanner, do next() then close it >so using a straight Get saves 2 rpc. > >J-D > >On Wed, May 9, 2012 at 1:43 PM, Bryan Beaudreault > wrote: >> Gets just boil down to single-row Scans. I believe the only reason to >>do >> Scan s =3D new Scan(Get) would be if you need to add extra options onto >>the >> get. Get's API is more simplified than Scan's. >> >> On Wed, May 9, 2012 at 4:19 PM, Kevin wrote: >> >>> Hi, >>> >>> From what I can tell, there are two ways of scanning a table in HBase. >>>I'm >>> hoping to learn a bit by asking is the most efficient way to grab a >>>single >>> row from an HTable? >>> >>> One can ask the HTable directly by creating a Get object, or one can >>>create >>> a Scan object with a Get object and pass it along to the HTable. >>> >>> Maybe it doesn't matter. By looking at the source code I couldn't see >>>how >>> any one way might be faster/better than another. >>> >>> Thanks. >>> >