HBASE-22187 Removed remaining usages of ClusterConnection.clearRegionCache
This commit is contained in:
parent
f227eb7aac
commit
bc58adac5b
|
@ -924,7 +924,7 @@ public class HTable implements Table {
|
||||||
* This is a power user function: avoid unless you know the ramifications.
|
* This is a power user function: avoid unless you know the ramifications.
|
||||||
*/
|
*/
|
||||||
public void clearRegionCache() {
|
public void clearRegionCache() {
|
||||||
this.connection.clearRegionCache();
|
this.connection.clearRegionLocationCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -707,7 +707,7 @@ public class RegionSplitter {
|
||||||
Path tableDir = tableDirAndSplitFile.getFirst();
|
Path tableDir = tableDirAndSplitFile.getFirst();
|
||||||
FileSystem fs = tableDir.getFileSystem(connection.getConfiguration());
|
FileSystem fs = tableDir.getFileSystem(connection.getConfiguration());
|
||||||
// Clear the cache to forcibly refresh region information
|
// Clear the cache to forcibly refresh region information
|
||||||
((ClusterConnection)connection).clearRegionCache();
|
((ClusterConnection)connection).clearRegionLocationCache();
|
||||||
TableDescriptor htd = null;
|
TableDescriptor htd = null;
|
||||||
try (Table table = connection.getTable(tableName)) {
|
try (Table table = connection.getTable(tableName)) {
|
||||||
htd = table.getDescriptor();
|
htd = table.getDescriptor();
|
||||||
|
@ -768,7 +768,7 @@ public class RegionSplitter {
|
||||||
} catch (NoServerForRegionException nsfre) {
|
} catch (NoServerForRegionException nsfre) {
|
||||||
LOG.debug("No Server Exception thrown for: " + splitAlgo.rowToStr(start));
|
LOG.debug("No Server Exception thrown for: " + splitAlgo.rowToStr(start));
|
||||||
physicalSplitting.add(region);
|
physicalSplitting.add(region);
|
||||||
((ClusterConnection)connection).clearRegionCache();
|
((ClusterConnection)connection).clearRegionLocationCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ public class TestMetaWithReplicas {
|
||||||
util.getHBaseClusterInterface().killRegionServer(primary);
|
util.getHBaseClusterInterface().killRegionServer(primary);
|
||||||
util.getHBaseClusterInterface().waitForRegionServerToStop(primary, 60000);
|
util.getHBaseClusterInterface().waitForRegionServerToStop(primary, 60000);
|
||||||
}
|
}
|
||||||
((ClusterConnection)c).clearRegionCache();
|
((ClusterConnection)c).clearRegionLocationCache();
|
||||||
}
|
}
|
||||||
LOG.info("Running GETs");
|
LOG.info("Running GETs");
|
||||||
Get get = null;
|
Get get = null;
|
||||||
|
@ -276,7 +276,7 @@ public class TestMetaWithReplicas {
|
||||||
util.getHBaseClusterInterface().startRegionServer(primary.getHostname(), 0);
|
util.getHBaseClusterInterface().startRegionServer(primary.getHostname(), 0);
|
||||||
util.getHBaseClusterInterface().waitForActiveAndReadyMaster();
|
util.getHBaseClusterInterface().waitForActiveAndReadyMaster();
|
||||||
LOG.info("Master active!");
|
LOG.info("Master active!");
|
||||||
((ClusterConnection)c).clearRegionCache();
|
((ClusterConnection)c).clearRegionLocationCache();
|
||||||
}
|
}
|
||||||
conf.setBoolean(HConstants.USE_META_REPLICAS, false);
|
conf.setBoolean(HConstants.USE_META_REPLICAS, false);
|
||||||
LOG.info("Running GETs no replicas");
|
LOG.info("Running GETs no replicas");
|
||||||
|
|
|
@ -229,7 +229,7 @@ public class TestReplicasClient {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void before() throws IOException {
|
public void before() throws IOException {
|
||||||
((ClusterConnection) HTU.getAdmin().getConnection()).clearRegionCache();
|
((ClusterConnection) HTU.getAdmin().getConnection()).clearRegionLocationCache();
|
||||||
try {
|
try {
|
||||||
openRegion(hriPrimary);
|
openRegion(hriPrimary);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
|
@ -251,7 +251,7 @@ public class TestReplicasClient {
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
((ClusterConnection) HTU.getAdmin().getConnection()).clearRegionCache();
|
((ClusterConnection) HTU.getAdmin().getConnection()).clearRegionLocationCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
private HRegionServer getRS() {
|
private HRegionServer getRS() {
|
||||||
|
@ -332,14 +332,14 @@ public class TestReplicasClient {
|
||||||
ClusterConnection hc = (ClusterConnection) HTU.getAdmin().getConnection();
|
ClusterConnection hc = (ClusterConnection) HTU.getAdmin().getConnection();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
hc.clearRegionCache();
|
hc.clearRegionLocationCache();
|
||||||
RegionLocations rl = hc.locateRegion(table.getName(), b1, false, false);
|
RegionLocations rl = hc.locateRegion(table.getName(), b1, false, false);
|
||||||
Assert.assertEquals(2, rl.size());
|
Assert.assertEquals(2, rl.size());
|
||||||
|
|
||||||
rl = hc.locateRegion(table.getName(), b1, true, false);
|
rl = hc.locateRegion(table.getName(), b1, true, false);
|
||||||
Assert.assertEquals(2, rl.size());
|
Assert.assertEquals(2, rl.size());
|
||||||
|
|
||||||
hc.clearRegionCache();
|
hc.clearRegionLocationCache();
|
||||||
rl = hc.locateRegion(table.getName(), b1, true, false);
|
rl = hc.locateRegion(table.getName(), b1, true, false);
|
||||||
Assert.assertEquals(2, rl.size());
|
Assert.assertEquals(2, rl.size());
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,7 @@ public class TestSeparateClientZKCluster {
|
||||||
put.addColumn(family, qualifier, value);
|
put.addColumn(family, qualifier, value);
|
||||||
table.put(put);
|
table.put(put);
|
||||||
// invalid connection cache
|
// invalid connection cache
|
||||||
conn.clearRegionCache();
|
conn.clearRegionLocationCache();
|
||||||
// stop client zk cluster
|
// stop client zk cluster
|
||||||
clientZkCluster.shutdown();
|
clientZkCluster.shutdown();
|
||||||
// stop current meta server and confirm the server shutdown process
|
// stop current meta server and confirm the server shutdown process
|
||||||
|
|
|
@ -308,7 +308,7 @@ public class BaseTestHBaseFsck {
|
||||||
tbl = null;
|
tbl = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
((ClusterConnection) connection).clearRegionCache();
|
((ClusterConnection) connection).clearRegionLocationCache();
|
||||||
deleteTable(TEST_UTIL, tablename);
|
deleteTable(TEST_UTIL, tablename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue