hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject hbase git commit: HBASE-15104 Occasional failures due to NotServingRegionException in IT tests (Huaxiang Sun)
Date Thu, 14 Jan 2016 17:12:56 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 e15389fda -> b09cd2602


HBASE-15104 Occasional failures due to NotServingRegionException in IT tests (Huaxiang Sun)


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

Branch: refs/heads/branch-1.2
Commit: b09cd260281ba31e22f5b02ef2a09328632480cd
Parents: e15389f
Author: Jonathan M Hsieh <jmhsieh@apache.org>
Authored: Thu Jan 14 07:59:33 2016 -0800
Committer: Jonathan M Hsieh <jmhsieh@apache.org>
Committed: Thu Jan 14 09:10:28 2016 -0800

----------------------------------------------------------------------
 .../chaos/actions/ChangeCompressionAction.java  | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b09cd260/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
index 0d7f7ae..9c7bf45 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.io.compress.Compression.Algorithm;
+import org.apache.hadoop.io.compress.Compressor;
 
 /**
  * Action that changes the compression algorithm on a column family from a list of tables.
@@ -62,7 +63,25 @@ public class ChangeCompressionAction extends Action {
 
     // Since not every compression algorithm is supported,
     // let's use the same algorithm for all column families.
-    Algorithm algo = possibleAlgos[random.nextInt(possibleAlgos.length)];
+
+    // If an unsupported compression algorithm is chosen, pick a different one.
+    // This is to work around the issue that modifyTable() does not throw remote
+    // exception.
+    Algorithm algo;
+    do {
+      algo = possibleAlgos[random.nextInt(possibleAlgos.length)];
+
+      try {
+        Compressor c = algo.getCompressor();
+
+        // call returnCompressor() to release the Compressor
+        algo.returnCompressor(c);
+        break;
+      } catch (Throwable t) {
+        LOG.info("Performing action: Changing compression algorithms to " + algo +
+                " is not supported, pick another one");
+      }
+    } while (true);
 
     LOG.debug("Performing action: Changing compression algorithms on "
       + tableName.getNameAsString() + " to " + algo);


Mime
View raw message