This is an automated email from the ASF dual-hosted git repository.
larsh pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
new 0d496fe PHOENIX-5336 Speed up MutableIndexSplitForwardScanIT and
MutableIndexSplitReverseScanIT.
0d496fe is described below
commit 0d496fed43fae262fe20ff19809639815db32524
Author: Lars Hofhansl <[email protected]>
AuthorDate: Sat Jun 15 16:25:19 2019 -0700
PHOENIX-5336 Speed up MutableIndexSplitForwardScanIT and
MutableIndexSplitReverseScanIT.
---
.../phoenix/end2end/index/MutableIndexSplitIT.java | 31 ++++++++++++++--------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitIT.java
index c341823..b02c46b 100644
---
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitIT.java
+++
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitIT.java
@@ -37,7 +37,6 @@ import org.apache.hadoop.hbase.MetaTableAccessor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.Threads;
import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
@@ -135,27 +134,37 @@ public abstract class MutableIndexSplitIT extends
ParallelStatsDisabledIT {
splitInts[1] = 4;
List<HRegionInfo> regionsOfUserTable = null;
for(int i = 0; i <=1; i++) {
- Threads.sleep(10000);
- if(localIndex) {
- admin.split(Bytes.toBytes(tableName),
- ByteUtil.concat(Bytes.toBytes(splitKeys[i])));
- } else {
- admin.split(Bytes.toBytes(indexName),
ByteUtil.concat(Bytes.toBytes(splitInts[i])));
+ boolean split = false;
+ for (int j = 0; j < 60 && !split; j++) {
+ try {
+ if (localIndex) {
+ admin.split(Bytes.toBytes(tableName),
+ ByteUtil.concat(Bytes.toBytes(splitKeys[i])));
+ } else {
+ admin.split(Bytes.toBytes(indexName),
+ ByteUtil.concat(Bytes.toBytes(splitInts[i])));
+ }
+ split = true;
+ } catch (IOException x) {
+ // wait up to a minute for the split to succeed
+ Thread.sleep(1000);
+ }
}
- Thread.sleep(100);
+ assertTrue(split);
+
regionsOfUserTable =
MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(),
admin.getConnection(),
TableName.valueOf(localIndex?tableName:indexName),
false);
- while (regionsOfUserTable.size() != (i+2)) {
- Thread.sleep(100);
+ while (regionsOfUserTable.size() < (i+2)) {
+ Thread.sleep(1000);
regionsOfUserTable =
MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(),
admin.getConnection(),
TableName.valueOf(localIndex?tableName:indexName),
false);
}
- assertEquals(i+2, regionsOfUserTable.size());
+ assertTrue(regionsOfUserTable.size() >= (i+2));
}
for (int j = 5; j < 26; j++) {
assertTrue(rs.next());