### Eclipse Workspace Patch 1.0 #P hama-core Index: src/test/java/org/apache/hama/MiniBSPCluster.java =================================================================== --- eclipse_workspace/hama-trunk/core/src/test/java/org/apache/hama/MiniBSPCluster.java (revision 1575192) +++ eclipse_workspace/hama-trunk/core/src/test/java/org/apache/hama/MiniBSPCluster.java (working copy) @@ -58,7 +58,8 @@ public void run() { try { LOG.info("Starting BSP Master."); - this.bspm = BSPMaster.startMaster(this.conf); + //this.bspm = BSPMaster.startMaster(this.conf); + setMaster(40000); this.bspm.offerService(); } catch (IOException ioe) { LOG.error("Fail to startup BSP Master.", ioe); @@ -67,6 +68,16 @@ Thread.currentThread().interrupt(); } } + + private void setMaster(int defaultPort) { + try{ + this.conf.setInt("bsp.master.port", defaultPort); + System.out.println(defaultPort); + this.bspm = BSPMaster.startMaster(this.conf); + }catch(Exception e) { + setMaster(++defaultPort); + } + } public void shutdown() { if (null != this.bspm)