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 C705096BC for ; Wed, 16 May 2012 02:07:16 +0000 (UTC) Received: (qmail 60409 invoked by uid 500); 16 May 2012 02:07:11 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 60299 invoked by uid 500); 16 May 2012 02:07:11 -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 60280 invoked by uid 500); 16 May 2012 02:07:11 -0000 Delivered-To: apmail-hadoop-hbase-user@hadoop.apache.org Received: (qmail 60273 invoked by uid 99); 16 May 2012 02:07:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 02:07:11 +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.144 as permitted sender) Received: from [213.199.154.144] (HELO db3outboundpool.messaging.microsoft.com) (213.199.154.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 02:07:03 +0000 Received: from mail76-db3-R.bigfish.com (10.3.81.243) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.23; Wed, 16 May 2012 02:06:36 +0000 Received: from mail76-db3 (localhost [127.0.0.1]) by mail76-db3-R.bigfish.com (Postfix) with ESMTP id CF1CEE06B5; Wed, 16 May 2012 02:06:36 +0000 (UTC) X-SpamScore: -9 X-BigFish: PS-9(z616jzbb2dI9371I1432N98dKzz1202hzz8275bh8275dhz2fh2a8h668h839h944he5bh) X-Forefront-Antispam-Report: CIP:157.56.244.181;KIP:(null);UIP:(null);IPV:NLI;H:CH1PRD0410HT002.namprd04.prod.outlook.com;RD:none;EFVD:NLI Received-SPF: pass (mail76-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=CH1PRD0410HT002.namprd04.prod.outlook.com ;.outlook.com ; Received: from mail76-db3 (localhost.localdomain [127.0.0.1]) by mail76-db3 (MessageSwitch) id 1337133989285976_1665; Wed, 16 May 2012 02:06:29 +0000 (UTC) Received: from DB3EHSMHS011.bigfish.com (unknown [10.3.81.243]) by mail76-db3.bigfish.com (Postfix) with ESMTP id 0267B46008C; Wed, 16 May 2012 02:06:29 +0000 (UTC) Received: from CH1PRD0410HT002.namprd04.prod.outlook.com (157.56.244.181) by DB3EHSMHS011.bigfish.com (10.3.87.111) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 16 May 2012 02:06:26 +0000 Received: from CH1PRD0410MB392.namprd04.prod.outlook.com ([169.254.11.154]) by CH1PRD0410HT002.namprd04.prod.outlook.com ([10.255.147.37]) with mapi id 14.16.0152.000; Wed, 16 May 2012 02:06:31 +0000 From: Doug Meil To: "user@hbase.apache.org" CC: "hbase-user@hadoop.apache.org" Subject: Re: Get the list of store/store files for a region via HBase API Thread-Topic: Get the list of store/store files for a region via HBase API Thread-Index: AQHNMt8OWQmt9OXHSkmGvnNh3kpCtpbLGTIAgABG9oCAAAf6AA== Date: Wed, 16 May 2012 02:06:30 +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 You're just doing a directory listing in HDFS to get this information. That's a pretty lightweight operation (I.e., as opposed to transferring the contents of all the StoreFiles, etc.) If you want to go all the way down to the StoreFile it's the only way I'm aware of at this time. On 5/15/12 5:37 PM, "Chen Song" wrote: >Thanks Doug, that should work as the hierarchy is explicitly reflected on >HDFS. But is this the preferred way to do such table/region/storefile >traversal? > >I would like to avoid hitting to HDFS directly if possible as these pieces >of meta information is within HBase world. > >Thanks >Chen > >On Tue, May 15, 2012 at 5:23 PM, Doug Meil >wrote: > >> >> You can get the Table->Region->StoreFile information via HDFS. That is >> described here in the RefGuide: >> >> http://hbase.apache.org/book.html#trouble.namenode >> >> >> >> >> >> >> On 5/15/12 5:09 PM, "Chen Song" wrote: >> >> >I am new to HBase and started working on a project which needs meta >> >information on HBase regions for a table. The version of HBase I am >>using >> >0.90.4. >> > >> >The use case is very simple. >> > >> >First, I want to get all regions for a table, which I can achieve using >> >the >> >API call below. >> > >> > HTable table =3D new HTable(conf, tableName); >> > >> > Map regions =3D table.getRegionsInfo()= ; >> > >> > >> >Second, I want to get the list of stores (and then store files) for >>each >> >region. This is where I stuck as I could not find a way to do it by >> >searching in the API. It seems that HRegionInterface started supporting >> >API >> >call to retrive the list of store files since 0.95-SNAPSHOT but I don't >> >want to upgrade my HBase version. Below is how to get the corresponding >> >HResionInterface. >> > >> > HConnection connection =3D table.getConnection(); >> > >> > HRegionInterface regionInterface =3D >> >connection.getHRegionConnection(regionAddress); >> > >> >The series of objects I would like to get in sequence is like: >>HRegionInfo >> >-> HRegion -> Store/StoreFile/HFile. If some can help me with it, that >> >would be great. >> > >> >Thanks very much, >> > >> >Chen >> >> >> > > >--=20 >Chen Song >Mobile: 518-445-5096