You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vg...@apache.org on 2011/12/16 01:29:54 UTC

svn commit: r1215005 - in /incubator/ambari/trunk: agent/src/main/resources/puppet/modules/hadoop/manifests/ agent/src/main/resources/puppet/modules/hadoop/templates/ client/src/main/java/org/apache/ambari/client/

Author: vgogate
Date: Fri Dec 16 00:29:54 2011
New Revision: 1215005

URL: http://svn.apache.org/viewvc?rev=1215005&view=rev
Log:
AMBARI-161. Add puppet module for Hadoop to agent resources

Modified:
    incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/manifests/init.pp
    incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_env.erb
    incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_properties.erb
    incubator/ambari/trunk/client/src/main/java/org/apache/ambari/client/Command.java

Modified: incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/manifests/init.pp?rev=1215005&r1=1215004&r2=1215005&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/manifests/init.pp (original)
+++ incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/manifests/init.pp Fri Dec 16 00:29:54 2011
@@ -93,8 +93,8 @@ class hadoop {
     include common 
 
     $ambari_role_name = "client"
-    $hadoop_conf_dir = "${ambari_role_prefix}/etc/hadoop"
-    file {["${ambari_role_prefix}", "${ambari_role_prefix}/etc", "${ambari_role_prefix}/etc/hadoop"]:
+    $hadoop_conf_dir = "${ambari_role_prefix}/etc/conf"
+    file {["${ambari_role_prefix}", "${ambari_role_prefix}/etc", "${ambari_role_prefix}/etc/conf"]:
       ensure => directory
     }     
     notice ($ambari_role_prefix)

Modified: incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_env.erb
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_env.erb?rev=1215005&r1=1215004&r2=1215005&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_env.erb (original)
+++ incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_env.erb Fri Dec 16 00:29:54 2011
@@ -1,25 +1,24 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+#-- 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.                                           -->
 
-<!-- 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.                                           -->
+# Hadoop specific environment 
 
 <% require 'erubis' -%>
 <% conf_category_map.each do |key,value| -%>
-    <% while (value.include? '<%=') do -%>
-    <% value=Erubis::Eruby.new(value).result(binding) -%>
-    <% end -%>
+<% while (value.include? '<%=') do -%>
+<% value=Erubis::Eruby.new(value).result(binding) -%>
+<% end -%>
 export <%= key %>="<%= value %>"
 <% end -%>

Modified: incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_properties.erb
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_properties.erb?rev=1215005&r1=1215004&r2=1215005&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_properties.erb (original)
+++ incubator/ambari/trunk/agent/src/main/resources/puppet/modules/hadoop/templates/config_properties.erb Fri Dec 16 00:29:54 2011
@@ -21,9 +21,9 @@
 <% conf_category_map.each do |key,value| -%>
   <property>
     <name><%= key %></name>
-    <% while (value.include? '<%=') do -%>
-    <% value=Erubis::Eruby.new(value).result(binding) -%>
-    <% end -%>
+<% while (value.include? '<%=') do -%>
+<% value=Erubis::Eruby.new(value).result(binding) -%>
+<% end -%>
     <value><%= value %></value>
   </property>
 <% end -%>

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/client/Command.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/client/Command.java?rev=1215005&r1=1215004&r2=1215005&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/client/Command.java (original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/client/Command.java Fri Dec 16 00:29:54 2011
@@ -30,6 +30,8 @@ import org.apache.ambari.common.rest.ent
 import org.apache.ambari.common.rest.entities.Node;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.json.JSONJAXBContext;
+import com.sun.jersey.api.json.JSONMarshaller;
 
 public abstract class Command {
     
@@ -115,6 +117,14 @@ public abstract class Command {
         m.marshal(def, System.out);
     }
     
+    public void printClusterDefinitionJSON(ClusterDefinition def) throws Exception {
+        JAXBContext jc = JSONJAXBContext.newInstance(org.apache.ambari.common.rest.entities.ClusterDefinition.class);
+        Marshaller m = jc.createMarshaller(); 
+        JSONMarshaller mx = JSONJAXBContext.getJSONMarshaller(m);
+        mx.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+        mx.marshallToJSON(def, System.out);
+    }
+    
     public void printClusterInformation(ClusterInformation clsInfo) throws Exception {
         JAXBContext jc = JAXBContext.newInstance(org.apache.ambari.common.rest.entities.ClusterInformation.class);
         Marshaller m = jc.createMarshaller();