You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by to...@apache.org on 2010/12/23 07:01:32 UTC
svn commit: r1052174 - in /incubator/whirr/trunk: ./
core/src/main/java/org/apache/whirr/service/
services/hadoop/src/main/java/org/apache/whirr/service/hadoop/
Author: tomwhite
Date: Thu Dec 23 06:01:32 2010
New Revision: 1052174
URL: http://svn.apache.org/viewvc?rev=1052174&view=rev
Log:
WHIRR-165. Hadoop integration tests fail due to WHIRR-160 changes.
Modified:
incubator/whirr/trunk/CHANGES.txt
incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ClusterSpec.java
incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java
incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java
Modified: incubator/whirr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/CHANGES.txt?rev=1052174&r1=1052173&r2=1052174&view=diff
==============================================================================
--- incubator/whirr/trunk/CHANGES.txt (original)
+++ incubator/whirr/trunk/CHANGES.txt Thu Dec 23 06:01:32 2010
@@ -62,6 +62,9 @@ Trunk (unreleased changes)
WHIRR-175. ZooKeeper service does not honor instance roles.
(Lars George via tomwhite)
+ WHIRR-165. Hadoop integration tests fail due to WHIRR-160 changes.
+ (tomwhite)
+
Release 0.2.0 - 2010-11-04
NEW FEATURES
Modified: incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ClusterSpec.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ClusterSpec.java?rev=1052174&r1=1052173&r2=1052174&view=diff
==============================================================================
--- incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ClusterSpec.java (original)
+++ incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ClusterSpec.java Thu Dec 23 06:01:32 2010
@@ -20,6 +20,7 @@ package org.apache.whirr.service;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.io.Payloads.newFilePayload;
import static org.jclouds.io.Payloads.newStringPayload;
import static org.jclouds.util.Utils.toStringAndClose;
@@ -351,13 +352,7 @@ public class ClusterSpec {
* @param publicKey
*/
public void setPublicKey(String publicKey) {
- /*
- * http://stackoverflow.com/questions/2494645#2494645
- */
- checkArgument(checkNotNull(publicKey, "publicKey")
- .startsWith("ssh-rsa AAAAB3NzaC1yc2EA"),
- "key should start with ssh-rsa AAAAB3NzaC1yc2EA");
-
+ checkPublicKey(publicKey);
this.publicKey = newStringPayload(publicKey);
}
@@ -368,9 +363,19 @@ public class ClusterSpec {
* @see #setPublicKey(String)
*/
public void setPublicKey(File publicKey) throws IOException {
- setPublicKey(IOUtils.toString(new FileReader(publicKey)));
+ checkPublicKey(IOUtils.toString(new FileReader(publicKey)));
+ this.publicKey = newFilePayload(publicKey);
}
+ private void checkPublicKey(String publicKey) {
+ /*
+ * http://stackoverflow.com/questions/2494645#2494645
+ */
+ checkArgument(checkNotNull(publicKey, "publicKey")
+ .startsWith("ssh-rsa AAAAB3NzaC1yc2EA"),
+ "key should start with ssh-rsa AAAAB3NzaC1yc2EA");
+ }
+
/**
* The rsa private key which is used as the login identity on the cloud
* nodes.
@@ -378,9 +383,7 @@ public class ClusterSpec {
* @param privateKey
*/
public void setPrivateKey(String privateKey) {
- checkArgument(checkNotNull(privateKey, "privateKey")
- .startsWith("-----BEGIN RSA PRIVATE KEY-----"),
- "key should start with -----BEGIN RSA PRIVATE KEY-----");
+ checkPrivateKey(privateKey);
this.privateKey = newStringPayload(privateKey);
}
@@ -391,7 +394,14 @@ public class ClusterSpec {
* @see #setPrivateKey(String)
*/
public void setPrivateKey(File privateKey) throws IOException {
- setPrivateKey(IOUtils.toString(new FileReader(privateKey)));
+ checkPrivateKey(IOUtils.toString(new FileReader(privateKey)));
+ this.privateKey = newFilePayload(privateKey);
+ }
+
+ private void checkPrivateKey(String privateKey) {
+ checkArgument(checkNotNull(privateKey, "privateKey")
+ .startsWith("-----BEGIN RSA PRIVATE KEY-----"),
+ "key should start with -----BEGIN RSA PRIVATE KEY-----");
}
public void setImageId(String imageId) {
Modified: incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java?rev=1052174&r1=1052173&r2=1052174&view=diff
==============================================================================
--- incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java (original)
+++ incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopDataNodeClusterActionHandler.java Thu Dec 23 06:01:32 2010
@@ -67,7 +67,7 @@ public class HadoopDataNodeClusterAction
"dn,tt",
"-n", DnsUtil.resolveAddress(namenodePublicAddress.getHostAddress()),
"-j", DnsUtil.resolveAddress(jobtrackerPublicAddress.getHostAddress()),
- clusterSpec.getProvider());
+ "-c", clusterSpec.getProvider());
}
}
Modified: incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java?rev=1052174&r1=1052173&r2=1052174&view=diff
==============================================================================
--- incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java (original)
+++ incubator/whirr/trunk/services/hadoop/src/main/java/org/apache/whirr/service/hadoop/HadoopNameNodeClusterActionHandler.java Thu Dec 23 06:01:32 2010
@@ -106,7 +106,7 @@ public class HadoopNameNodeClusterAction
"nn,jt",
"-n", DnsUtil.resolveAddress(namenodePublicAddress.getHostAddress()),
"-j", DnsUtil.resolveAddress(jobtrackerPublicAddress.getHostAddress()),
- clusterSpec.getProvider());
+ "-c", clusterSpec.getProvider());
}
@Override