Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-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 089FB9988 for ; Tue, 27 Sep 2011 20:07:07 +0000 (UTC) Received: (qmail 80229 invoked by uid 500); 27 Sep 2011 20:07:07 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 80214 invoked by uid 500); 27 Sep 2011 20:07:06 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 80207 invoked by uid 99); 27 Sep 2011 20:07:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Sep 2011 20:07:06 +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, 27 Sep 2011 20:07:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4BA7823888FD; Tue, 27 Sep 2011 20:06:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1176582 - in /incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components: ClusterContext.java ComponentPlugin.java Date: Tue, 27 Sep 2011 20:06:45 -0000 To: ambari-commits@incubator.apache.org From: omalley@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110927200645.4BA7823888FD@eris.apache.org> Author: omalley Date: Tue Sep 27 20:06:44 2011 New Revision: 1176582 URL: http://svn.apache.org/viewvc?rev=1176582&view=rev Log: AMBARI-4. Created interface for component plugins. (omalley) Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ClusterContext.java incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ComponentPlugin.java Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ClusterContext.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ClusterContext.java?rev=1176582&r1=1176581&r2=1176582&view=diff ============================================================================== --- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ClusterContext.java (original) +++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ClusterContext.java Tue Sep 27 20:06:44 2011 @@ -37,13 +37,6 @@ public interface ClusterContext { String[] getAllRoles(); /** - * Get the list of all roles for this component that should be started - * running on this node. - * @return the lists of roles that should be running - */ - String[] getActiveRoles(); - - /** * Get the directory name for the directory that should contain the software. * @return the full pathname of the directory */ Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ComponentPlugin.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ComponentPlugin.java?rev=1176582&r1=1176581&r2=1176582&view=diff ============================================================================== --- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ComponentPlugin.java (original) +++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/ComponentPlugin.java Tue Sep 27 20:06:44 2011 @@ -20,7 +20,7 @@ package org.apache.ambari.components; import java.io.IOException; import java.util.List; -import org.apache.ambari.common.rest.entities.agent.Command; +import org.apache.ambari.common.rest.entities.agent.Action; /** * A plug in that defines how to manage each component. @@ -57,8 +57,8 @@ public abstract class ComponentPlugin { * @return the list of commands to run on each node * @throws IOException */ - public abstract List writeConfiguration(ClusterContext cluster - ) throws IOException; + public abstract List writeConfiguration(ClusterContext cluster + ) throws IOException; /** * Get the commands to finalize the installation on the machine. @@ -66,24 +66,37 @@ public abstract class ComponentPlugin { * @return the list of commands to execute * @throws IOException */ - public abstract List install(ClusterContext cluster - ) throws IOException; + public abstract List install(ClusterContext cluster + ) throws IOException; /** - * Get the commands start and stop the servers on this node. + * Get the commands to start a role's server. * @param cluster the cluster that is being installed + * @param role the role that needs to start running its server * @return the list of commands to execute * @throws IOException */ - public abstract List startStopServices(ClusterContext cluster - ) throws IOException; - + public abstract List startRoleServer(ClusterContext cluster, + String role + ) throws IOException; + + /** + * Get the commands to stop a role's server. + * @param cluster the cluster that is being installed + * @param role the role that needs to stop running its server + * @return the list of commands to execute + * @throws IOException + */ + public abstract List stopRoleServer(ClusterContext cluster, + String role + ) throws IOException; + /** * Get the commands to run before the software is uninstalled. * @param cluster the cluster that is being uninstalled * @return the list of commands to execute * @throws IOException */ - public abstract List uninstall(ClusterContext cluster - ) throws IOException; + public abstract List uninstall(ClusterContext cluster + ) throws IOException; }