HBASE-12212 HBaseTestingUtility#waitUntilAllRegionsAssigned should wait for RegionStates
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
712dad814c
commit
8915130dd7
|
@ -3045,6 +3045,17 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
|
||||||
} finally {
|
} finally {
|
||||||
meta.close();
|
meta.close();
|
||||||
}
|
}
|
||||||
|
// So, all regions are in the meta table but make sure master knows of the assignments before
|
||||||
|
// returing -- sometimes this can lag.
|
||||||
|
HMaster master = getHBaseCluster().getMaster();
|
||||||
|
final RegionStates states = master.getAssignmentManager().getRegionStates();
|
||||||
|
waitFor(timeout, 200, new Predicate<IOException>() {
|
||||||
|
@Override
|
||||||
|
public boolean evaluate() throws IOException {
|
||||||
|
List<HRegionInfo> hris = states.getRegionsOfTable(tableName);
|
||||||
|
return hris != null && !hris.isEmpty();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue