Skip to content

Commit 5afcc7d

Browse files
committed
HADOOP-3628 merge revision r752949 into its proper home
git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/HADOOP-3628@755965 13f79535-47bb-0310-9956-ffa450edef68
1 parent 45ff75e commit 5afcc7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2777
-520
lines changed

ivy/libraries.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ coreplugin.version=1.3.2
3535
hsqldb.version=1.8.0.10
3636

3737
#ivy.version=2.0.0-beta2
38-
ivy.version=2.0.0-rc2
38+
ivy.version=2.0.0
3939

4040
jasper.version=5.5.12
4141
#not able to figureout the version of jsp & jsp-api version to get it resolved throught ivy

src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestUlimit.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ String[] genArgs(String memLimit) {
7171
* it to succeed. Then program is launched with insufficient memory and
7272
* is expected to be a failure.
7373
*/
74-
public void testCommandLine() {
74+
public void testCommandLine() throws Exception {
7575
if (StreamUtil.isCygwin()) {
7676
return;
7777
}
@@ -88,11 +88,9 @@ public void testCommandLine() {
8888
fs.delete(outputPath, true);
8989
assertFalse("output not cleaned up", fs.exists(outputPath));
9090
mr.waitUntilIdle();
91-
} catch(IOException e) {
92-
fail(e.toString());
9391
} finally {
94-
mr.shutdown();
95-
dfs.shutdown();
92+
MiniDFSCluster.close(dfs);
93+
MiniMRCluster.close(mr);
9694
}
9795
}
9896

src/core/org/apache/hadoop/conf/Configuration.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
185185
private Properties properties;
186186
private Properties overlay;
187187
private ClassLoader classLoader;
188+
private static final String ERROR_PARSING_CONF_FILE =
189+
"Error parsing configuration resource ";
190+
188191
{
189192
classLoader = Thread.currentThread().getContextClassLoader();
190193
if (classLoader == null) {
@@ -973,7 +976,7 @@ public Reader getConfResourceAsReader(String name) {
973976
}
974977
}
975978

976-
private synchronized Properties getProps() {
979+
protected synchronized Properties getProps() {
977980
if (properties == null) {
978981
properties = new Properties();
979982
loadResources(properties, resources, quietmode);
@@ -1157,16 +1160,16 @@ private void loadResource(Properties properties, Object name, boolean quiet) {
11571160
}
11581161

11591162
} catch (IOException e) {
1160-
LOG.fatal("error parsing conf file: " + e);
1163+
LOG.fatal(ERROR_PARSING_CONF_FILE + name + " : " + e, e);
11611164
throw new RuntimeException(e);
11621165
} catch (DOMException e) {
1163-
LOG.fatal("error parsing conf file: " + e);
1166+
LOG.fatal(ERROR_PARSING_CONF_FILE + name + " : " + e, e);
11641167
throw new RuntimeException(e);
11651168
} catch (SAXException e) {
1166-
LOG.fatal("error parsing conf file: " + e);
1169+
LOG.fatal(ERROR_PARSING_CONF_FILE + name + " : " + e, e);
11671170
throw new RuntimeException(e);
11681171
} catch (ParserConfigurationException e) {
1169-
LOG.fatal("error parsing conf file: " + e);
1172+
LOG.fatal(ERROR_PARSING_CONF_FILE + name + " : " + e, e);
11701173
throw new RuntimeException(e);
11711174
}
11721175
}

src/core/org/apache/hadoop/http/HttpServer.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.net.BindException;
2323
import java.net.InetSocketAddress;
2424
import java.net.URL;
25+
import java.net.BindException;
2526
import java.util.ArrayList;
2627
import java.util.HashMap;
2728
import java.util.List;
@@ -457,7 +458,11 @@ public void start() throws IOException {
457458
// then try the next port number.
458459
if (ex instanceof BindException) {
459460
if (!findPort) {
460-
throw (BindException) ex;
461+
BindException be = new BindException(
462+
"Port in use: " + listener.getHost()
463+
+ ":" + listener.getPort());
464+
be.initCause(ex);
465+
throw be;
461466
}
462467
} else {
463468
LOG.info("HttpServer.start() threw a non Bind IOException");
@@ -488,6 +493,14 @@ public void join() throws InterruptedException {
488493
webServer.join();
489494
}
490495

496+
/**
497+
* Test for the availability of the web server
498+
* @return true if the web server is started, false otherwise
499+
*/
500+
public boolean isAlive() {
501+
return webServer.isStarted();
502+
}
503+
491504
/**
492505
* A very simple servlet to serve up a text representation of the current
493506
* stack traces. It both returns the stacks to the caller and logs them.

src/core/org/apache/hadoop/ipc/Client.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ public int read(byte[] buf, int off, int len) throws IOException {
284284
/** Connect to the server and set up the I/O streams. It then sends
285285
* a header to the server and starts
286286
* the connection thread that waits for responses.
287+
* @throws IOException if the connection attempt was unsuccessful
287288
*/
288-
private synchronized void setupIOstreams() {
289+
private synchronized void setupIOstreams() throws IOException {
289290
if (socket != null || shouldCloseConnection.get()) {
290291
return;
291292
}
@@ -308,7 +309,7 @@ private synchronized void setupIOstreams() {
308309
/* The max number of retries is 45,
309310
* which amounts to 20s*45 = 15 minutes retries.
310311
*/
311-
handleConnectionFailure(timeoutFailures++, 45, toe);
312+
handleConnectionFailure(timeoutFailures++, maxRetries, toe);
312313
} catch (IOException ie) {
313314
handleConnectionFailure(ioFailures++, maxRetries, ie);
314315
}
@@ -327,6 +328,7 @@ private synchronized void setupIOstreams() {
327328
} catch (IOException e) {
328329
markClosed(e);
329330
close();
331+
throw e;
330332
}
331333
}
332334

@@ -358,7 +360,7 @@ private void handleConnectionFailure(
358360

359361
// throw the exception if the maximum number of retries is reached
360362
if (curRetries >= maxRetries) {
361-
throw ioe;
363+
throw wrapException(remoteId.getAddress(), ioe);
362364
}
363365

364366
// otherwise back off and retry
@@ -367,7 +369,7 @@ private void handleConnectionFailure(
367369
} catch (InterruptedException ignored) {}
368370

369371
LOG.info("Retrying connect to server: " + server +
370-
". Already tried " + curRetries + " time(s).");
372+
". Already tried " + curRetries + " time(s) out of "+ maxRetries);
371373
}
372374

373375
/* Write the header for each connection

src/core/org/apache/hadoop/ipc/RPC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public static VersionedProtocol waitForProxy(Class protocol,
301301
* @return the proxy
302302
* @throws IOException if the far end through a RemoteException
303303
*/
304-
static VersionedProtocol waitForProxy(Class protocol,
304+
public static VersionedProtocol waitForProxy(Class protocol,
305305
long clientVersion,
306306
InetSocketAddress addr,
307307
Configuration conf,

0 commit comments

Comments
 (0)