You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2015/06/13 02:39:45 UTC
airavata git commit: Fixed compilation issue of AiravataServerHandler
and comment out Airavata Experiment updater.
Repository: airavata
Updated Branches:
refs/heads/master 51fa27b80 -> 78732920e
Fixed compilation issue of AiravataServerHandler and comment out Airavata Experiment updater.
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/78732920
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/78732920
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/78732920
Branch: refs/heads/master
Commit: 78732920e6ce559cc03e4fca626d682e2c8e48b7
Parents: 51fa27b
Author: Shameera Rathanyaka <sh...@gmail.com>
Authored: Fri Jun 12 20:39:42 2015 -0400
Committer: Shameera Rathanyaka <sh...@gmail.com>
Committed: Fri Jun 12 20:39:42 2015 -0400
----------------------------------------------------------------------
.../server/handler/AiravataServerHandler.java | 39 +++++++++++---------
.../AiravataExperimentStatusUpdator.java | 4 +-
.../airavata/common/utils/ServerSettings.java | 15 +++++++-
.../registry/cpi/ApplicationInterface.java | 4 +-
4 files changed, 39 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/78732920/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 0361423..eab0ada 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -65,6 +65,7 @@ import org.apache.airavata.model.experiment.ExperimentModel;
import org.apache.airavata.model.experiment.ExperimentSearchFields;
import org.apache.airavata.model.experiment.ExperimentStatistics;
import org.apache.airavata.model.experiment.ExperimentSummaryModel;
+import org.apache.airavata.model.experiment.UserConfigurationDataModel;
import org.apache.airavata.model.job.JobModel;
import org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent;
import org.apache.airavata.model.messaging.event.MessageType;
@@ -1355,7 +1356,7 @@ public class AiravataServerHandler implements Airavata.Iface {
if (experimentStatus != null){
ExperimentState experimentState = experimentStatus.getState();
switch (experimentState){
- case CREATED: case VALIDATED:case UNKNOWN:
+ case CREATED: case VALIDATED:
experimentCatalog.update(ExperimentCatalogModelType.EXPERIMENT, experiment, airavataExperimentId);
logger.info(airavataExperimentId, "Successfully updated experiment {} ", experiment.getExperimentName());
break;
@@ -1381,7 +1382,7 @@ public class AiravataServerHandler implements Airavata.Iface {
}
@Override
- public void updateExperimentConfiguration(String airavataExperimentId, UserConfigurationData userConfiguration) throws TException {
+ public void updateExperimentConfiguration(String airavataExperimentId, UserConfigurationDataModel userConfiguration) throws TException {
try {
experimentCatalog = RegistryFactory.getDefaultExpCatalog();
if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
@@ -1390,9 +1391,9 @@ public class AiravataServerHandler implements Airavata.Iface {
}
ExperimentStatus experimentStatus = getExperimentStatus(airavataExperimentId);
if (experimentStatus != null){
- ExperimentState experimentState = experimentStatus.getExperimentState();
+ ExperimentState experimentState = experimentStatus.getState();
switch (experimentState){
- case CREATED: case VALIDATED: case CANCELED: case FAILED: case UNKNOWN:
+ case CREATED: case VALIDATED: case CANCELED: case FAILED:
experimentCatalog.add(ExpCatChildDataType.EXPERIMENT_CONFIGURATION_DATA, userConfiguration, airavataExperimentId);
logger.info(airavataExperimentId, "Successfully updated experiment configuration for experiment {}.", airavataExperimentId);
break;
@@ -1432,7 +1433,7 @@ public class AiravataServerHandler implements Airavata.Iface {
if (experimentStatus != null){
ExperimentState experimentState = experimentStatus.getState();
switch (experimentState){
- case CREATED: case VALIDATED: case CANCELED: case FAILED: case UNKNOWN:
+ case CREATED: case VALIDATED: case CANCELED: case FAILED:
experimentCatalog.add(ExpCatChildDataType.COMPUTATIONAL_RESOURCE_SCHEDULING, resourceScheduling, airavataExperimentId);
logger.info(airavataExperimentId, "Successfully updated resource scheduling for the experiment {}.", airavataExperimentId);
break;
@@ -1575,7 +1576,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public Map<String, JobStatus> getJobStatuses(String airavataExperimentId) throws TException {
Map<String, JobStatus> jobStatus = new HashMap<String, JobStatus>();
- try {
+ // FIXME : implement this method with new data model
+/* try {
experimentCatalog = RegistryFactory.getDefaultExpCatalog();
if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
logger.error(airavataExperimentId, "Error while retrieving job status, the experiment {} doesn't exist.", airavataExperimentId);
@@ -1606,14 +1608,15 @@ public class AiravataServerHandler implements Airavata.Iface {
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage("Error while retrieving the job statuses. More info : " + e.getMessage());
throw exception;
- }
+ }*/
return jobStatus;
}
@Override
public List<JobModel> getJobDetails(String airavataExperimentId) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
List<JobModel> jobDetailsList = new ArrayList<JobModel>();
- try {
+ // FIXME : fix this method with new data model.
+ /* try {
experimentCatalog = RegistryFactory.getDefaultExpCatalog();
if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
logger.error(airavataExperimentId, "Error while retrieving job details, experiment {} doesn't exist.", airavataExperimentId);
@@ -1643,7 +1646,7 @@ public class AiravataServerHandler implements Airavata.Iface {
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage("Error while retrieving the job details. More info : " + e.getMessage());
throw exception;
- }
+ }*/
return jobDetailsList;
}
@@ -1709,15 +1712,15 @@ public class AiravataServerHandler implements Airavata.Iface {
}
- private OrchestratorService.Client getOrchestratorClient() throws TException{
- final int serverPort = Integer.parseInt(ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ORCHESTRATOR_SERVER_PORT,"8940"));
- final String serverHost = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ORCHESTRATOR_SERVER_HOST, null);
- try {
- return OrchestratorClientFactory.createOrchestratorClient(serverHost, serverPort);
- } catch (AiravataClientConnectException e) {
- throw new TException(e);
- }
- }
+ private OrchestratorService.Client getOrchestratorClient() throws TException {
+ try {
+ final String serverHost = ServerSettings.getOrchestratorServerHost();
+ final int serverPort = ServerSettings.getOrchestratorServerPort();
+ return OrchestratorClientFactory.createOrchestratorClient(serverHost, serverPort);
+ } catch (AiravataException e) {
+ throw new TException(e);
+ }
+ }
/**
* Clone an specified experiment with a new name. A copy of the experiment configuration is made and is persisted with new metadata.
http://git-wip-us.apache.org/repos/asf/airavata/blob/78732920/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
index 1d1f1ed..90a71d9 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
@@ -17,7 +17,8 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+*//*
+
package org.apache.airavata.api.server.listener;
import com.google.common.eventbus.Subscribe;
@@ -216,3 +217,4 @@ public class AiravataExperimentStatusUpdator implements AbstractActivityListener
}
}
}
+*/
http://git-wip-us.apache.org/repos/asf/airavata/blob/78732920/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
----------------------------------------------------------------------
diff --git a/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java b/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
index adcde31..50a9fa9 100644
--- a/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
+++ b/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
@@ -40,9 +40,9 @@ public class ServerSettings extends ApplicationSettings {
public static final String IP = "ip";
// Orchestrator Constants
public static final String ORCHESTRATOR_SERVER_HOST = "orchestrator.server.host";
-
public static final String ORCHESTRATOR_SERVER_PORT = "orchestrator.server.port";
- // Gfac constants
+ public static final String ORCHESTRATOR_SERVER_NAME = "orchestrator.server.name";
+ // Gfac constants
public static final String GFAC_SERVER_HOST = "gfac.server.host";
public static final String GFAC_SERVER_PORT = "gfac.server.port";
public static final String GFAC_SERVER_NAME = "gfac.server.name";
@@ -316,4 +316,15 @@ public class ServerSettings extends ApplicationSettings {
return DEFAULT_GFAC_THREAD_POOL_SIZE;
}
+ public static String getOrchestratorServerName() throws ApplicationSettingsException {
+ return getSetting(ORCHESTRATOR_SERVER_NAME);
+ }
+
+ public static String getOrchestratorServerHost() throws ApplicationSettingsException {
+ return getSetting(ORCHESTRATOR_SERVER_HOST);
+ }
+
+ public static int getOrchestratorServerPort() throws ApplicationSettingsException {
+ return Integer.valueOf(getSetting(ORCHESTRATOR_SERVER_PORT));
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/78732920/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ApplicationInterface.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ApplicationInterface.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ApplicationInterface.java
index 868bd37..0e0ec02 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ApplicationInterface.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ApplicationInterface.java
@@ -21,8 +21,8 @@ package org.apache.airavata.registry.cpi;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
-import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
-import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.application.io.InputDataObjectType;
+import org.apache.airavata.model.application.io.OutputDataObjectType;
import java.util.List;
import java.util.Map;