Author: kturner Date: Wed May 30 17:39:55 2012 New Revision: 1344360 URL: http://svn.apache.org/viewvc?rev=1344360&view=rev Log: ACCUMULO-601 made the master advertise an IP addr in zookeeper also made clients bail when unknownhostexcpetion is thrown when talking to master (merged from trunk)
Modified: accumulo/branches/1.4/src/ (props changed) accumulo/branches/1.4/src/core/ (props changed) accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java accumulo/branches/1.4/src/server/ (props changed) accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java Propchange: accumulo/branches/1.4/src/ ------------------------------------------------------------------------------ Merged /accumulo/trunk:r1344302,1344358 Propchange: accumulo/branches/1.4/src/core/ ------------------------------------------------------------------------------ Merged /accumulo/trunk/core:r1344302,1344358 Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java?rev=1344360&r1=1344359&r2=1344360&view=diff ============================================================================== --- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java (original) +++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java Wed May 30 17:39:55 2012 @@ -16,6 +16,7 @@ */ package org.apache.accumulo.core.client.impl; +import java.net.UnknownHostException; import java.util.List; import org.apache.accumulo.core.client.AccumuloException; @@ -34,7 +35,7 @@ import org.apache.thrift.transport.TTran public class MasterClient { private static final Logger log = Logger.getLogger(MasterClient.class); - public static MasterClientService.Iface getConnectionWithRetry(Instance instance) throws TTransportException { + public static MasterClientService.Iface getConnectionWithRetry(Instance instance) { ArgumentChecker.notNull(instance); while (true) { @@ -64,6 +65,10 @@ public class MasterClient { instance.getConfiguration()); return client; } catch (TTransportException tte) { + if (tte.getCause().getClass().equals(UnknownHostException.class)) { + // do not expect to recover from this + throw new RuntimeException(tte); + } log.debug("Failed to connect to master=" + master + " portHint=" + portHint + ", will retry... ", tte); return null; } Propchange: accumulo/branches/1.4/src/server/ ------------------------------------------------------------------------------ Merged /accumulo/trunk/server:r1344302,1344358 Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1344360&r1=1344359&r2=1344360&view=diff ============================================================================== --- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java (original) +++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java Wed May 30 17:39:55 2012 @@ -2125,7 +2125,8 @@ public class Master implements LiveTServ }; long current = System.currentTimeMillis(); final long waitTime = ServerConfiguration.getSystemConfiguration().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT); - final String masterClientAddress = hostname + ":" + ServerConfiguration.getSystemConfiguration().getPort(Property.MASTER_CLIENTPORT); + final String masterClientAddress = org.apache.accumulo.core.util.AddressUtil.toString(new InetSocketAddress(hostname, ServerConfiguration + .getSystemConfiguration().getPort(Property.MASTER_CLIENTPORT))); boolean locked = false; while (System.currentTimeMillis() - current < waitTime) {