Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hbase-19761:Fix Checkstyle errors in hbase-zookeeper #72

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
HBASE-20363 TestNamespaceAuditor.testRegionMerge is flaky
Apache9 authored and maoling committed Apr 11, 2018
commit 2eddc9ad54aeeb512ec4dad02c0dfb07f69571dc
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@
import org.apache.hadoop.hbase.quotas.MasterQuotaManager;
import org.apache.hadoop.hbase.quotas.QuotaExceededException;
import org.apache.hadoop.hbase.quotas.QuotaUtil;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.Store;
import org.apache.hadoop.hbase.regionserver.StoreFile;
import org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;
@@ -348,24 +349,24 @@ public void testRegionMerge() throws Exception {
UTIL.loadNumericRows(table, Bytes.toBytes("info"), 1000, 1999);
}
ADMIN.flush(tableTwo);
List<HRegionInfo> hris = ADMIN.getTableRegions(tableTwo);
List<RegionInfo> hris = ADMIN.getRegions(tableTwo);
assertEquals(initialRegions, hris.size());
Collections.sort(hris);
Collections.sort(hris, RegionInfo.COMPARATOR);
Future<?> f = ADMIN.mergeRegionsAsync(
hris.get(0).getEncodedNameAsBytes(),
hris.get(1).getEncodedNameAsBytes(),
false);
f.get(10, TimeUnit.SECONDS);

hris = ADMIN.getTableRegions(tableTwo);
hris = ADMIN.getRegions(tableTwo);
assertEquals(initialRegions - 1, hris.size());
Collections.sort(hris);
ADMIN.split(tableTwo, Bytes.toBytes("3"));
// Not much we can do here until we have split return a Future.
Threads.sleep(5000);
hris = ADMIN.getTableRegions(tableTwo);
Collections.sort(hris, RegionInfo.COMPARATOR);
UTIL.compact(tableTwo, true);
ADMIN.splitRegionAsync(hris.get(0).getRegionName(), Bytes.toBytes("3")).get(10,
TimeUnit.SECONDS);
hris = ADMIN.getRegions(tableTwo);
assertEquals(initialRegions, hris.size());
Collections.sort(hris);
Collections.sort(hris, RegionInfo.COMPARATOR);

// Fail region merge through Coprocessor hook
MiniHBaseCluster cluster = UTIL.getHBaseCluster();
@@ -384,19 +385,18 @@ public void testRegionMerge() throws Exception {
} catch (ExecutionException ee) {
// Expected.
}
hris = ADMIN.getTableRegions(tableTwo);
hris = ADMIN.getRegions(tableTwo);
assertEquals(initialRegions, hris.size());
Collections.sort(hris);
Collections.sort(hris, RegionInfo.COMPARATOR);
// verify that we cannot split
HRegionInfo hriToSplit2 = hris.get(1);
try {
ADMIN.split(tableTwo, Bytes.toBytes("6"));
fail();
} catch (DoNotRetryRegionException e) {
// Expected
}
Thread.sleep(2000);
assertEquals(initialRegions, ADMIN.getTableRegions(tableTwo).size());
assertEquals(initialRegions, ADMIN.getRegions(tableTwo).size());
}

/*