Author: omalley
Date: Fri Mar 4 03:49:01 2011
New Revision: 1077178
URL: http://svn.apache.org/viewvc?rev=1077178&view=rev
Log:
commit c4f785cfc285c89e5612f446ef324ad3706a4090
Author: Konstantin Boudnik <[email protected]>
Date: Mon Feb 22 18:30:47 2010 -0800
from
Modified:
hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
Modified:
hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java?rev=1077178&r1=1077177&r2=1077178&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
(original)
+++
hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
Fri Mar 4 03:49:01 2011
@@ -31,6 +31,10 @@ import org.apache.hadoop.util.Shell.Shel
*/
public class HadoopDaemonRemoteCluster implements ClusterProcessManager {
+ private final static String
CONF_HADOOP_MASTERSFILE_NAME="test.system.hdrc.masters.file";
+ private final static String MASTERS_FILE =
System.getProperty(CONF_HADOOP_MASTERSFILE_NAME, "masters");
+ private final static String SLAVES_FILE = "slaves";
+
private static final Log LOG = LogFactory
.getLog(HadoopDaemonRemoteCluster.class.getName());
@@ -173,8 +177,8 @@ public class HadoopDaemonRemoteCluster i
}
private void populateDaemons(String confLocation) throws IOException {
- File mastersFile = new File(confLocation, "masters");
- File slavesFile = new File(confLocation, "slaves");
+ File mastersFile = new File(confLocation, MASTERS_FILE);
+ File slavesFile = new File(confLocation, SLAVES_FILE);
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(mastersFile));
@@ -182,12 +186,16 @@ public class HadoopDaemonRemoteCluster i
masterHost = reader.readLine();
if (masterHost != null && !masterHost.trim().isEmpty()) {
master = new ScriptDaemon(masterCommand, masterHost);
+ } else {
+ LOG.error(confLocation + System.getProperty("file.separator", "/") +
+ MASTERS_FILE + " has no content");
}
} finally {
try {
reader.close();
} catch (Exception e) {
- LOG.error("Can't read masters file from " + confLocation);
+ LOG.error("Can't read masters file from " + confLocation +
+ System.getProperty("file.separator", "/") + MASTERS_FILE);
}
}
@@ -198,11 +206,16 @@ public class HadoopDaemonRemoteCluster i
RemoteProcess slave = new ScriptDaemon(slaveCommand, slaveHost);
slaves.put(slaveHost, slave);
}
+ if (slaves.size() == 0) {
+ LOG.error(confLocation + System.getProperty("file.separator", "/") +
+ SLAVES_FILE + " has no content");
+ }
} finally {
try {
reader.close();
} catch (Exception e) {
- LOG.error("Can't read slaves file from " + confLocation);
+ LOG.error("Can't read slaves file from " + confLocation +
+ System.getProperty("file.separator", "/") + SLAVES_FILE);
}
}
}