Skip to content
Browse files

more effort in adding a new allocation type

  • Loading branch information...
1 parent fa7dbe7 commit fd61d37ab955539561b642cec4b089309b0046ae @buzztroll buzztroll committed
View
13 ...ools/messaging/gt4_0_elastic/v2008_05_05/general/defaults/DefaultResourceAllocations.java
@@ -101,6 +101,9 @@ void validate() throws Exception {
if (this.xlargeName == null || this.xlargeName.trim().length() == 0) {
throw new Exception("Invalid: Missing x-large RA name");
}
+ if (this.customName == null || this.customName.trim().length() == 0) {
+ throw new Exception("Invalid: Missing custom RA name");
+ }
if (this.unknownString == null || this.unknownString.trim().length() == 0) {
throw new Exception("Invalid: Missing 'unknown' RA string");
}
@@ -117,6 +120,10 @@ void validate() throws Exception {
throw new Exception("Invalid: Extra-large RA memory is zero " +
"or negative: " + this.xlargeMemory);
}
+ if (this.customMemory < 1) {
+ throw new Exception("Invalid: custom RA memory is zero " +
+ "or negative: " + this.customMemory);
+ }
if (this.smallCPUs < 1) {
throw new Exception("Invalid: Small RA CPUs is zero " +
@@ -130,6 +137,10 @@ void validate() throws Exception {
throw new Exception("Invalid: Extra-large RA CPUs is zero " +
"or negative: " + this.xlargeMemory);
}
+ if (this.customCPUs < 1) {
+ throw new Exception("Invalid: custom RA CPUs is zero " +
+ "or negative: " + this.customMemory);
+ }
if (this.vmmType == null || this.vmmType.trim().length() == 0) {
logger.warn("No VMM type configured to send in requests?");
@@ -241,6 +252,8 @@ public void setSiType(String siType) throws Exception {
this.siType = this.getLargeName();
} else if(siType.equalsIgnoreCase("xlarge")){
this.siType = this.getXlargeName();
+ } else if(siType.equalsIgnoreCase("custom")){
+ this.siType = this.getCustomName();
} else {
throw new Exception("Invalid SI type in spotinstances configuration file. " +
"Valid values are: small, large or xlarge");
View
3 service/service/java/tests/suites/failure/home/services/etc/nimbus/elastic/other/main.xml
@@ -145,9 +145,12 @@
<property name="smallMemory" value="$ELASTIC{memory.small}" />
<property name="largeMemory" value="$ELASTIC{memory.large}" />
<property name="xlargeMemory" value="$ELASTIC{memory.xlarge}" />
+ <property name="customMemory" value="$ELASTIC{memory.custom}" />
+
<property name="smallName" value="$OTHER_ELASTIC{ra.name.small}" />
<property name="largeName" value="$OTHER_ELASTIC{ra.name.large}" />
<property name="xlargeName" value="$OTHER_ELASTIC{ra.name.xlarge}" />
+ <property name="customName" value="$OTHER_ELASTIC{ra.name.custom}" />
<property name="unknownString" value="$OTHER_ELASTIC{ra.name.unknown}" />
<property name="cpuArch" value="$OTHER_ELASTIC{cpu.arch}" />

0 comments on commit fd61d37

Please sign in to comment.
Something went wrong with that request. Please try again.