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/16 20:53:50 UTC
[1/2] airavata git commit: Clean gfac-core moduel by deleling
deprecated classes
Repository: airavata
Updated Branches:
refs/heads/master cb4b40ccb -> 922645376
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacHandlerState.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacHandlerState.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacHandlerState.java
deleted file mode 100644
index 563e2f5..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacHandlerState.java
+++ /dev/null
@@ -1,65 +0,0 @@
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.gfac.core.states;
-
-
-import org.apache.thrift.TEnum;
-
- @SuppressWarnings("all") public enum GfacHandlerState implements TEnum {
- INVOKING(0),
- INVOKED(1),
- COMPLETED(2),
- UNKNOWN(3);
-
- private final int value;
-
- private GfacHandlerState(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static GfacHandlerState findByValue(int value) {
- switch (value) {
- case 0:
- return INVOKING;
- case 1:
- return INVOKED;
- case 2:
- return COMPLETED;
- case 3:
- return UNKNOWN;
- default:
- return null;
- }
- }
- }
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/GFacConfigXmlTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/GFacConfigXmlTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/GFacConfigXmlTest.java
deleted file mode 100644
index 59f3a4f..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/GFacConfigXmlTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.job;
-
-import junit.framework.Assert;
-import org.apache.airavata.gfac.core.GFacConfiguration;
-import org.apache.airavata.gfac.core.context.ApplicationContext;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
-import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager;
-import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
-import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.SecurityProtocol;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class GFacConfigXmlTest {
- private final static Logger log = LoggerFactory.getLogger(GFacConfigXmlTest.class);
- @BeforeClass
- public void setUp() throws Exception {
- }
-
- @Test
- public void testGFacConfigWithHost(){
- Assert.assertNotNull(GFacConfiguration.getConfigFile());
- try {
- Assert.assertEquals(1, GFacConfiguration.getDaemonHandlers(GFacConfiguration.getConfigFile()).size());
- JobExecutionContext jec = new JobExecutionContext(GFacConfiguration.create(GFacConfiguration.getConfigFile(), null), "testService");
- ApplicationContext applicationContext = new ApplicationContext();
- ComputeResourceDescription computeResourceDescription = new ComputeResourceDescription();
- computeResourceDescription.setHostName("trestles.sdsc.xsede.org");
- computeResourceDescription.setResourceDescription("SDSC Trestles Cluster");
-
- ResourceJobManager resourceJobManager = new ResourceJobManager();
- resourceJobManager.setResourceJobManagerType(ResourceJobManagerType.PBS);
- resourceJobManager.setPushMonitoringEndpoint("push");
- resourceJobManager.setJobManagerBinPath("/opt/torque/bin/");
-
- SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
- sshJobSubmission.setResourceJobManager(resourceJobManager);
- sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
- sshJobSubmission.setSshPort(22);
- sshJobSubmission.setResourceJobManager(resourceJobManager);
-
- JobSubmissionInterface submissionInterface = new JobSubmissionInterface();
- submissionInterface.setJobSubmissionInterfaceId("testSubmissionId");
- submissionInterface.setJobSubmissionProtocol(JobSubmissionProtocol.SSH);
- submissionInterface.setPriorityOrder(0);
-
- computeResourceDescription.addToJobSubmissionInterfaces(submissionInterface);
-
- applicationContext.setComputeResourceDescription(computeResourceDescription);
- jec.setApplicationContext(applicationContext);
-// Scheduler.schedule(jec);
-// Assert.assertEquals(ExecutionMode.ASYNCHRONOUS, jec.getGFacConfiguration().getExecutionMode());
-// Assert.assertEquals("org.apache.airavata.job.TestProvider", jec.getProvider().getClass().getName());
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
- }
- @Test
- public void testAppSpecificConfig() {
- Assert.assertNotNull(GFacConfiguration.getConfigFile());
- try {
- Assert.assertEquals(1, GFacConfiguration.getDaemonHandlers(GFacConfiguration.getConfigFile()).size());
- JobExecutionContext jec = new JobExecutionContext(GFacConfiguration.create(GFacConfiguration.getConfigFile(), null), "UltraScan");
- ApplicationContext applicationContext = new ApplicationContext();
- ComputeResourceDescription computeResourceDescription = new ComputeResourceDescription();
- computeResourceDescription.setHostName("trestles.sdsc.xsede.org");
- computeResourceDescription.setResourceDescription("SDSC Trestles Cluster");
-
- ResourceJobManager resourceJobManager = new ResourceJobManager();
- resourceJobManager.setResourceJobManagerType(ResourceJobManagerType.PBS);
- resourceJobManager.setPushMonitoringEndpoint("push");
- resourceJobManager.setJobManagerBinPath("/opt/torque/bin/");
-
- SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
- sshJobSubmission.setResourceJobManager(resourceJobManager);
- sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
- sshJobSubmission.setSshPort(22);
- sshJobSubmission.setResourceJobManager(resourceJobManager);
-
- JobSubmissionInterface submissionInterface = new JobSubmissionInterface();
- submissionInterface.setJobSubmissionInterfaceId("testSubmissionId");
- submissionInterface.setJobSubmissionProtocol(JobSubmissionProtocol.SSH);
- submissionInterface.setPriorityOrder(0);
-
- computeResourceDescription.addToJobSubmissionInterfaces(submissionInterface);
-
- applicationContext.setComputeResourceDescription(computeResourceDescription);
- jec.setApplicationContext(applicationContext);
-// Scheduler.schedule(jec);
-// Assert.assertEquals(3, jec.getGFacConfiguration().getInHandlers().size());
-// Assert.assertEquals(1, jec.getGFacConfiguration().getInHandlers().get(0).getProperties().size());
-// Assert.assertEquals(0, jec.getGFacConfiguration().getInHandlers().get(1).getProperties().size());
-// Assert.assertEquals(1, jec.getGFacConfiguration().getInHandlers().get(2).getProperties().size());
-// Assert.assertEquals(ExecutionMode.ASYNCHRONOUS, jec.getGFacConfiguration().getExecutionMode());// todo this logic might be wrong
-// Assert.assertEquals("org.apache.airavata.job.TestProvider", jec.getProvider().getClass().getName());
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestGlobalHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestGlobalHandler.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestGlobalHandler.java
deleted file mode 100644
index 67ee9b8..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestGlobalHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.job;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.handler.AbstractHandler;
-import org.apache.airavata.gfac.core.handler.GFacHandlerException;
-
-import java.util.Properties;
-
-public class TestGlobalHandler extends AbstractHandler {
- public void initProperties(Properties properties) throws GFacHandlerException {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- @Override
- public void recover(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- // TODO: Auto generated method body.
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestInHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestInHandler.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestInHandler.java
deleted file mode 100644
index 7307ba5..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestInHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.job;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.handler.AbstractHandler;
-import org.apache.airavata.gfac.core.handler.GFacHandlerException;
-
-import java.util.Properties;
-
-public class TestInHandler extends AbstractHandler {
- public void initProperties(Properties properties) throws GFacHandlerException {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- @Override
- public void recover(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- // TODO: Auto generated method body.
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestOutHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestOutHandler.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestOutHandler.java
deleted file mode 100644
index b19d646..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestOutHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.job;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.handler.AbstractHandler;
-import org.apache.airavata.gfac.core.handler.GFacHandlerException;
-
-import java.util.Properties;
-
-public class TestOutHandler extends AbstractHandler {
- public void initProperties(Properties properties) throws GFacHandlerException {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- @Override
- public void recover(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- // TODO: Auto generated method body.
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestProvider.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestProvider.java
deleted file mode 100644
index 43ddb90..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.job;
-
-import org.apache.airavata.gfac.core.GFacException;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.provider.AbstractProvider;
-import org.apache.airavata.gfac.core.provider.GFacProviderException;
-
-import java.util.Map;
-
-public class TestProvider extends AbstractProvider {
-
- public boolean cancelJob(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
- //To change body of implemented methods use File | Settings | File Templates.
- return false;
- }
-
- @Override
- public void recover(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
- // TODO: Auto generated method body.
- }
-
- @Override
- public void monitor(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
- // TODO: Auto generated method body.
- }
-
- public void initProperties(Map<String, String> properties) throws GFacProviderException, GFacException {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void dispose(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestThreadedHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestThreadedHandler.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestThreadedHandler.java
deleted file mode 100644
index f2788c5..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/job/TestThreadedHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.job;
-
-import junit.framework.Assert;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.handler.GFacHandlerException;
-import org.apache.airavata.gfac.core.handler.ThreadedHandler;
-
-import java.util.Properties;
-
-public class TestThreadedHandler extends ThreadedHandler {
-
-
- public void initProperties(Properties properties) throws GFacHandlerException {
- }
-
- @Override
- public void recover(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- // TODO: Auto generated method body.
- }
-
- public void run() {
- System.out.println("Invoking TestThreadedHandler");
- Assert.assertTrue(true);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Core.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Core.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Core.java
deleted file mode 100644
index 5225552..0000000
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Core.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.gsi.ssh.api;
-
-import org.apache.airavata.gfac.core.JobDescriptor;
-
-/**
- * This represents a CPU core of a machine in the cluster
- */
-public class Core {
- private JobDescriptor job;
- private String id;
-
- public Core(String id) {
- this.id = id;
- this.job = null;
- }
-
- /**
- * @return core's id
- */
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * @return job running on the core
- */
- public JobDescriptor getJob() {
- return job;
- }
-
- public void setJob(JobDescriptor job) {
- this.job = job;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Node.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Node.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Node.java
deleted file mode 100644
index 4d2a1ca..0000000
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsi/ssh/api/Node.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.gsi.ssh.api;
-
-import java.util.HashMap;
-
-public class Node {
- private String Name;
- private Core[] Cores;
- private String state;
- private HashMap<String, String> status;
- private String np;
- private String ntype;
-
- /**
- * @return the machine's name
- */
- public String getName() {
- return Name;
- }
-
- public void setName(String Name) {
- this.Name = Name;
- }
-
- /**
- * @return machine cores as an array
- */
- public Core[] getCores() {
- return Cores;
- }
-
- public void setCores(Core[] Cores) {
- this.Cores = Cores;
- }
-
-
- /**
- * @return the machine state
- */
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- /**
- * @return the status
- */
- public HashMap<String, String> getStatus() {
- return status;
- }
-
- public void setStatus(HashMap<String, String> status) {
- this.setStatus(status);
- }
-
-
- /**
- * @return the number of cores in the machine
- */
- public String getNp() {
- return np;
- }
-
-
- public void setNp(String np) {
- this.np = np;
- }
-
- /**
- * @return the ntype of the machine
- */
- public String getNtype() {
- return ntype;
- }
-
-
- public void setNtype(String ntype) {
- this.ntype = ntype;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BetterGfacImpl.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BetterGfacImpl.java
index ae28f99..8efd8bc 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BetterGfacImpl.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BetterGfacImpl.java
@@ -27,9 +27,7 @@ import org.apache.airavata.registry.cpi.AppCatalogException;
import org.apache.airavata.common.utils.AiravataZKUtils;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.gfac.core.GFacConstants;
-import org.apache.airavata.gfac.core.GFacConfiguration;
import org.apache.airavata.gfac.core.GFacException;
-import org.apache.airavata.gfac.core.Scheduler;
import org.apache.airavata.gfac.core.context.ApplicationContext;
import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.gfac.core.context.MessageContext;
@@ -64,7 +62,6 @@ import org.apache.airavata.model.messaging.event.TaskStatusChangeEvent;
import org.apache.airavata.model.messaging.event.TaskStatusChangeRequestEvent;
import org.apache.airavata.model.experiment.CorrectiveAction;
import org.apache.airavata.model.experiment.ErrorCategory;
-import org.apache.airavata.model.experiment.ExperimentModel;
import org.apache.airavata.model.experiment.ExperimentState;
import org.apache.airavata.model.experiment.ExperimentStatus;
import org.apache.airavata.model.experiment.JobDetails;
[2/2] airavata git commit: Clean gfac-core moduel by deleling
deprecated classes
Posted by sh...@apache.org.
Clean gfac-core moduel by deleling deprecated classes
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/92264537
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/92264537
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/92264537
Branch: refs/heads/master
Commit: 92264537680af694a590462142d3aa371cffde24
Parents: cb4b40c
Author: Shameera Rathanyaka <sh...@gmail.com>
Authored: Tue Jun 16 14:53:42 2015 -0400
Committer: Shameera Rathanyaka <sh...@gmail.com>
Committed: Tue Jun 16 14:53:42 2015 -0400
----------------------------------------------------------------------
.../airavata/gfac/core/GFacConfiguration.java | 289 -------------------
.../airavata/gfac/core/JobSubmissionFault.java | 98 -------
.../apache/airavata/gfac/core/Scheduler.java | 230 ---------------
.../airavata/gfac/core/ToolsException.java | 35 ---
.../gfac/core/context/JobExecutionContext.java | 2 -
.../gfac/core/handler/AbstractHandler.java | 76 -----
.../core/handler/AppDescriptorCheckHandler.java | 81 ------
.../airavata/gfac/core/handler/GFacHandler.java | 60 ----
.../gfac/core/handler/GFacHandlerConfig.java | 52 ----
.../gfac/core/handler/GFacHandlerException.java | 49 ----
.../gfac/core/handler/ThreadedHandler.java | 31 --
.../airavata/gfac/core/monitor/MonitorID.java | 16 +-
.../state/GfacExperimentStateChangeRequest.java | 74 -----
.../core/monitor/state/PublisherMessage.java | 26 --
.../gfac/core/provider/AbstractProvider.java | 58 ----
.../gfac/core/provider/GFacProvider.java | 78 -----
.../gfac/core/provider/GFacProviderConfig.java | 51 ----
.../core/provider/GFacProviderException.java | 50 ----
.../gfac/core/provider/utils/DataIDType.java | 95 ------
.../gfac/core/provider/utils/ProviderUtils.java | 58 ----
.../provider/utils/ResourceRequirement.java | 34 ---
.../scheduler/impl/SimpleHostScheduler.java | 33 ---
.../gfac/core/states/GfacExperimentState.java | 89 ------
.../gfac/core/states/GfacHandlerState.java | 65 -----
.../apache/airavata/job/GFacConfigXmlTest.java | 126 --------
.../apache/airavata/job/TestGlobalHandler.java | 38 ---
.../org/apache/airavata/job/TestInHandler.java | 38 ---
.../org/apache/airavata/job/TestOutHandler.java | 38 ---
.../org/apache/airavata/job/TestProvider.java | 58 ----
.../airavata/job/TestThreadedHandler.java | 45 ---
.../apache/airavata/gfac/gsi/ssh/api/Core.java | 59 ----
.../apache/airavata/gfac/gsi/ssh/api/Node.java | 104 -------
.../airavata/gfac/impl/BetterGfacImpl.java | 3 -
33 files changed, 8 insertions(+), 2231 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacConfiguration.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacConfiguration.java
deleted file mode 100644
index 3d2a320..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacConfiguration.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.airavata.gfac.core.handler.GFacHandlerConfig;
-import org.apache.airavata.gfac.core.provider.GFacProviderConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.*;
-import org.xml.sax.SAXException;
-
-public class GFacConfiguration {
- public static final Logger log = LoggerFactory.getLogger(GFacConfiguration.class);
-
-
-// private AiravataAPI airavataAPI;
-
- private static Document handlerDoc;
- // Keep list of full qualified class names of GFac handlers which should invoked before
- // the provider
- private List<GFacHandlerConfig> inHandlers = new ArrayList<GFacHandlerConfig>();
-
- // Keep list of full qualified class names of GFac handlers which should invoked after
- // the provider
- private List<GFacHandlerConfig> outHandlers = new ArrayList<GFacHandlerConfig>();
-
- public ExecutionMode executionMode = ExecutionMode.SYNCHRONOUS; // default execution mode is SYNCHRONOUS
-
- public GFacConfiguration() {
- }
-
-// public AiravataAPI getAiravataAPI() {
-// return airavataAPI;
-// }
-
-
- public static File getConfigFile() {
- URL resource = GFacConfiguration.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- File gfacConfigFile = null;
- if (resource != null) {
- gfacConfigFile = new File(resource.getPath());
- }
- return gfacConfigFile;
- }
- public List<GFacHandlerConfig> getInHandlers() {
- //This will avoid the misconfiguration done by user in gfac-config.xml
- return removeDuplicateWithOrder(inHandlers);
- }
-
- public List<GFacHandlerConfig> getOutHandlers() {
- //This will avoid the misconfiguration done by user in gfac-config.xml
- return removeDuplicateWithOrder(outHandlers);
- }
- public void setInHandlers(List<GFacHandlerConfig> inHandlers) {
- this.inHandlers = inHandlers;
- }
-
- public void setOutHandlers(List<GFacHandlerConfig> outHandlers) {
- this.outHandlers = outHandlers;
- }
-
- public void setInHandlers(String providerName, String applicationName) {
- try {
- this.inHandlers = getHandlerConfig(handlerDoc, GFacConstants.XPATH_EXPR_GLOBAL_INFLOW_HANDLERS, GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- if (applicationName != null) {
- String xPath = GFacConstants.XPATH_EXPR_APPLICATION_HANDLERS_START + applicationName + GFacConstants.XPATH_EXPR_APPLICATION_INFLOW_HANDLERS_END;
- List<GFacHandlerConfig> handlers = getHandlerConfig(handlerDoc, xPath, GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- this.inHandlers.addAll(handlers);
- }
- if (providerName != null) {
- String xPath = GFacConstants.XPATH_EXPR_PROVIDER_HANDLERS_START + providerName + GFacConstants.XPATH_EXPR_PROVIDER_INFLOW_HANDLERS_END;
- List<GFacHandlerConfig> handlers = getHandlerConfig(handlerDoc, xPath, GFacConstants.GFAC_CONFIG_APPLICATION_NAME_ATTRIBUTE);
- this.inHandlers.addAll(handlers);
- }
- } catch (XPathExpressionException e) {
- new GFacException("Error parsing Handler Configuration", e);
- }
- }
-
- public void setOutHandlers(String providerName, String applicationName) {
- try {
- this.outHandlers = getHandlerConfig(handlerDoc, GFacConstants.XPATH_EXPR_GLOBAL_OUTFLOW_HANDLERS, GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- if (applicationName != null) {
- String xPath = GFacConstants.XPATH_EXPR_APPLICATION_HANDLERS_START + applicationName + GFacConstants.XPATH_EXPR_APPLICATION_OUTFLOW_HANDLERS_END;
- List<GFacHandlerConfig> handlers = getHandlerConfig(handlerDoc, xPath, GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- this.outHandlers.addAll(handlers);
- }
- if(providerName != null) {
- String xPath = GFacConstants.XPATH_EXPR_PROVIDER_HANDLERS_START + providerName + GFacConstants.XPATH_EXPR_PROVIDER_OUTFLOW_HANDLERS_END;
- List<GFacHandlerConfig> handlers = getHandlerConfig(handlerDoc, xPath, GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- this.outHandlers.addAll(handlers);
- }
- } catch (XPathExpressionException e) {
- new GFacException("Error parsing Handler Configuration", e);
- }
- }
-
- /**
- * Parse GFac configuration file and populate GFacConfiguration object. XML configuration
- * file for GFac will look like below.
- * <p/>
- * <GFac>
- * <GlobalHandlers>
- * <InHandlers>
- * <Handler class="org.apache.airavata.gfac.GlobalHandler1">
- * </InHandler>
- * <OutHandlers>
- * <Handler class="org.apache.airavata.gfac.GlabalHandler2">
- * </OutHandlers>
- * </GlobalHandlers>
- * <Provider class="org.apache.airavata.gfac.providers.LocalProvider" host="LocalHost">
- * <InHandlers>
- * <Handler class="org.apache.airavata.gfac.handlers.LocalEvenSetupHandler">
- * </InHandlers>
- * <OutHandlers>
- * <Handler>org.apache.airavata.LocalOutHandler1</Handler>
- * </OutHandlers>
- * </Provider>
- * <Application name="UltraScan">
- * <InHandlers>
- * <Handler class="org.apache.airavata.gfac.handlers.LocalEvenSetupHandler">
- * </InHandlers>
- * <OutHandlers>
- * <Handler class="org.apache.airavata.gfac.LocalOutHandler1">
- * </OutHandlers>
- * </Application>
- * </GFac>
- *
- * @param configFile configuration file
- * @return GFacConfiguration object.
- */
- //FIXME
- public static GFacConfiguration create(File configFile, Properties configurationProperties) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
- handlerDoc = docBuilder.parse(configFile);
- return new GFacConfiguration();
- }
-
- private static String xpathGetText(Document doc, String expression) throws XPathExpressionException {
- XPathFactory xPathFactory = XPathFactory.newInstance();
- XPath xPath = xPathFactory.newXPath();
- XPathExpression expr = xPath.compile(expression);
-
- return (String) expr.evaluate(doc, XPathConstants.STRING);
- }
-
- /**
- * Select matching node set and extract specified attribute value.
- *
- * @param doc XML document
- * @param expression expression to match node set
- * @param attribute name of the attribute to extract
- * @return list of attribute values.
- * @throws XPathExpressionException
- */
- public static List<GFacHandlerConfig> getHandlerConfig(Document doc, String expression, String attribute) throws XPathExpressionException {
- XPathFactory xPathFactory = XPathFactory.newInstance();
- XPath xPath = xPathFactory.newXPath();
- XPathExpression expr = xPath.compile(expression);
-
- NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
- List<GFacHandlerConfig> gFacHandlerConfigs = new ArrayList<GFacHandlerConfig>();
- Properties properties = new Properties();
- String className = "";
- for (int i = 0; i < nl.getLength(); i++) {
- className = ((Element) nl.item(i)).getAttribute(attribute);
- NodeList childNodes = (nl.item(i)).getChildNodes();
- for(int j = 0;j < childNodes.getLength();j++){
- if(GFacConstants.PROPERTY.equals(childNodes.item(j).getNodeName())) {
- String name = ((Element) childNodes.item(j)).getAttribute(GFacConstants.NAME);
- String value = ((Element) childNodes.item(j)).getAttribute(GFacConstants.VALUE);
- properties.put(name, value);
- }
- }
- GFacHandlerConfig gFacHandlerConfig = new GFacHandlerConfig(properties,className);
- gFacHandlerConfigs.add(gFacHandlerConfig);
- }
- return gFacHandlerConfigs;
- }
-
- public static List<GFacProviderConfig> getProviderConfig(Document doc, String expression, String attribute) throws XPathExpressionException {
- XPathFactory xPathFactory = XPathFactory.newInstance();
- XPath xPath = xPathFactory.newXPath();
- XPathExpression expr = xPath.compile(expression);
-
- NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
- List<GFacProviderConfig> gFacProviderConfigs = new ArrayList<GFacProviderConfig>();
- Map<String, String> properties = new HashMap<String, String>();
- String className = "";
- for (int i = 0; i < nl.getLength(); i++) {
- className = ((Element) nl.item(i)).getAttribute(attribute);
- if (className != null && !className.equals("")) {
- NodeList childNodes = (nl.item(i)).getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++) {
- if (GFacConstants.PROPERTY.equals(childNodes.item(j).getNodeName())) {
- String name = ((Element) childNodes.item(j)).getAttribute(GFacConstants.NAME);
- String value = ((Element) childNodes.item(j)).getAttribute(GFacConstants.VALUE);
- properties.put(name, value);
- }
- }
- GFacProviderConfig gFacProviderConfig = new GFacProviderConfig(properties,className);
- gFacProviderConfigs.add(gFacProviderConfig);
- }
- }
- return gFacProviderConfigs;
- }
-
- public static String getAttributeValue(Document doc, String expression, String attribute) throws XPathExpressionException {
- XPathFactory xPathFactory = XPathFactory.newInstance();
- XPath xPath = xPathFactory.newXPath();
- XPathExpression expr = xPath.compile(expression);
-
- NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
- String className = null;
- for (int i = 0; i < nl.getLength(); i++) {
- className = ((Element) nl.item(i)).getAttribute(attribute);
- break;
- }
- return className;
- }
-
- public static GFacConfiguration create(Properties configProps) {
- return null;
- }
-
- private static List removeDuplicateWithOrder(List arlList) {
- Set set = new HashSet();
- List newList = new ArrayList();
- for (Iterator iter = arlList.iterator(); iter.hasNext(); ) {
- Object element = iter.next();
- if (set.add(element))
- newList.add(element);
- }
- arlList.clear();
- arlList.addAll(newList);
- return arlList;
- }
- public static List<GFacHandlerConfig> getDaemonHandlers(File configFile)throws ParserConfigurationException, IOException, SAXException, XPathExpressionException{
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
- handlerDoc = docBuilder.parse(configFile);
- return getHandlerConfig(handlerDoc, GFacConstants.XPATH_EXPR_DAEMON_HANDLERS, GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- }
- public static Document getHandlerDoc() {
- return handlerDoc;
- }
-
- public ExecutionMode getExecutionMode() {
- return executionMode;
- }
-
- public void setExecutionMode(ExecutionMode executionMode) {
- this.executionMode = executionMode;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobSubmissionFault.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobSubmissionFault.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobSubmissionFault.java
deleted file mode 100644
index 01784cd..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobSubmissionFault.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.provider.GFacProviderException;
-
-// TODO review this class - Not sure some of the attributes are actually
-// needed
-public class JobSubmissionFault extends GFacProviderException {
-
- // TODO why we need following ?
- //public static final String JOB_CANCEL = "JOB_CANCEL";
-
- //public static final String JOB_FAILED = "JOB_FAILED";
-
- private String reason;
- private String contact;
- private int gramErrorCode;
- private String rsl;
- private String host;
-
- public JobSubmissionFault(Throwable cause, String submitHost, String contact, String rsl,
- JobExecutionContext jobExecutionContext, String reason, int errorCode) {
- super(cause.getMessage(), cause);
-
- this.host = submitHost;
- this.contact = contact;
- this.rsl = rsl;
- this.reason = reason;
- this.gramErrorCode = errorCode;
- }
-
- public void setReason(String reason) {
- this.reason = reason;
- }
-
- // TODO why we need this ?
- public void sendFaultNotification(String message,
- JobExecutionContext jobExecutionContext, Exception e,
- String... additionalExceptiondata) {
-
- }
-
- public String getReason() {
- return reason;
- }
-
- public String getContact() {
- return contact;
- }
-
- public void setContact(String contact) {
- this.contact = contact;
- }
-
- public int getGramErrorCode() {
- return gramErrorCode;
- }
-
- public void setGramErrorCode(int gramErrorCode) {
- this.gramErrorCode = gramErrorCode;
- }
-
- public String getRsl() {
- return rsl;
- }
-
- public void setRsl(String rsl) {
- this.rsl = rsl;
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Scheduler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Scheduler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Scheduler.java
deleted file mode 100644
index 606c385..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Scheduler.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core;
-
-import org.apache.airavata.registry.cpi.AppCatalog;
-import org.apache.airavata.registry.cpi.AppCatalogException;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.provider.GFacProvider;
-import org.apache.airavata.gfac.core.provider.GFacProviderConfig;
-import org.apache.airavata.gfac.core.provider.GFacProviderException;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
-import org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathExpressionException;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-
-
-/**
- * Scheduler decides the execution order of handlers based on application description. In addition
- * to that scheduler decides which provider to invoke at the end. Scheduler will set
- * provider instance and in/out handler chains in JobExecutionContext.
- */
-public class Scheduler {
- private static Logger log = LoggerFactory.getLogger(Scheduler.class);
-
- /**
- * Decide which provider to use and execution sequence of handlers based on job request and
- * job configuration.
- * @param jobExecutionContext containing job request as well as all the configurations.
- */
- public static void schedule(JobExecutionContext jobExecutionContext) throws GFacException{
- // Current implementation only support static handler sequence.
- jobExecutionContext.setProvider(getProvider(jobExecutionContext));
- // TODO: Selecting the provider based on application description.
- jobExecutionContext.getGFacConfiguration().setInHandlers(jobExecutionContext.getProvider().getClass().getName(),
- jobExecutionContext.getApplicationName());
- jobExecutionContext.getGFacConfiguration().setOutHandlers(jobExecutionContext.getProvider().getClass().getName(),
- jobExecutionContext.getApplicationName());
- jobExecutionContext.getGFacConfiguration().setExecutionMode(getExecutionMode(jobExecutionContext));
- }
-
- /**
- * Figure out which provider to use based on application configuration.
- * @param jobExecutionContext containing all the required configurations.
- * @return GFacProvider instance.
- */
- private static GFacProvider getProvider(JobExecutionContext jobExecutionContext) throws GFacException {
- String applicationName = jobExecutionContext.getApplicationName();
-
- URL resource = Scheduler.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = null;
- Document handlerDoc = null;
- try {
- docBuilder = docBuilderFactory.newDocumentBuilder();
- handlerDoc = docBuilder.parse(new File(resource.getPath()));
- } catch (ParserConfigurationException e) {
- throw new GFacException(e);
- } catch (SAXException e) {
- throw new GFacException(e);
- } catch (IOException e) {
- throw new GFacException(e);
- }
- GFacProviderConfig s = null;
- GFacProvider provider = null;
- List<GFacProviderConfig> aClass = null;
- String providerClassName = null;
- try {
- aClass = GFacConfiguration.getProviderConfig(handlerDoc,
- GFacConstants.XPATH_EXPR_APPLICATION_HANDLERS_START + applicationName + "']", GFacConstants.GFAC_CONFIG_APPLICATION_NAME_ATTRIBUTE);
- // This should be have a single element only.
- if (aClass != null && !aClass.isEmpty()) {
- s = aClass.get(0);
- Class<? extends GFacProvider> aClass1 = Class.forName(s.getClassName()).asSubclass(GFacProvider.class);
- provider = aClass1.newInstance();
- //loading the provider properties
- if(!aClass.isEmpty()){
- provider.initProperties(aClass.get(0).getProperties());
- }
- }
- // We give higher preference to applications specific provider if configured
- if (provider == null) {
-
- List<JobSubmissionInterface> jobSubmissionInterfaces = jobExecutionContext.getApplicationContext().getComputeResourceDescription().getJobSubmissionInterfaces();
- JobSubmissionProtocol jobSubmissionProtocol = jobExecutionContext.getPreferredJobSubmissionProtocol();
- SSHJobSubmission sshJobSubmission;
- LOCALSubmission localSubmission;
- UnicoreJobSubmission unicoreSubmission;
- String securityProtocol = null;
- try {
- AppCatalog appCatalog = jobExecutionContext.getAppCatalog();
- if (jobSubmissionProtocol == JobSubmissionProtocol.SSH) {
- sshJobSubmission = appCatalog.getComputeResource().getSSHJobSubmission(
- jobExecutionContext.getPreferredJobSubmissionInterface().getJobSubmissionInterfaceId());
- if (sshJobSubmission != null) {
- securityProtocol = sshJobSubmission.getSecurityProtocol().toString();
- }
- }else if (jobSubmissionProtocol == JobSubmissionProtocol.LOCAL) {
- localSubmission = appCatalog.getComputeResource().getLocalJobSubmission(jobExecutionContext.getPreferredJobSubmissionInterface().getJobSubmissionInterfaceId());
- }
- else if (jobSubmissionProtocol == JobSubmissionProtocol.UNICORE) {
- unicoreSubmission = appCatalog.getComputeResource().getUNICOREJobSubmission(jobExecutionContext.getPreferredJobSubmissionInterface().getJobSubmissionInterfaceId());
- securityProtocol = unicoreSubmission.getSecurityProtocol().toString();
- }
- List<Element> elements = GFacUtils.getElementList(GFacConfiguration.getHandlerDoc(), GFacConstants.XPATH_EXPR_PROVIDER_ON_SUBMISSION + jobSubmissionProtocol + "']");
- for (Element element : elements) {
- String security = element.getAttribute(GFacConstants.GFAC_CONFIG_SECURITY_ATTRIBUTE);
- if (security.equals("")) {
- providerClassName = element.getAttribute(GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- }else if (securityProtocol != null && securityProtocol.equals(security)) {
- providerClassName = element.getAttribute(GFacConstants.GFAC_CONFIG_CLASS_ATTRIBUTE);
- }
- }
- if (providerClassName == null) {
- throw new GFacException("Couldn't find provider class");
- }
-
- Class<? extends GFacProvider> aClass1 = Class.forName(providerClassName).asSubclass(GFacProvider.class);
- provider = aClass1.newInstance();
- //loading the provider properties
- aClass = GFacConfiguration.getProviderConfig(GFacConfiguration.getHandlerDoc(), GFacConstants.XPATH_EXPR_PROVIDER_HANDLERS_START +
- providerClassName + "']", GFacConstants.GFAC_CONFIG_APPLICATION_NAME_ATTRIBUTE);
- if (!aClass.isEmpty()) {
- provider.initProperties(aClass.get(0).getProperties());
- }
- } catch (AppCatalogException e) {
- throw new GFacException("Couldn't retrieve job submission protocol from app catalog ");
- }
- }
- } catch (XPathExpressionException e) {
- log.error("Error evaluating XPath expression"); //To change body of catch statement use File | Settings | File Templates.
- throw new GFacException("Error evaluating XPath expression", e);
- } catch (GFacProviderException e) {
- log.error("Error During scheduling"); //To change body of catch statement use File | Settings | File Templates.
- throw new GFacException("Error During scheduling", e);
- }catch (ClassNotFoundException e) {
- log.error("Application Provider class: " + s + "couldn't find");
- throw new GFacException("Error initializing application specific Handler: " +providerClassName , e);
- } catch (InstantiationException e) {
- log.error("Error initializing application specific Handler: " + providerClassName);
- throw new GFacException("Error initializing Handler", e);
- } catch (IllegalAccessException e) {
- log.error("Error initializing application specific Handler: " + providerClassName);
- throw new GFacException("Error initializing Handler", e);
- }
- return provider;
- }
- public static ExecutionMode getExecutionMode(JobExecutionContext jobExecutionContext)throws GFacException{
- String applicationName = jobExecutionContext.getApplicationContext().getApplicationInterfaceDescription().getApplicationName();
- URL resource = Scheduler.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = null;
- Document handlerDoc = null;
- String jobSubmissionProtocol = jobExecutionContext.getPreferredJobSubmissionProtocol().toString();
- try {
- docBuilder = docBuilderFactory.newDocumentBuilder();
- handlerDoc = docBuilder.parse(new File(resource.getPath()));
- } catch (ParserConfigurationException e) {
- throw new GFacException(e);
- } catch (SAXException e) {
- throw new GFacException(e);
- } catch (IOException e) {
- throw new GFacException(e);
- }
- GFacProviderConfig s = null;
- String executionMode = "sync";
- try {
- executionMode = GFacConfiguration.getAttributeValue(handlerDoc,
- GFacConstants.XPATH_EXPR_APPLICATION_HANDLERS_START + applicationName + "']", GFacConstants.GFAC_CONFIG_EXECUTION_MODE_ATTRIBUTE);
- // This should be have a single element only.
-
- if (executionMode == null || "".equals(executionMode)) {
- String hostClass = jobExecutionContext.getPreferredJobSubmissionProtocol().toString();
- executionMode = GFacConfiguration.getAttributeValue(GFacConfiguration.getHandlerDoc(), GFacConstants.XPATH_EXPR_PROVIDER_ON_HOST + hostClass + "']", GFacConstants.GFAC_CONFIG_EXECUTION_MODE_ATTRIBUTE);
- }
-
- if (executionMode == null || "".equals(executionMode)) {
- List<Element> elements = GFacUtils.getElementList(GFacConfiguration.getHandlerDoc(), GFacConstants.XPATH_EXPR_PROVIDER_ON_SUBMISSION + jobSubmissionProtocol + "']");
- for (Element element : elements) {
- executionMode = element.getAttribute(GFacConstants.GFAC_CONFIG_EXECUTION_MODE_ATTRIBUTE);
- }
- }
-
- } catch (XPathExpressionException e) {
- log.error("Error evaluating XPath expression"); //To change body of catch statement use File | Settings | File Templates.
- throw new GFacException("Error evaluating XPath expression", e);
- }
-
- return ExecutionMode.fromString(executionMode);
- }
-
-// private static HostDescription scheduleHost(List<HostDescription> registeredHosts) {
-// //todo implement an algorithm to pick a host among different hosts, ideally this could be configurable in an xml
-// return registeredHosts.get(0);
-// }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/ToolsException.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/ToolsException.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/ToolsException.java
deleted file mode 100644
index 3a8d90f..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/ToolsException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core;
-
-
-/**
- * Exception for all utilities
- */
-public class ToolsException extends GFacException {
-
- public ToolsException(String message){
- super(message,new Throwable(message));
- }
- public ToolsException(String message, Throwable cause) {
- super(message, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
index 22e1483..6c993e2 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
@@ -31,13 +31,11 @@ import org.apache.airavata.common.utils.LocalEventPublisher;
import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
import org.apache.airavata.registry.cpi.AppCatalog;
import org.apache.airavata.registry.cpi.AppCatalogException;
-import org.apache.airavata.gfac.core.GFacConfiguration;
import org.apache.airavata.gfac.core.GFacException;
import org.apache.airavata.gfac.core.SecurityContext;
import org.apache.airavata.gfac.core.GFac;
import org.apache.airavata.gfac.core.provider.GFacProvider;
import org.apache.airavata.model.appcatalog.computeresource.*;
-import org.apache.airavata.model.experiment.ExperimentModel;
import org.apache.airavata.model.experiment.JobDetails;
import org.apache.airavata.model.experiment.TaskDetails;
import org.apache.airavata.model.experiment.WorkflowNodeDetails;
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractHandler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractHandler.java
deleted file mode 100644
index 6a28986..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.handler;
-
-import org.apache.airavata.common.utils.LocalEventPublisher;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.states.GfacHandlerState;
-import org.apache.airavata.gfac.core.GFacUtils;
-import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
-import org.apache.airavata.model.messaging.event.TaskIdentifier;
-import org.apache.airavata.model.messaging.event.TaskOutputChangeEvent;
-import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.ExperimentCatalog;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-public abstract class AbstractHandler implements GFacHandler {
- private static final Logger logger = LoggerFactory.getLogger(AbstractHandler.class);
- protected ExperimentCatalog experimentCatalog = null;
-
- protected LocalEventPublisher publisher = null;
-
- public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- try {
- publisher = jobExecutionContext.getLocalEventPublisher();
- GFacUtils.updateHandlerState(jobExecutionContext.getCuratorClient(), jobExecutionContext, this.getClass().getName(), GfacHandlerState.INVOKED);
- } catch (Exception e) {
- logger.error("Error saving Recoverable provider state", e);
- }
- experimentCatalog = jobExecutionContext.getExperimentCatalog();
- if(experimentCatalog == null){
- try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- } catch (RegistryException e) {
- throw new GFacHandlerException("unable to create registry instance", e);
- }
- }
- }
-
- public ExperimentCatalog getExperimentCatalog() {
- return experimentCatalog;
- }
-
- public void setExperimentCatalog(ExperimentCatalog experimentCatalog) {
- this.experimentCatalog = experimentCatalog;
- }
-
- protected void fireTaskOutputChangeEvent(JobExecutionContext jobExecutionContext, List<OutputDataObjectType> outputArray) {
- TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
- jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
- jobExecutionContext.getExperimentID(),
- jobExecutionContext.getGatewayID());
- publisher.publish(new TaskOutputChangeEvent(outputArray, taskIdentity));
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
deleted file mode 100644
index 3685bb8..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.handler;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.states.GfacHandlerState;
-import org.apache.airavata.gfac.core.GFacUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Properties;
-
-public class AppDescriptorCheckHandler implements GFacHandler {
- private static final Logger logger = LoggerFactory.getLogger(AppDescriptorCheckHandler.class);
-
- public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- logger.info("Invoking ApplicationDescriptorCheckHandler ...");
- try {
- GFacUtils.updateHandlerState(jobExecutionContext.getCuratorClient(), jobExecutionContext, this.getClass().getName(), GfacHandlerState.INVOKED);
- } catch (Exception e) {
- logger.info("Error saving plugin status to ZK");
- }
- StringBuffer data = new StringBuffer();
-
- data.append(jobExecutionContext.getScratchLocation());
- data.append(",").append(jobExecutionContext.getWorkingDir());
-
- /*
- * Input and Output Directory
- */
- data.append(",").append(jobExecutionContext.getInputDir()).append(",").append(jobExecutionContext.getOutputDir());
-
- /*
- * Stdout and Stderr for Shell
- */
- data.append(",").append(jobExecutionContext.getStandardOutput()).append(",").append(jobExecutionContext.getStandardError());
-
-
- logger.info("Recoverable data is saving to zk: " + data.toString());
- GFacUtils.saveHandlerData(jobExecutionContext, data, this.getClass().getName());
- }
-
-
-
- public void initProperties(Properties properties) throws GFacHandlerException {
-
- }
-
- public void recover(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
- try {
- String s = GFacUtils.getHandlerData(jobExecutionContext, this.getClass().getName());
- String[] split = s.split(","); // this is ugly code but nobody else is saving or reading this data, so this is the fastest way
- jobExecutionContext.getApplicationContext().getComputeResourcePreference().setScratchLocation(split[0]);
- jobExecutionContext.setWorkingDir(split[1]);
- jobExecutionContext.setInputDir(split[2]);
- jobExecutionContext.setOutputDir(split[3]);
- jobExecutionContext.setStandardOutput(split[4]);
- jobExecutionContext.setStandardError(split[5]);
- } catch (Exception e) {
- throw new GFacHandlerException(e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandler.java
deleted file mode 100644
index 15b86dd..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandler.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.handler;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * This is the handler interface in gfac, most of the tasks
- * which can be decoupled from each other can be implemented
- * as a Handler. After implementing these can be registered in
- * gfac-config.xml and those will get invoked by the framework.
- */
-public interface GFacHandler {
- /**
- * This can be used to initialize the Handler, This will get
- * invoked after creating the handler instance using the default constructor
- *
- * @param properties
- * @throws GFacHandlerException
- */
- public void initProperties(Properties properties) throws GFacHandlerException;
-
- /**
- * This is the method which will invoked by the frameworkd to exectute the
- * Handler functionality.
- * @param jobExecutionContext
- * @throws GFacHandlerException
- */
- public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException;
-
-
- /**
- * This method can be used to implement recovering part of the stateful handler
- * If you do not want to recover an already ran handler you leave this recover method empty.
- * @param jobExecutionContext
- */
- public void recover(JobExecutionContext jobExecutionContext)throws GFacHandlerException;
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerConfig.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerConfig.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerConfig.java
deleted file mode 100644
index ddb6341..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerConfig.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.handler;
-
-import java.util.Map;
-import java.util.Properties;
-
-public class GFacHandlerConfig {
-
- public GFacHandlerConfig(Properties properties, String className) {
- this.properties = properties;
- this.className = className;
- }
-
- private Properties properties;
-
- private String className;
-
- public void setProperties(Properties properties) {
- this.properties = properties;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public Properties getProperties() {
- return properties;
- }
-
- public String getClassName() {
- return className;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerException.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerException.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerException.java
deleted file mode 100644
index 1464557..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/GFacHandlerException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.handler;
-
-import org.apache.airavata.gfac.core.GFacException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class GFacHandlerException extends GFacException {
- private static final Logger log = LoggerFactory.getLogger(GFacHandlerException.class);
-
- public GFacHandlerException(String message) {
- super(message, new Throwable(message));
- log.error(message);
- }
-
- public GFacHandlerException(String s, Throwable throwable) {
- super(s, throwable);
- log.error(s,throwable);
- }
-
- public GFacHandlerException(String message, Exception e, String... additionExceptiondata) {
- super(message, e);
- log.error(message,e);
- }
- public GFacHandlerException(Exception e) {
- super(e);
- log.error(e.getMessage(),e);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/ThreadedHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/ThreadedHandler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/ThreadedHandler.java
deleted file mode 100644
index 0dcf568..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/ThreadedHandler.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.handler;
-
-/**
- * This handler can be used to run in a separate thread in handler chain or as a daemon
- * for the gfac instance you are running. If this is configured as another
- * handler in the execution chain this will get invoked in asynchronous mode in a separate
- * thread for each request, so you have to make sure the thread is returning properly.
- */
-public abstract class ThreadedHandler extends AbstractHandler implements Runnable{
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
index 5e2736a..5a0e597 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
@@ -20,11 +20,11 @@
*/
package org.apache.airavata.gfac.core.monitor;
-import org.apache.airavata.common.logger.AiravataLogger;
-import org.apache.airavata.common.logger.AiravataLoggerFactory;
import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.experiment.JobState;
+import org.apache.airavata.model.status.JobState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.sql.Timestamp;
import java.util.Date;
@@ -35,7 +35,7 @@ This is the object which contains the data to identify a particular
Job to start the monitoring
*/
public class MonitorID {
- private final static AiravataLogger logger = AiravataLoggerFactory.getLogger(MonitorID.class);
+ private final static Logger logger = LoggerFactory.getLogger(MonitorID.class);
private String userName;
@@ -87,7 +87,7 @@ public class MonitorID {
}
public MonitorID(JobExecutionContext jobExecutionContext) {
- this.jobExecutionContext = jobExecutionContext;
+/* this.jobExecutionContext = jobExecutionContext;
this.computeResourceDescription = jobExecutionContext.getApplicationContext().getComputeResourceDescription();
userName = jobExecutionContext.getExperiment().getUserName();
taskID = jobExecutionContext.getTaskData().getTaskID();
@@ -99,7 +99,7 @@ public class MonitorID {
}catch(NullPointerException e){
logger.error("There is not job created at this point");
// this is not a big deal we create MonitorId before having a jobId or job Name
- }
+ }*/
}
public ComputeResourceDescription getComputeResourceDescription() {
@@ -192,11 +192,11 @@ public class MonitorID {
// during that case job state comes as unknown.so we handle it here.
if (this.state != null && status.equals(JobState.UNKNOWN)) {
this.failedCount++;
- logger.infoId(this.getJobID(), "{} status came for job {}, Increasing the failed count to: {}.",
+ logger.info(this.getJobID(), "{} status came for job {}, Increasing the failed count to: {}.",
status.toString(), this.jobID, this.failedCount);
}else {
// normal scenario
- logger.infoId(this.getJobID(), "Valid status {} came for job {}, resetting fail count to 0", status.toString(), this.jobID);
+ logger.info(this.getJobID(), "Valid status {} came for job {}, resetting fail count to 0", status.toString(), this.jobID);
setFailedCount(0);
this.state = status;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
deleted file mode 100644
index 545bcd3..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.monitor.state;
-
-import org.apache.airavata.gfac.core.monitor.MonitorID;
-import org.apache.airavata.gfac.core.states.GfacExperimentState;
-import org.apache.airavata.model.messaging.event.JobIdentifier;
-
-public class GfacExperimentStateChangeRequest {
- private GfacExperimentState state;
-
- private JobIdentifier identity;
-
- private MonitorID monitorID;
-
- public GfacExperimentStateChangeRequest(MonitorID monitorID, GfacExperimentState state) {
- setIdentity(new JobIdentifier(monitorID.getJobID(),
- monitorID.getTaskID(),
- monitorID.getWorkflowNodeID(),
- monitorID.getExperimentID(),
- monitorID.getJobExecutionContext().getGatewayID()));
- setMonitorID(monitorID);
- this.state = state;
- }
-
- public GfacExperimentStateChangeRequest(MonitorID monitorID, JobIdentifier jobId, GfacExperimentState state) {
- setIdentity(jobId);
- setMonitorID(monitorID);
- this.state = state;
- }
-
-
- public GfacExperimentState getState() {
- return state;
- }
-
- public void setState(GfacExperimentState state) {
- this.state = state;
- }
-
- public JobIdentifier getIdentity() {
- return identity;
- }
-
- public void setIdentity(JobIdentifier identity) {
- this.identity = identity;
- }
-
- public MonitorID getMonitorID() {
- return monitorID;
- }
-
- public void setMonitorID(MonitorID monitorID) {
- this.monitorID = monitorID;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/PublisherMessage.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/PublisherMessage.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/PublisherMessage.java
deleted file mode 100644
index 08294f8..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/PublisherMessage.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.monitor.state;
-
-public interface PublisherMessage {
-// public String getType();
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/AbstractProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/AbstractProvider.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/AbstractProvider.java
deleted file mode 100644
index 169ccb5..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/AbstractProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider;
-
-import org.apache.airavata.gfac.core.GFacException;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.model.experiment.JobDetails;
-import org.apache.airavata.model.experiment.JobStatus;
-import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.ExperimentCatalog;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractProvider implements GFacProvider{
- private final Logger log = LoggerFactory.getLogger(this.getClass());
-
- protected ExperimentCatalog experimentCatalog = null;
- protected JobDetails details; //todo we need to remove this and add methods to fill Job details, this is not a property of a provider
- protected JobStatus status; //todo we need to remove this and add methods to fill Job details, this is not a property of a provider
- protected JobExecutionContext jobExecutionContext;
-
- public void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
- log.debug("Initializing " + this.getClass().getName());
- if(jobExecutionContext.getExperimentCatalog() == null) {
- try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- } catch (RegistryException e) {
- throw new GFacException("Unable to create registry instance", e);
- }
- }else{
- experimentCatalog = jobExecutionContext.getExperimentCatalog();
- }
- details = new JobDetails();
- status = new JobStatus();
- this.jobExecutionContext=jobExecutionContext;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProvider.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProvider.java
deleted file mode 100644
index 7b95928..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProvider.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider;
-
-import java.util.Map;
-
-import org.apache.airavata.gfac.core.GFacException;
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-
-public interface GFacProvider{
-
- void initProperties(Map<String,String> properties) throws GFacProviderException,GFacException;
- /**
- * Initialize environment required for invoking the execute method of the provider. If environment setup is
- * done during the in handler execution, validation of environment will go here.
- * @param jobExecutionContext containing job execution related information.
- * @throws GFacProviderException in case of a error initializing the environment.
- */
- void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException,GFacException;
-
- /**
- * Invoke the providers intended functionality using information and data in job execution context.
- * @param jobExecutionContext containing job execution related information.
- * @throws GFacProviderException in case of a error executing the job.
- */
- void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException;
-
- /**
- * Cleans up the acquired resources during initialization and execution of the job.
- * @param jobExecutionContext containing job execution related information.
- * @throws GFacProviderException in case of a error cleaning resources.
- */
- void dispose(JobExecutionContext jobExecutionContext) throws GFacProviderException,GFacException;
-
- /**
- * Cancels all jobs relevant to an experiment.
- * @param jobExecutionContext The job execution context, contains runtime information.
- * @return <code>true</code> if cancel operation success. <code>false</code> otherwise.
- * @throws GFacException If an error occurred while cancelling the job.
- */
- public boolean cancelJob(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException;
-
-
- /**
- * This method can be used to implement recovering part of the stateful handler
- * If you do not want to recover an already ran handler you leave this recover method empty.
- *
- * @param jobExecutionContext
- */
- public void recover(JobExecutionContext jobExecutionContext)throws GFacProviderException,GFacException;
-
- /**
- * FIXME :Added this method to make an quick fix, need to remove this monitor logic from provider and invoke separately.
- * @param jobExecutionContext
- * @throws GFacProviderException
- * @throws GFacException
- */
- public void monitor(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException;
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderConfig.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderConfig.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderConfig.java
deleted file mode 100644
index 8a85dc4..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderConfig.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider;
-
-import java.util.Map;
-
-public class GFacProviderConfig {
-
- public GFacProviderConfig(Map<String, String> properties, String className) {
- this.properties = properties;
- this.className = className;
- }
-
- private Map<String, String> properties;
-
- private String className;
-
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public Map<String, String> getProperties() {
- return properties;
- }
-
- public String getClassName() {
- return className;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderException.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderException.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderException.java
deleted file mode 100644
index 30f9530..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/GFacProviderException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class GFacProviderException extends Exception {
- private static final Logger log = LoggerFactory.getLogger(GFacProviderException.class);
-
- private String aditionalInfo[] = null;
-
- public GFacProviderException(String message) {
- super(message);
- log.error(message);
- }
-
-
- public GFacProviderException(String message, Throwable cause) {
- super(message, cause);
- log.error(message,cause);
- }
-
-
- public GFacProviderException(String message, Exception e, String... additionExceptiondata) {
- super(message);
- this.aditionalInfo = additionExceptiondata;
- log.error(message,e);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/DataIDType.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/DataIDType.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/DataIDType.java
deleted file mode 100644
index 5028502..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/DataIDType.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider.utils;
-
-import org.apache.airavata.gfac.core.provider.GFacProviderException;
-import org.xmlpull.v1.builder.XmlElement;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-
-/**
- * Represents a DataID (A schema with real names), currently it only sends a one
- * location value.
- */
-public class DataIDType {
- public static final String LOCATION_ATTRIBUTE = "location";
-
- private URI dataID;
-
- private ArrayList<URI> dataLocations = new ArrayList<URI>();
-
- public URI getRealLocation() {
- if (dataLocations.size() > 0) {
- return dataLocations.get(0);
- } else {
- return null;
- }
- }
-
- public DataIDType(XmlElement ele) throws GFacProviderException {
- try {
- String value = ele.requiredTextContent();
- if (value != null) {
- this.dataID = new URI(value);
- } else {
- throw new GFacProviderException(
- "Illegal InputMessage, No value content found for the parameter "
- + ele.getName() + "/value. Invalid Local Argument");
- }
- String location = ele.getAttributeValue(null, DataIDType.LOCATION_ATTRIBUTE);
- if (location != null) {
- addDataLocation(new URI(location));
- }
- } catch (URISyntaxException e) {
- throw new GFacProviderException("Invalid Local Argument", e);
- }
- }
-
- public DataIDType(URI dataID) {
- super();
- this.dataID = dataID;
- }
-
- public void addDataLocation(URI dataLocation) {
- dataLocations.add(dataLocation);
- }
-
- public ArrayList<URI> getDataLocations() {
- return dataLocations;
- }
-
- public URI getDataID() {
- return dataID;
- }
-
- public void fillData(XmlElement ele) {
- ele.addChild(dataID.toString());
- URI location = getRealLocation();
- if (location != null) {
- ele.addAttribute(DataIDType.LOCATION_ATTRIBUTE, location.toString());
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ProviderUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ProviderUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ProviderUtils.java
deleted file mode 100644
index 7d8b39e..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ProviderUtils.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider.utils;
-
-import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.context.MessageContext;
-import org.apache.airavata.gfac.core.provider.GFacProviderException;
-import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class ProviderUtils {
-
- public static List<String> getInputParameters(JobExecutionContext jobExecutionContext) throws GFacProviderException {
- List<String> parameters = new ArrayList<String>();
- MessageContext inMessageContext = jobExecutionContext.getInMessageContext();
- Map<String, Object> inputs = inMessageContext.getParameters();
- for (String inputParam : inputs.keySet()) {
- parameters.add(inputParam);
- }
- return parameters;
- }
-
- public static List<String> getInputParameterValues(JobExecutionContext jobExecutionContext) {
- List<String> paramValues = new ArrayList<String>();
- Map<String, Object> paramMap = jobExecutionContext.getInMessageContext().getParameters();
- InputDataObjectType inputDataObjectType;
- for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
- if (entry.getValue() instanceof InputDataObjectType) {
- inputDataObjectType = (InputDataObjectType) entry.getValue();
- paramValues.add(inputDataObjectType.getValue());
- }
- }
- return paramValues;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ResourceRequirement.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ResourceRequirement.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ResourceRequirement.java
deleted file mode 100644
index 2e824b3..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/provider/utils/ResourceRequirement.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.provider.utils;
-
-public interface ResourceRequirement extends Cloneable {
-
- /**
- * States whether this resource requirement is active
- * and should be written into the job description.
- * @return
- */
- public boolean isEnabled();
-
- public void setEnabled(boolean enabled);
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/scheduler/impl/SimpleHostScheduler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/scheduler/impl/SimpleHostScheduler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/scheduler/impl/SimpleHostScheduler.java
deleted file mode 100644
index 37aed30..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/scheduler/impl/SimpleHostScheduler.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.airavata.gfac.core.scheduler.impl;
-
-import java.util.List;
-
-import org.apache.airavata.gfac.core.scheduler.HostScheduler;
-import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-
-public class SimpleHostScheduler implements HostScheduler {
- public ComputeResourceDescription schedule(List<ComputeResourceDescription> registeredHosts) {
- //todo implement an algorithm to pick a host among different hosts, ideally this could be configurable in an xml
- return registeredHosts.get(0);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/92264537/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacExperimentState.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacExperimentState.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacExperimentState.java
deleted file mode 100644
index 63e1811..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/states/GfacExperimentState.java
+++ /dev/null
@@ -1,89 +0,0 @@
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.gfac.core.states;
-
-
-import org.apache.thrift.TEnum;
-
- @SuppressWarnings("all") public enum GfacExperimentState implements TEnum {
- LAUNCHED(0),
- ACCEPTED(1),
- INHANDLERSINVOKING(2),
- INHANDLERSINVOKED(3),
- PROVIDERINVOKING(4),
- JOBSUBMITTED(5),
- PROVIDERINVOKED(6),
- OUTHANDLERSINVOKING(7),
- OUTHANDLERSINVOKED(8),
- COMPLETED(9),
- FAILED(10),
- UNKNOWN(11);
-
- private final int value;
-
- private GfacExperimentState(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static GfacExperimentState findByValue(int value) {
- switch (value) {
- case 0:
- return LAUNCHED;
- case 1:
- return ACCEPTED;
- case 2:
- return INHANDLERSINVOKING;
- case 3:
- return INHANDLERSINVOKED;
- case 4:
- return PROVIDERINVOKING;
- case 5:
- return JOBSUBMITTED;
- case 6:
- return PROVIDERINVOKED;
- case 7:
- return OUTHANDLERSINVOKING;
- case 8:
- return OUTHANDLERSINVOKED;
- case 9:
- return COMPLETED;
- case 10:
- return FAILED;
- case 11:
- return UNKNOWN;
- default:
- return null;
- }
- }
- }