Review Board 1.7.22


HBASE-2399 Forced splits only act on the first family in a table

Review Request #1484 - Created Aug. 12, 2011 and updated

Ming Ma
trunk
hbase-2399
Reviewers
hbase
hbase
1. Add tests for forcesplit multi-column-family scenarios.
2. Modify HRegion so that it picks splitpoint based on largest store, instead of the first splittable store. It applies to both forcesplit and automatic split.

 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Revision 1157283 New Change
[20] 3874 lines
[+20] [+] private static void processTable(final FileSystem fs, final Path p,
3875
   */
3875
   */
3876
  protected void prepareToSplit() {
3876
  protected void prepareToSplit() {
3877
    // nothing
3877
    // nothing
3878
  }
3878
  }
3879

    
   
3879

   

    
   
3880
  /**

    
   
3881
   * Return the splitpoint. null indicates the region isn't splittable

    
   
3882
   * If the splitpoint isn't explicitly specified, it will go over the stores

    
   
3883
   * to find the best splitpoint. Currently the criteria of best splitpoint

    
   
3884
   * is based on the size of the store.

    
   
3885
   */
3880
  public byte[] checkSplit() {
3886
  public byte[] checkSplit() {
3881
    if (this.splitPoint != null) {
3887
    if (this.splitPoint != null) {
3882
      return this.splitPoint;
3888
      return this.splitPoint;
3883
    }
3889
    }
3884
    byte[] splitPoint = null;
3890
    byte[] splitPointFromLargestStore = null;

    
   
3891
    long largestStoreSize = 0;
3885
    for (Store s : stores.values()) {
3892
    for (Store s : stores.values()) {
3886
      splitPoint = s.checkSplit();
3893
      byte[] splitPoint = s.checkSplit();
3887
      if (splitPoint != null) {
3894
      long storeSize = s.getSize();
3888
        return splitPoint;
3895
      if (splitPoint != null && largestStoreSize < storeSize) {

    
   
3896
        splitPointFromLargestStore = splitPoint;

    
   
3897
        largestStoreSize = storeSize;
3889
      }
3898
      }
3890
    }
3899
    }
3891
    return null;
3900
    return splitPointFromLargestStore;
3892
  }
3901
  }
3893

    
   
3902

   
3894
  /**
3903
  /**
3895
   * @return The priority that this region should have in the compaction queue
3904
   * @return The priority that this region should have in the compaction queue
3896
   */
3905
   */
[+20] [20] 126 lines
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Revision 1157283 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Revision 1157283 New Change
 
  1. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java: Loading...
  2. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java: Loading...
  3. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java: Loading...