hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshb...@apache.org
Subject hbase git commit: HBASE-13431 Allow to skip store file range check based on column family while creating reference files in HRegionFileSystem#splitStoreFile(Rajeshbabu)
Date Wed, 29 Apr 2015 04:08:21 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 18bbf2ecb -> 1dbed01d2


HBASE-13431 Allow to skip store file range check based on column family while creating reference
files in HRegionFileSystem#splitStoreFile(Rajeshbabu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1dbed01d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1dbed01d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1dbed01d

Branch: refs/heads/branch-1
Commit: 1dbed01d280e941ff2c5a2545cb8b16b5915b0b6
Parents: 18bbf2e
Author: Rajeshbabu Chintaguntla <rajeshbabu@apache.org>
Authored: Wed Apr 29 09:38:24 2015 +0530
Committer: Rajeshbabu Chintaguntla <rajeshbabu@apache.org>
Committed: Wed Apr 29 09:38:24 2015 +0530

----------------------------------------------------------------------
 .../hbase/regionserver/HRegionFileSystem.java    |  2 +-
 .../hbase/regionserver/RegionSplitPolicy.java    | 10 ++++++++++
 .../TestSplitTransactionOnCluster.java           | 19 +++++++++++++++----
 3 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1dbed01d/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
index 62ea17b..ac3e512 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
@@ -578,7 +578,7 @@ public class HRegionFileSystem {
   Path splitStoreFile(final HRegionInfo hri, final String familyName, final StoreFile f,
       final byte[] splitRow, final boolean top, RegionSplitPolicy splitPolicy) throws IOException
{
 
-    if (splitPolicy == null || !splitPolicy.skipStoreFileRangeCheck()) {
+    if (splitPolicy == null || !splitPolicy.skipStoreFileRangeCheck(familyName)) {
       // Check whether the split row lies in the range of the store file
       // If it is outside the range, return directly.
       try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1dbed01d/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java
index 22bdccb..2ab2c8d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java
@@ -133,9 +133,19 @@ public abstract class RegionSplitPolicy extends Configured {
    * the split reference even when the split row not lies in the range. This method can be
used
    * to decide, whether to skip the the StoreFile range check or not.
    * @return whether to skip the StoreFile range check or not
+   * @deprecated Use {@link #skipStoreFileRangeCheck(String)}} instead
    */
+  @Deprecated
   protected boolean skipStoreFileRangeCheck() {
     return false;
   }
 
+  /**
+   * See {@link #skipStoreFileRangeCheck()} javadoc.
+   * @param familyName
+   * @return whether to skip the StoreFile range check or not
+   */
+  protected boolean skipStoreFileRangeCheck(String familyName) {
+    return skipStoreFileRangeCheck();
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/1dbed01d/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
index 9a7b6e6..73d4622 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
@@ -1273,6 +1273,7 @@ public class TestSplitTransactionOnCluster {
     try {
       HTableDescriptor htd = new HTableDescriptor(tableName);
       htd.addFamily(new HColumnDescriptor("f"));
+      htd.addFamily(new HColumnDescriptor("i_f"));
       htd.setRegionSplitPolicyClassName(CustomSplitPolicy.class.getName());
       admin.createTable(htd);
       List<HRegion> regions = awaitTableRegions(tableName);
@@ -1280,6 +1281,7 @@ public class TestSplitTransactionOnCluster {
       for(int i = 3;i<9;i++) {
         Put p = new Put(Bytes.toBytes("row"+i));
         p.add(Bytes.toBytes("f"), Bytes.toBytes("q"), Bytes.toBytes("value"+i));
+        p.add(Bytes.toBytes("i_f"), Bytes.toBytes("q"), Bytes.toBytes("value"+i));
         region.put(p);
       }
       region.flush(true);
@@ -1287,8 +1289,13 @@ public class TestSplitTransactionOnCluster {
       Collection<StoreFile> storefiles = store.getStorefiles();
       assertEquals(storefiles.size(), 1);
       assertFalse(region.hasReferences());
-      Path referencePath = region.getRegionFileSystem().splitStoreFile(region.getRegionInfo(),
"f",
-        storefiles.iterator().next(), Bytes.toBytes("row1"), false, region.getSplitPolicy());
+      Path referencePath =
+          region.getRegionFileSystem().splitStoreFile(region.getRegionInfo(), "f",
+            storefiles.iterator().next(), Bytes.toBytes("row1"), false, region.getSplitPolicy());
+      assertNull(referencePath);
+      referencePath =
+          region.getRegionFileSystem().splitStoreFile(region.getRegionInfo(), "i_f",
+            storefiles.iterator().next(), Bytes.toBytes("row1"), false, region.getSplitPolicy());
       assertNotNull(referencePath);
     } finally {
       TESTING_UTIL.deleteTable(tableName);
@@ -1709,8 +1716,12 @@ public class TestSplitTransactionOnCluster {
     }
 
     @Override
-    public boolean skipStoreFileRangeCheck() {
-      return true;
+    public boolean skipStoreFileRangeCheck(String familyName) {
+      if(familyName.startsWith("i_")) {
+        return true;
+      } else {
+        return false;
+      }
     }
   }
 }


Mime
View raw message