HBASE-2483 Some tests do not use ephemeral ports
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@946389 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
528b2c2d32
commit
e6db59ae2b
@ -340,6 +340,7 @@ Release 0.21.0 - Unreleased
|
|||||||
HBASE-2572 hbase/bin/set_meta_block_caching.rb:72: can't convert
|
HBASE-2572 hbase/bin/set_meta_block_caching.rb:72: can't convert
|
||||||
Java::JavaLang::String into String (TypeError) - little
|
Java::JavaLang::String into String (TypeError) - little
|
||||||
issue with script
|
issue with script
|
||||||
|
HBASE-2483 Some tests do not use ephemeral ports
|
||||||
|
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
@ -68,6 +68,7 @@ public class MiniHBaseCluster implements HConstants {
|
|||||||
public MiniHBaseCluster(Configuration conf, int numRegionServers)
|
public MiniHBaseCluster(Configuration conf, int numRegionServers)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
|
conf.set(MASTER_PORT, "0");
|
||||||
init(numRegionServers);
|
init(numRegionServers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,22 +206,10 @@ public class MiniHBaseCluster implements HConstants {
|
|||||||
private void init(final int nRegionNodes) throws IOException {
|
private void init(final int nRegionNodes) throws IOException {
|
||||||
try {
|
try {
|
||||||
// start up a LocalHBaseCluster
|
// start up a LocalHBaseCluster
|
||||||
while (true) {
|
|
||||||
try {
|
|
||||||
hbaseCluster = new LocalHBaseCluster(conf, nRegionNodes,
|
hbaseCluster = new LocalHBaseCluster(conf, nRegionNodes,
|
||||||
MiniHBaseCluster.MiniHBaseClusterMaster.class,
|
MiniHBaseCluster.MiniHBaseClusterMaster.class,
|
||||||
MiniHBaseCluster.MiniHBaseClusterRegionServer.class);
|
MiniHBaseCluster.MiniHBaseClusterRegionServer.class);
|
||||||
hbaseCluster.startup();
|
hbaseCluster.startup();
|
||||||
} catch (BindException e) {
|
|
||||||
//this port is already in use. try to use another (for multiple testing)
|
|
||||||
int port = conf.getInt(MASTER_PORT, DEFAULT_MASTER_PORT);
|
|
||||||
LOG.info("Failed binding Master to port: " + port, e);
|
|
||||||
port++;
|
|
||||||
conf.setInt(MASTER_PORT, port);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
shutdown();
|
shutdown();
|
||||||
throw e;
|
throw e;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user