Permalink
Browse files

-added RM API support to backfill requests

-renamed SI related classes to Async
  • Loading branch information...
1 parent 3048a2c commit 7b5cbfd62073339b924c211dd3a3a09744b846e4 @pauloricardomg pauloricardomg committed Aug 2, 2010
Showing with 634 additions and 195 deletions.
  1. +24 −0 service-api/java/source/src/org/nimbustools/api/_repr/_AsyncCreateRequest.java
  2. +5 −7 service-api/java/source/src/org/nimbustools/api/_repr/{_SpotRequest.java → _RequestInfo.java}
  3. +4 −6 service-api/java/source/src/org/nimbustools/api/_repr/{_RequestSI.java → _SpotCreateRequest.java}
  4. +25 −0 service-api/java/source/src/org/nimbustools/api/_repr/_SpotRequestInfo.java
  5. +2 −2 service-api/java/source/src/org/nimbustools/api/_repr/si/_SIRequestState.java
  6. +77 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultAsyncCreateRequest.java
  7. +11 −1 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultReprFactory.java
  8. +19 −48 .../source/src/org/nimbustools/api/defaults/repr/{DefaultSpotRequest.java → DefaultRequestInfo.java}
  9. +8 −18 ...rce/src/org/nimbustools/api/defaults/repr/{DefaultRequestSI.java → DefaultSpotCreateRequest.java}
  10. +97 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultSpotRequestInfo.java
  11. +56 −8 service-api/java/source/src/org/nimbustools/api/defaults/services/rm/DefaultManager.java
  12. +23 −0 service-api/java/source/src/org/nimbustools/api/repr/AsyncCreateRequest.java
  13. +9 −3 service-api/java/source/src/org/nimbustools/api/repr/ReprFactory.java
  14. +24 −0 service-api/java/source/src/org/nimbustools/api/repr/RequestInfo.java
  15. +1 −2 service-api/java/source/src/org/nimbustools/api/repr/{RequestSI.java → SpotCreateRequest.java}
  16. +2 −21 service-api/java/source/src/org/nimbustools/api/repr/{SpotRequest.java → SpotRequestInfo.java}
  17. +1 −1 service-api/java/source/src/org/nimbustools/api/repr/si/{SIRequestState.java → RequestState.java}
  18. +36 −8 service-api/java/source/src/org/nimbustools/api/services/rm/Manager.java
  19. +25 −5 service/service/java/source/etc/workspace-service/other/main.repr.xml
  20. +1 −1 service/service/java/source/etc/workspace-service/other/resource-locator-ACTIVE.xml
  21. +1 −1 service/service/java/source/etc/workspace-service/other/resource-locator-default.xml
  22. +3 −3 service/service/java/source/src/org/globus/workspace/creation/CreationManager.java
  23. +20 −10 service/service/java/source/src/org/globus/workspace/creation/defaults/CreationManagerImpl.java
  24. +110 −25 service/service/java/source/src/org/globus/workspace/manager/DelegatingManager.java
  25. +50 −25 service/service/java/source/src/org/globus/workspace/persistence/DataConvert.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.AsyncCreateRequest;
+
+public interface _AsyncCreateRequest extends AsyncCreateRequest, _CreateRequest {
+
+ public void setInstanceType(String instanceType);
+}
@@ -19,17 +19,15 @@
import java.util.Calendar;
import org.nimbustools.api.repr.Caller;
-import org.nimbustools.api.repr.SpotRequest;
-import org.nimbustools.api.repr.si.SIRequestState;
+import org.nimbustools.api.repr.RequestInfo;
+import org.nimbustools.api.repr.si.RequestState;
import org.nimbustools.api.repr.vm.ResourceAllocation;
import org.nimbustools.api.repr.vm.VMFile;
-public interface _SpotRequest extends SpotRequest {
+public interface _RequestInfo extends RequestInfo {
- public void setRequestID(String requestId);
- public void setSpotPrice(Double spotPrice);
- public void setPersistent(boolean persistent);
- public void setState(SIRequestState state);
+ public void setRequestID(String requestId);
+ public void setState(RequestState state);
public void setCreationTime(Calendar date);
public void setVMIds(String[] ids);
public void setInstanceCount(Integer instanceCount);
@@ -16,13 +16,11 @@
package org.nimbustools.api._repr;
-import org.nimbustools.api.repr.RequestSI;
+import org.nimbustools.api.repr.SpotCreateRequest;
-public interface _RequestSI extends RequestSI, _CreateRequest {
+public interface _SpotCreateRequest extends SpotCreateRequest, _AsyncCreateRequest {
- public void setInstanceType(String instanceType);
-
- public void setSpotPrice(Double spotPrice);
-
+ public void setSpotPrice(Double spotPrice);
public void setPersistent(boolean persistent);
+
}
@@ -0,0 +1,25 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.SpotRequestInfo;
+
+public interface _SpotRequestInfo extends _RequestInfo, SpotRequestInfo {
+
+ public void setSpotPrice(Double spotPrice);
+ public void setPersistent(boolean persistent);
+}
@@ -16,9 +16,9 @@
package org.nimbustools.api._repr.si;
-import org.nimbustools.api.repr.si.SIRequestState;
+import org.nimbustools.api.repr.si.RequestState;
-public interface _SIRequestState extends SIRequestState {
+public interface _SIRequestState extends RequestState {
public void setState(String state);
public void setProblem(Throwable e);
@@ -0,0 +1,77 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import java.util.Arrays;
+
+import org.nimbustools.api._repr._AsyncCreateRequest;
+
+public class DefaultAsyncCreateRequest extends DefaultCreateRequest implements _AsyncCreateRequest {
+
+ // -------------------------------------------------------------------------
+ // INSTANCE VARIABLES
+ // -------------------------------------------------------------------------
+
+ protected String instanceType;
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api.repr.AsyncCreateRequest
+ // -------------------------------------------------------------------------
+
+ public String getInstanceType() {
+ return this.instanceType;
+ }
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api._repr._AsyncCreateRequest
+ // -------------------------------------------------------------------------
+
+ public void setInstanceType(String instanceType) {
+ this.instanceType = instanceType;
+ }
+
+ // -------------------------------------------------------------------------
+ // DEBUG STRING
+ // -------------------------------------------------------------------------
+
+ public String toString() {
+ final boolean userDataPresent = this.mdUserData != null;
+ final String prefix = "\n\n{{{ ";
+ return "\nDefaultCreateSpotRequest" +
+ prefix + "name='" + this.name + '\'' +
+ prefix + "vmFiles=" +
+ (this.vmFiles == null ? null : Arrays.asList(this.vmFiles)) +
+ prefix + "nics=" +
+ (this.nics == null ? null : Arrays.asList(this.nics)) +
+ prefix + "schedule=" + this.schedule +
+ prefix + "coscheduleID='" + this.coscheduleID + "'" +
+ prefix + "coscheduleDone=" + this.coscheduleDone +
+ prefix + "coscheduleMember=" + this.coscheduleMember +
+ prefix + "ra=" + this.ra +
+ prefix + "requiredVMM=" + this.requiredVMM +
+ prefix + "kernel=" + this.kernel +
+ prefix + "custRequests=" +
+ (this.custRequests == null ? null : Arrays.asList(this.custRequests)) +
+ prefix + "shutdownType='" + this.shutdownType + "'" +
+ prefix + "userDataPresent? " + userDataPresent +
+ prefix + "initialStateRequest='" + this.initialStateRequest + "'" +
+ prefix + "sshKeyName='" + this.sshKeyName + "'" +
+ prefix + "context=" + this.context + "'" +
+ prefix + "instanceType=" + this.instanceType + "\n";
+
+ }
+
+}
@@ -17,11 +17,16 @@
package org.nimbustools.api.defaults.repr;
import org.nimbustools.api._repr._Advertised;
+import org.nimbustools.api._repr._AsyncCreateRequest;
import org.nimbustools.api._repr._Caller;
import org.nimbustools.api._repr._CreateRequest;
import org.nimbustools.api._repr._CreateResult;
import org.nimbustools.api._repr._CustomizationRequest;
+import org.nimbustools.api._repr._RequestInfo;
import org.nimbustools.api._repr._ShutdownTasks;
+import org.nimbustools.api._repr._SpotCreateRequest;
+import org.nimbustools.api._repr._SpotPriceEntry;
+import org.nimbustools.api._repr._SpotRequestInfo;
import org.nimbustools.api._repr._Usage;
import org.nimbustools.api._repr.ctx._Context;
import org.nimbustools.api._repr.vm._Kernel;
@@ -58,7 +63,12 @@ public String report() {
public abstract _CustomizationRequest _newCustomizationRequest();
public abstract _ShutdownTasks _newShutdownTasks();
public abstract _Usage _newUsage();
-
+ public abstract _RequestInfo _newRequestInfo();
+ public abstract _SpotRequestInfo _newSpotRequestInfo();
+ public abstract _SpotPriceEntry _newSpotPriceEntry();
+ public abstract _AsyncCreateRequest _newBackfillRequest();
+ public abstract _SpotCreateRequest _newSpotCreateRequest();
+
// vm package
public abstract _Kernel _newKernel();
public abstract _NIC _newNIC();
@@ -19,31 +19,29 @@
import java.util.Arrays;
import java.util.Calendar;
-import org.nimbustools.api._repr._SpotRequest;
+import org.nimbustools.api._repr._RequestInfo;
import org.nimbustools.api.repr.Caller;
-import org.nimbustools.api.repr.si.SIRequestState;
+import org.nimbustools.api.repr.si.RequestState;
import org.nimbustools.api.repr.vm.ResourceAllocation;
import org.nimbustools.api.repr.vm.VMFile;
-public class DefaultSpotRequest implements _SpotRequest {
+public class DefaultRequestInfo implements _RequestInfo {
// -------------------------------------------------------------------------
// INSTANCE VARIABLES
// -------------------------------------------------------------------------
- private String requestId;
- private String groupid;
- private Calendar creationTime;
- private boolean persistent;
- private VMFile[] vmFiles;
- private ResourceAllocation resourceAllocation;
- private SIRequestState state;
- private Caller creator;
- private String mdUserData;
- private String sshKeyName;
- private Double spotPrice;
- private String[] vmIds;
- private Integer instanceCount;
+ protected String requestId;
+ protected String groupid;
+ protected Calendar creationTime;
+ protected VMFile[] vmFiles;
+ protected ResourceAllocation resourceAllocation;
+ protected RequestState state;
+ protected Caller creator;
+ protected String mdUserData;
+ protected String sshKeyName;
+ protected String[] vmIds;
+ protected Integer instanceCount;
// -------------------------------------------------------------------------
// implements org.nimbustools.api.repr.RequestSIResult
@@ -65,10 +63,6 @@ public Calendar getCreationTime() {
return creationTime;
}
- public boolean isPersistent() {
- return persistent;
- }
-
public VMFile[] getVMFiles() {
return vmFiles;
}
@@ -77,7 +71,7 @@ public ResourceAllocation getResourceAllocation() {
return resourceAllocation;
}
- public SIRequestState getState() {
+ public RequestState getState() {
return state;
}
@@ -105,11 +99,6 @@ public String getSshKeyName() {
return sshKeyName;
}
-
- public Double getSpotPrice() {
- return spotPrice;
- }
-
public String[] getVMIds() {
return this.vmIds;
}
@@ -122,10 +111,6 @@ public void setInstanceCount(Integer instanceCount) {
this.instanceCount = instanceCount;
}
- public void setPersistent(boolean persistent) {
- this.persistent = persistent;
- }
-
public void setVMFiles(VMFile[] vmFiles) {
this.vmFiles = vmFiles;
}
@@ -134,7 +119,7 @@ public void setResourceAllocation(ResourceAllocation resourceAllocation) {
this.resourceAllocation = resourceAllocation;
}
- public void setState(SIRequestState state) {
+ public void setState(RequestState state) {
this.state = state;
}
@@ -150,10 +135,6 @@ public void setSshKeyName(String sshKeyName) {
this.sshKeyName = sshKeyName;
}
- public void setSpotPrice(Double spotPrice) {
- this.spotPrice = spotPrice;
- }
-
public void setVMIds(String[] ids) {
this.vmIds = ids;
}
@@ -168,16 +149,13 @@ public int hashCode() {
result = prime * result + ((groupid == null) ? 0 : groupid.hashCode());
result = prime * result
+ ((mdUserData == null) ? 0 : mdUserData.hashCode());
- result = prime * result + (persistent ? 1231 : 1237);
result = prime * result
+ ((requestId == null) ? 0 : requestId.hashCode());
result = prime
* result
+ ((resourceAllocation == null) ? 0 : resourceAllocation
.hashCode());
result = prime * result
- + ((spotPrice == null) ? 0 : spotPrice.hashCode());
- result = prime * result
+ ((sshKeyName == null) ? 0 : sshKeyName.hashCode());
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + Arrays.hashCode(vmFiles);
@@ -192,7 +170,7 @@ public boolean equals(Object obj) {
return false;
if (getClass() != obj.getClass())
return false;
- DefaultSpotRequest other = (DefaultSpotRequest) obj;
+ DefaultRequestInfo other = (DefaultRequestInfo) obj;
if (creationTime == null) {
if (other.creationTime != null)
return false;
@@ -213,8 +191,6 @@ public boolean equals(Object obj) {
return false;
} else if (!mdUserData.equals(other.mdUserData))
return false;
- if (persistent != other.persistent)
- return false;
if (requestId == null) {
if (other.requestId != null)
return false;
@@ -225,11 +201,6 @@ public boolean equals(Object obj) {
return false;
} else if (!resourceAllocation.equals(other.resourceAllocation))
return false;
- if (spotPrice == null) {
- if (other.spotPrice != null)
- return false;
- } else if (!spotPrice.equals(other.spotPrice))
- return false;
if (sshKeyName == null) {
if (other.sshKeyName != null)
return false;
@@ -249,9 +220,9 @@ public boolean equals(Object obj) {
public String toString() {
return "DefaultSpotRequest [creationTime=" + creationTime
+ ", creator=" + creator + ", groupid=" + groupid
- + ", mdUserData=" + mdUserData + ", persistent=" + persistent
+ + ", mdUserData=" + mdUserData
+ ", requestId=" + requestId + ", resourceAllocation="
- + resourceAllocation + ", spotPrice=" + spotPrice
+ + resourceAllocation
+ ", sshKeyName=" + sshKeyName + ", state=" + state
+ ", vmFiles=" + Arrays.toString(vmFiles) + "]";
}
Oops, something went wrong.

0 comments on commit 7b5cbfd

Please sign in to comment.