Skip to content

Commit

Permalink
WHIRR-298. Use all cluster spec properties for hash and equality (tom…
Browse files Browse the repository at this point in the history
…white and asavu)

git-svn-id: https://svn.apache.org/repos/asf/incubator/whirr/trunk@1100202 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Andrei Savu committed May 6, 2011
1 parent 96152f7 commit d66ed90
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Expand Up @@ -81,6 +81,9 @@ Trunk (unreleased changes)

WHIRR-172. Log warning for unrecognized service names. (tomwhite)

WHIRR-298. Use all cluster spec properties for hash and
equality (tomwhite and asavu)

Release 0.4.0 - 2011-03-15

NEW FEATURES
Expand Down
48 changes: 39 additions & 9 deletions core/src/main/java/org/apache/whirr/ClusterSpec.java
Expand Up @@ -47,10 +47,7 @@
import org.apache.commons.configuration.interpol.ConfigurationInterpolator;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.text.StrLookup;
import org.jclouds.predicates.Validator;
import org.jclouds.predicates.validators.DnsNameValidator;
import org.jclouds.rest.annotations.ParamValidators;
import org.jclouds.s3.predicates.validators.BucketNameValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -746,23 +743,52 @@ public boolean equals(Object o) {
&& Objects.equal(serviceName, that.serviceName)
&& Objects.equal(clusterUser, that.clusterUser)
&& Objects.equal(loginUser, that.loginUser)
&& Objects.equal(publicKey, that.publicKey)
&& Objects.equal(privateKey, that.privateKey)
&& Objects.equal(imageId, that.imageId)
&& Objects.equal(hardwareId, that.hardwareId)
&& Objects.equal(hardwareMinRam, that.hardwareMinRam)
&& Objects.equal(locationId, that.locationId)
&& Objects.equal(blobStoreLocationId, that.blobStoreLocationId)
&& Objects.equal(clientCidrs, that.clientCidrs)
&& Objects.equal(version, that.version)
&& Objects.equal(runUrlBase, that.runUrlBase)
&& Objects.equal(stateStore, that.stateStore)
&& Objects.equal(stateStoreContainer, that.stateStoreContainer)
&& Objects.equal(stateStoreBlob, that.stateStoreBlob)
;
}
return false;
}

public int hashCode() {
return Objects.hashCode(instanceTemplates, maxStartupRetries, provider,
identity, credential, blobStoreProvider, blobStoreIdentity, blobStoreCredential,
clusterName, serviceName, clusterUser, loginUser, publicKey, privateKey, imageId,
hardwareId, locationId, blobStoreLocationId, clientCidrs, version, runUrlBase);
return Objects.hashCode(
instanceTemplates,
maxStartupRetries,
provider,
identity,
credential,
blobStoreProvider,
blobStoreIdentity,
blobStoreCredential,
clusterName,
serviceName,
clusterUser,
loginUser,
publicKey,
privateKey,
imageId,
hardwareId,
hardwareMinRam,
locationId,
blobStoreLocationId,
clientCidrs,
version,
runUrlBase,
stateStore,
stateStoreBlob,
stateStoreContainer
);
}

public String toString() {
Expand All @@ -782,12 +808,16 @@ public String toString() {
.add("publicKey", publicKey)
.add("privateKey", privateKey)
.add("imageId", imageId)
.add("instanceSizeId", hardwareId)
.add("instanceMinRam", hardwareMinRam)
.add("hardwareId", hardwareId)
.add("hardwareMinRam", hardwareMinRam)
.add("locationId", locationId)
.add("blobStoreLocationId", blobStoreLocationId)
.add("clientCidrs", clientCidrs)
.add("version", version)
.add("runUrlBase", runUrlBase)
.add("stateStore", stateStore)
.add("stateStoreContainer", stateStoreContainer)
.add("stateStoreBlob", stateStoreBlob)
.toString();
}
}

0 comments on commit d66ed90

Please sign in to comment.