hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-14962 TestSplitWalDataLoss fails on all branches
Date Sat, 16 Jan 2016 23:53:09 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 387eaff31 -> 47fc696bc


HBASE-14962 TestSplitWalDataLoss fails on all branches


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

Branch: refs/heads/master
Commit: 47fc696bc61e10386cf35644d95d2f45246d3269
Parents: 387eaff
Author: stack <stack@apache.org>
Authored: Sat Jan 16 15:53:07 2016 -0800
Committer: stack <stack@apache.org>
Committed: Sat Jan 16 15:53:07 2016 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/TestSplitWalDataLoss.java  | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/47fc696b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
index 1294266..1c1a98b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
@@ -24,6 +24,7 @@ import static org.mockito.Mockito.spy;
 
 import java.io.IOException;
 import java.util.Collection;
+import java.util.Map;
 
 import org.apache.commons.lang.mutable.MutableBoolean;
 import org.apache.commons.logging.Log;
@@ -117,7 +118,15 @@ public class TestSplitWalDataLoss {
     }).when(spiedRegion).internalFlushCacheAndCommit(Matchers.<WAL> any(),
       Matchers.<MonitoredTask> any(), Matchers.<PrepareFlushResult> any(),
       Matchers.<Collection<Store>> any());
-    rs.onlineRegions.put(rs.onlineRegions.keySet().iterator().next(), spiedRegion);
+    // Find region key; don't pick up key for hbase:meta by mistake.
+    String key = null;
+    for (Map.Entry<String, Region> entry: rs.onlineRegions.entrySet()) {
+      if (entry.getValue().getRegionInfo().getTable().equals(this.tableName)) {
+        key = entry.getKey();
+        break;
+      }
+    }
+    rs.onlineRegions.put(key, spiedRegion);
     Connection conn = testUtil.getConnection();
 
     try (Table table = conn.getTable(tableName)) {


Mime
View raw message