Return-Path: X-Original-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 71EFF99D0 for ; Tue, 3 Jul 2012 19:27:49 +0000 (UTC) Received: (qmail 61545 invoked by uid 500); 3 Jul 2012 19:27:49 -0000 Delivered-To: apmail-incubator-airavata-commits-archive@incubator.apache.org Received: (qmail 61505 invoked by uid 500); 3 Jul 2012 19:27:49 -0000 Mailing-List: contact airavata-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: airavata-dev@incubator.apache.org Delivered-To: mailing list airavata-commits@incubator.apache.org Received: (qmail 61498 invoked by uid 99); 3 Jul 2012 19:27:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2012 19:27:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2012 19:27:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0EE0623888CD; Tue, 3 Jul 2012 19:27:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1356878 - /incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java Date: Tue, 03 Jul 2012 19:27:25 -0000 To: airavata-commits@incubator.apache.org From: lahiru@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120703192726.0EE0623888CD@eris.apache.org> Author: lahiru Date: Tue Jul 3 19:27:25 2012 New Revision: 1356878 URL: http://svn.apache.org/viewvc?rev=1356878&view=rev Log: fixing Error during gram job invocation. Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java?rev=1356878&r1=1356877&r2=1356878&view=diff ============================================================================== --- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java (original) +++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java Tue Jul 3 19:27:25 2012 @@ -91,7 +91,8 @@ public class SchedulerImpl implements Sc */ ApplicationDeploymentDescription app = null; try { - app = registryService.getDeploymentDescription(context.getServiceName(), host.getType().getHostName()); + app = registryService.getDeploymentDescription(context.getServiceName(), + getRegisteredHost(registryService,context.getServiceName()).getType().getHostName()); } catch (RegistryException e2) { e2.printStackTrace(); } @@ -171,15 +172,7 @@ public class SchedulerImpl implements Sc log.info("Searching registry for some deployed application hosts"); HostDescription result = null; Map> deploymentDescription = null; - try { - deploymentDescription = regService.searchDeploymentDescription(serviceName); - for (HostDescription hostDesc : deploymentDescription.keySet()) { - result = hostDesc; - log.info("Found service on: " + result.getType().getHostAddress()); - } - } catch (RegistryException e) { - e.printStackTrace(); - } + result = getRegisteredHost(regService, serviceName); // if user specify the host in the workflowcontext header we pick that host instead of picking the last hostName if(hostName != null){ HostDescription hostDescription = null; @@ -211,4 +204,19 @@ public class SchedulerImpl implements Sc // return null; // } } + + private HostDescription getRegisteredHost(AiravataRegistry regService, String serviceName) { + Map> deploymentDescription; + HostDescription result = null; + try { + deploymentDescription = regService.searchDeploymentDescription(serviceName); + for (HostDescription hostDesc : deploymentDescription.keySet()) { + result = hostDesc; + log.info("Found service on: " + result.getType().getHostAddress()); + } + } catch (RegistryException e) { + e.printStackTrace(); + } + return result; + } }