Return-Path: Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: (qmail 40211 invoked from network); 22 Mar 2011 03:18:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2011 03:18:51 -0000 Received: (qmail 38623 invoked by uid 500); 22 Mar 2011 03:18:50 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 38597 invoked by uid 500); 22 Mar 2011 03:18:49 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 38590 invoked by uid 99); 22 Mar 2011 03:18:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 03:18:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 03:18:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B2A0A23888CD; Tue, 22 Mar 2011 03:18:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1084062 - in /hbase/trunk: CHANGES.txt bin/rename_table.rb Date: Tue, 22 Mar 2011 03:18:12 -0000 To: commits@hbase.apache.org From: stack@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110322031812.B2A0A23888CD@eris.apache.org> Author: stack Date: Tue Mar 22 03:18:12 2011 New Revision: 1084062 URL: http://svn.apache.org/viewvc?rev=1084062&view=rev Log: HBASE-3575 Update rename table script Modified: hbase/trunk/CHANGES.txt hbase/trunk/bin/rename_table.rb Modified: hbase/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1084062&r1=1084061&r2=1084062&view=diff ============================================================================== --- hbase/trunk/CHANGES.txt (original) +++ hbase/trunk/CHANGES.txt Tue Mar 22 03:18:12 2011 @@ -157,6 +157,7 @@ Release 0.90.2 - Unreleased logs; else we replay split on every restart HBASE-3621 The timeout handler in AssignmentManager does an RPC while holding lock on RIT; a big no-no (Ted Yu via Stack) + HBASE-3575 Update rename table script IMPROVEMENTS HBASE-3542 MultiGet methods in Thrift Modified: hbase/trunk/bin/rename_table.rb URL: http://svn.apache.org/viewvc/hbase/trunk/bin/rename_table.rb?rev=1084062&r1=1084061&r2=1084062&view=diff ============================================================================== --- hbase/trunk/bin/rename_table.rb (original) +++ hbase/trunk/bin/rename_table.rb Tue Mar 22 03:18:12 2011 @@ -95,7 +95,7 @@ oldTableName = ARGV[0] newTableName = ARGV[1] # Get configuration to use. -c = HBaseConfiguration.new() +c = HBaseConfiguration.create() # Set hadoop filesystem configuration using the hbase.rootdir. # Otherwise, we'll always use localhost though the hbase.rootdir @@ -147,13 +147,20 @@ while (result = scanner.next()) d = Delete.new(result.getRow()) metaTable.delete(d) # Create 'new' region - newR = HRegion.new(rootdir, nil, fs, c, newHRI, nil) + newR = HRegion.new(newTableDir, nil, fs, c, newHRI, nil) # Add new row. NOTE: Presumption is that only one .META. region. If not, # need to do the work to figure proper region to add this new region to. LOG.info("Adding to meta: " + newR.toString()) + bytes = Writables.getBytes(newR.getRegionInfo()) p = Put.new(newR.getRegionName()) - p.add(HConstants::CATALOG_FAMILY, HConstants::REGIONINFO_QUALIFIER, Writables.getBytes(newR.getRegionInfo())) + p.add(HConstants::CATALOG_FAMILY, HConstants::REGIONINFO_QUALIFIER, bytes) metaTable.put(p) + # Finally update the .regioninfo under new region location so it has new name. + regioninfofile = Path.new(newR.getRegionDir(), HRegion::REGIONINFO_FILE) + fs.delete(regioninfofile, true) + out = fs.create(regioninfofile) + newR.getRegionInfo().write(out) + out.close() end end scanner.close()