hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject IncreasingToUpperBoundRegionSplitPolicy.shouldSplit() logic question
Date Fri, 09 Aug 2013 23:00:15 GMT
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;
  }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message