Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D2AB10578 for ; Fri, 9 Aug 2013 23:03:47 +0000 (UTC) Received: (qmail 23562 invoked by uid 500); 9 Aug 2013 23:03:46 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 23497 invoked by uid 500); 9 Aug 2013 23:03:46 -0000 Mailing-List: contact dev-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 dev@hbase.apache.org Received: (qmail 23488 invoked by uid 99); 9 Aug 2013 23:03:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Aug 2013 23:03:46 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yuzhihong@gmail.com designates 209.85.215.49 as permitted sender) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Aug 2013 23:03:42 +0000 Received: by mail-la0-f49.google.com with SMTP id ev20so3354434lab.22 for ; Fri, 09 Aug 2013 16:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3XH2uZaMvRuXXSlosFeM2LBc08Bj3BigBhV/ZzJ0gr8=; b=LOu2W7i8xUvW6XxBS/Tdd6neBFosO2OW+ktrdvio6l7nJ+uHFNSiOU+4LXDO/CO8oP 7Yia57FK5c+KkjUF9f9aOx0S1YYtRAd5eteA0CImd3kP8wFEMdK/DJE/94AllHK0gCcz uAjwuBt5AJDaVKxuCkp1K8sdgUyO7fXdx3eb74apdvYJ1vUucNHyCQAU3qBoo2ONidgh 9OHwZtVPRBhQbrVl/nb9qqTT7Ipp6HmFobS1dCnsOHugW8MHypB4XH6JR1AjDKszugNb aQ4LUcDYgb3xIFo6fMRi0PcWDVZyIYelqkkBintcNoQ/VmSvH3zQsa9ouEnzgFgwbrDn jl0A== MIME-Version: 1.0 X-Received: by 10.112.56.177 with SMTP id b17mr5393972lbq.74.1376089400570; Fri, 09 Aug 2013 16:03:20 -0700 (PDT) Received: by 10.112.129.40 with HTTP; Fri, 9 Aug 2013 16:03:20 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Aug 2013 16:03:20 -0700 Message-ID: Subject: Re: IncreasingToUpperBoundRegionSplitPolicy.shouldSplit() logic question From: Ted Yu To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=001a1133ab8ae679e104e38bc7a4 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133ab8ae679e104e38bc7a4 Content-Type: text/plain; charset=ISO-8859-1 Your reasoning looks good. On Fri, Aug 9, 2013 at 4:00 PM, Jean-Marc Spaggiari wrote: > Hi, > > In IncreasingToUpperBoundRegionSplitPolicy, w.e loop over all the stores > and we look at 2 things. > > First, if the store can't be split, then we return immediatly with false > without checking the other stores. Then if the store can be split and is > big enought, we return immediatly (break) with true. > > The logic seems to be wrong to be. In the 2nd case, should we not continue > to loop over the other stores and see if one can't be split? Else we will > trigger a split on a region where some stores can't be split. I will sply > remove the "break". > > Does anyone have another opinion on that? Else I will open a JIRA and send > a patch... > > JM > > @Override > protected boolean shouldSplit() { > if (region.shouldForceSplit()) return true; > boolean foundABigStore = false; > // Get count of regions that have the same common table as this.region > int tableRegionsCount = getCountOfCommonTableRegions(); > // Get size to check > long sizeToCheck = getSizeToCheck(tableRegionsCount); > LOG.debug("sizeToCheck = " + sizeToCheck); > > for (Store store : region.getStores().values()) { > // If any of the stores is unable to split (eg they contain reference > files) > // then don't split > if ((!store.canSplit())) { > return false; > } > > // Mark if any store is big enough > long size = store.getSize(); > if (size > sizeToCheck) { > LOG.debug("ShouldSplit because " + store.getColumnFamilyName() + > " size=" + size + ", sizeToCheck=" + sizeToCheck + > ", regionsWithCommonTable=" + tableRegionsCount); > foundABigStore = true; > break; > } > } > > return foundABigStore; > } > --001a1133ab8ae679e104e38bc7a4--