Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E2184DDBA for ; Fri, 15 Feb 2013 19:11:16 +0000 (UTC) Received: (qmail 47231 invoked by uid 500); 15 Feb 2013 19:11:16 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 47191 invoked by uid 500); 15 Feb 2013 19:11:16 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 47147 invoked by uid 99); 15 Feb 2013 19:11:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2013 19:11:16 +0000 Date: Fri, 15 Feb 2013 19:11:16 +0000 (UTC) From: "Jean-Marc Spaggiari (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-7846) Add support for merging implicit regions in Merge tool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-7846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579425#comment-13579425 ] Jean-Marc Spaggiari commented on HBASE-7846: -------------------------------------------- Here is how I did it. Regions is constructed from MetaUtils.scanMetaRegion {code:title=MassMerger.java|borderStyle=solid} HRegionInfo region1 = null; HRegionInfo region2 = null; for (HRegionInfo regionInfo : regions) { if (region1 == null) { region1 = regionInfo; } } else { region2 = regionInfo; } if ((region1 != null) && (region2 != null)) { regionsCount++; String[] args = new String[3]; args[0] = tableName; args[1] = region1.getRegionNameAsString(); args[2] = region2.getRegionNameAsString(); System.out.println ("Merging " + region1.getRegionNameAsString() + " with " + region2.getRegionNameAsString()); region1 = null; region2 = null; int status; try { status = ToolRunner.run(HBaseConfiguration.create(config), new Merge(), args); if ((System.in.available() > 0) || (status != 0)) { return; } } catch (Exception e) { e.printStackTrace(); } } } } {Code} Pretty simple way. I will clean the code, and see how I can merge it into the Merge class... > Add support for merging implicit regions in Merge tool > ------------------------------------------------------ > > Key: HBASE-7846 > URL: https://issues.apache.org/jira/browse/HBASE-7846 > Project: HBase > Issue Type: Improvement > Components: util > Reporter: Kaufman Ng > Priority: Minor > > Currently org.apache.hadoop.hbase.util.Merge needs 2 region names to be explicitly specified to perform a merge. This can be cumbersome. > One idea for improvement is to have Merge to figure out all the adjacent regions and perform the merges. > For example: > regions before merge: row-10, row-20, row-30, row-40, row-50 > regions after merge: row-10, row-30, row-50 > In the above example, region names of "row-10" and "row-20" are merged to become a new bigger region of "row-10". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira