hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject git commit: HBASE-11237 Bulk load initiated by user other than hbase fails
Date Tue, 03 Jun 2014 00:07:24 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 8fd62d1e8 -> 57826c7da


HBASE-11237 Bulk load initiated by user other than hbase fails


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

Branch: refs/heads/master
Commit: 57826c7da9a4ed372e0c1c46c36b9bbd043e90e9
Parents: 8fd62d1
Author: Jimmy Xiang <jxiang@cloudera.com>
Authored: Mon Jun 2 12:24:48 2014 -0700
Committer: Jimmy Xiang <jxiang@cloudera.com>
Committed: Mon Jun 2 17:06:19 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java | 5 +++--
 .../java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java     | 1 +
 .../hbase/io/hfile/TestScannerSelectionUsingKeyRange.java       | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/57826c7d/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
index 741c9e2..85e1e9f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
@@ -423,7 +423,8 @@ public class CacheConfig {
   static BlockCache GLOBAL_BLOCK_CACHE_INSTANCE;
 
   /** Boolean whether we have disabled the block cache entirely. */
-  private static boolean blockCacheDisabled = false;
+  @VisibleForTesting
+  static boolean blockCacheDisabled = false;
 
   /**
    * Returns the block cache or <code>null</code> in case none should be used.
@@ -437,7 +438,7 @@ public class CacheConfig {
 
     float cachePercentage = conf.getFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY,
       HConstants.HFILE_BLOCK_CACHE_SIZE_DEFAULT);
-    if (cachePercentage == 0L) {
+    if (cachePercentage <= 0.0001f) {
       blockCacheDisabled = true;
       return null;
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/57826c7d/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java
index 52aabf6..6e0a2ca 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java
@@ -57,6 +57,7 @@ public class TestPrefetch {
     conf.setInt(HFile.FORMAT_VERSION_KEY, 3);
     conf.setBoolean(CacheConfig.PREFETCH_BLOCKS_ON_OPEN_KEY, true);
     fs = HFileSystem.get(conf);
+    CacheConfig.blockCacheDisabled = false;
     cacheConf = new CacheConfig(conf);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/57826c7d/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java
index 65aaf47..4eb4fd1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java
@@ -53,7 +53,7 @@ import org.junit.runners.Parameterized.Parameters;
 @RunWith(Parameterized.class)
 @Category(SmallTests.class)
 public class TestScannerSelectionUsingKeyRange {
-  private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility().createLocalHTU();
+  private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
   private static TableName TABLE = TableName.valueOf("myTable");
   private static String FAMILY = "myCF";
   private static byte[] FAMILY_BYTES = Bytes.toBytes(FAMILY);
@@ -113,6 +113,7 @@ public class TestScannerSelectionUsingKeyRange {
     }
 
     Scan scan = new Scan(Bytes.toBytes("aaa"), Bytes.toBytes("aaz"));
+    CacheConfig.blockCacheDisabled = false;
     CacheConfig cacheConf = new CacheConfig(conf);
     LruBlockCache cache = (LruBlockCache) cacheConf.getBlockCache();
     cache.clearCache();


Mime
View raw message