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 ADE6B1039 for ; Sun, 24 Apr 2011 09:58:32 +0000 (UTC) Received: (qmail 28091 invoked by uid 500); 24 Apr 2011 09:58:31 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 28052 invoked by uid 500); 24 Apr 2011 09:58:31 -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 28044 invoked by uid 500); 24 Apr 2011 09:58:31 -0000 Delivered-To: apmail-hadoop-hbase-user@hadoop.apache.org Received: (qmail 28041 invoked by uid 99); 24 Apr 2011 09:58:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Apr 2011 09:58:31 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cjjvictory@gmail.com designates 209.85.161.176 as permitted sender) Received: from [209.85.161.176] (HELO mail-gx0-f176.google.com) (209.85.161.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Apr 2011 09:58:24 +0000 Received: by gxk7 with SMTP id 7so600340gxk.35 for ; Sun, 24 Apr 2011 02:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=C21zQefzT8YFtwGXvY7Viu7pzCTlp//KT+Wk3z5fQrg=; b=Mp23Ojl6kn7bFM9jRuwEQrOvbzSBEuK4Ww8kn1bqurUOJAYdjWXQtWrI7tBDzoa0JQ Xmg+yfgFIp/finyRr2yHjHeQjYG2VH4QkqkbojCUb26s/LzCrOzpM8y5JryzS444Fu43 bnCDFWfZlnF4tFAIkax0bb4xrDys8aul0hwl4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=FL4IAAWjKtp3/PolfqeI2Q/XD3n7wm7BdSQXNNNTPHSDfwv3QVmRdlYSKTwVI73ZaW pPbFIKvEghSGvn5xGGaNj8EXVie1n6ktBxeUCwvg9aF465Hd+j8w0Cba31Ligvjxw1DS eqdTVMv4qLMgNq8BFfJeKJBrhl9+N/aHBYjO8= MIME-Version: 1.0 Received: by 10.90.16.34 with SMTP id 34mr2525852agp.28.1303639082045; Sun, 24 Apr 2011 02:58:02 -0700 (PDT) Received: by 10.90.113.17 with HTTP; Sun, 24 Apr 2011 02:58:01 -0700 (PDT) In-Reply-To: References: Date: Sun, 24 Apr 2011 17:58:01 +0800 Message-ID: Subject: Re: why merge regions error From: =?UTF-8?B?6ZmI5Yqg5L+K?= To: hbase-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001636283b6266913704a1a7200c X-Virus-Checked: Checked by ClamAV on apache.org --001636283b6266913704a1a7200c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It should : OnlineMerger(final HBaseConfiguration conf, final FileSystem fs, final byte[] tableName) throws IOException { super(conf, fs, tableName); this.tableName =3D tableName; table =3D new HTable(conf, META_TABLE_NAME); final Filter filter =3D new PrefixFilter(this.tableName); final Scan scan =3D new Scan(); scan.addColumn(CATALOG_FAMILY, REGIONINFO_QUALIFIER); scan.setFilter(filter); metaScanner =3D table.getScanner(scan); latestRegion =3D null; } or like this : private HRegionInfo nextRegion() throws IOException { try { //FIXME for (;;) { final Result results =3D getMetaRow(); if (results =3D=3D null) { return null; } final byte[] regionInfoValue =3D results.getValue(CATALOG_FAMILY, REGIONINFO_QUALIFIER); if (regionInfoValue =3D=3D null || regionInfoValue.leng= th =3D=3D 0) { throw new NoSuchElementException("meta region entry missing " + Bytes.toString(CATALOG_FAMILY) + ":" + Bytes.toString(REGIONINFO_QUALIFIER)); } final HRegionInfo region =3D Writables.getHRegionInfo(regionInfoValue); //FIXME if (!Bytes.equals(region.getTableDesc().getName(), tableName)) { continue; } checkOfflined(region); return region; } } catch (IOException e) { e =3D RemoteExceptionHandler.checkIOException(e); LOG.error("meta scanner error", e); metaScanner.close(); throw e; } } On Sun, Apr 24, 2011 at 3:32 PM, =E9=99=88=E5=8A=A0=E4=BF=8A wrote: > @Override > protected HRegionInfo[] next() throws IOException { > List regions =3D new ArrayList(); > if(latestRegion =3D=3D null) { > latestRegion =3D nextRegion(); > } > if(latestRegion !=3D null) { > regions.add(latestRegion); > } > latestRegion =3D nextRegion(); > if(latestRegion !=3D null) { > regions.add(latestRegion); > } > return regions.toArray(new HRegionInfo[regions.size()]); > } > > the method nextRegion may get Null ,So there is a bug in HBase0.20.6. > > > > On Sun, Apr 24, 2011 at 2:56 PM, =E9=99=88=E5=8A=A0=E4=BF=8A wrote: > >> I run jruby as follows : >> >> # Name of this script >> NAME =3D "merge_table" >> >> # Print usage for this script >> def usage >> puts 'Usage: %s.rb TABLE_NAME' % NAME >> exit! >> end >> >> # Get configuration to use. >> c =3D HBaseConfiguration.new() >> >> # Set hadoop filesystem configuration using the hbase.rootdir. >> # Otherwise, we'll always use localhost though the hbase.rootdir >> # might be pointing at hdfs location. >> c.set("fs.default.name", c.get(HConstants::HBASE_DIR)) >> fs =3D FileSystem.get(c) >> >> # Get a logger and a metautils instance. >> LOG =3D LogFactory.getLog(NAME) >> >> # Check arguments >> if ARGV.size < 1 || ARGV.size > 2 >> usage >> end >> >> tableName =3D java.lang.String.new(ARGV[0]) >> LOG.info("merge regions of table: " + tableName.toString()) >> >> HMerge.merge(c,fs,Bytes.toBytes(tableName)) >> >> >> But it is strange that : >> >> ...... >> 11/04/24 14:55:31 DEBUG client.HConnectionManager$TableServers: Cache hi= t >> for row <> in tableName .META.: location server 192.168.0.185:60020, >> location region name .META.,,1 >> 11/04/24 14:55:31 INFO hbase.HMerge: Row: >> >> 11/04/24 14:55:31 INFO hbase.HMerge: Row: >> 11/04/24 14:55:31 INFO hbase.HMerge: only one region - nothing to merge >> 11/04/24 14:55:31 DEBUG regionserver.HLog: closing hlog writer in hdfs:/= / >> test.namenode.uc.uuwatch.com:9000/hbase/cjjPutTest1/merge_1303628131187.= logs >> 11/04/24 14:55:31 INFO zookeeper.ZooKeeper: Session: 0x32f5daa5e9700b3 >> closed >> 11/04/24 14:55:31 INFO zookeeper.ClientCnxn: EventThread shut down >> 11/04/24 14:55:31 DEBUG zookeeper.ZooKeeperWrapper: Closed connection wi= th >> ZooKeeper >> >> the table cjjPutTest1 has 166 regions ,Why it said only one region ? >> -- >> Thanks & Best regards >> jiajun >> >> > > > -- > Thanks & Best regards > jiajun > > --=20 Thanks & Best regards jiajun --001636283b6266913704a1a7200c--