You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2012/08/08 09:26:32 UTC

svn commit: r1370681 - in /incubator/oozie/trunk: ./ client/src/main/java/org/apache/oozie/cli/ client/src/main/resources/ core/src/main/java/org/apache/oozie/ core/src/main/java/org/apache/oozie/command/bundle/ core/src/main/java/org/apache/oozie/comm...

Author: virag
Date: Wed Aug  8 07:26:32 2012
New Revision: 1370681

URL: http://svn.apache.org/viewvc?rev=1370681&view=rev
Log:
OOZIE-942 Add formal Parameters to bundle XML (rkanter via virag)

Added:
    incubator/oozie/trunk/client/src/main/resources/oozie-bundle-0.2.xsd
Modified:
    incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
    incubator/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java
    incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java
    incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java
    incubator/oozie/trunk/core/src/main/java/org/apache/oozie/service/SchemaService.java
    incubator/oozie/trunk/core/src/main/java/org/apache/oozie/util/ParameterVerifier.java
    incubator/oozie/trunk/core/src/test/java/org/apache/oozie/util/TestParameterVerifier.java
    incubator/oozie/trunk/docs/src/site/twiki/BundleFunctionalSpec.twiki
    incubator/oozie/trunk/release-log.txt

Modified: incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java (original)
+++ incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java Wed Aug  8 07:26:32 2012
@@ -1450,6 +1450,8 @@ public class OozieCLI {
                 sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
                         "oozie-bundle-0.1.xsd")));
                 sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
+                        "oozie-bundle-0.2.xsd")));
+                sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
                         "oozie-sla-0.1.xsd")));
                 sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
                         "hive-action-0.2.xsd")));

Added: incubator/oozie/trunk/client/src/main/resources/oozie-bundle-0.2.xsd
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/client/src/main/resources/oozie-bundle-0.2.xsd?rev=1370681&view=auto
==============================================================================
--- incubator/oozie/trunk/client/src/main/resources/oozie-bundle-0.2.xsd (added)
+++ incubator/oozie/trunk/client/src/main/resources/oozie-bundle-0.2.xsd Wed Aug  8 07:26:32 2012
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bundle="uri:oozie:bundle:0.2"
+           elementFormDefault="qualified" targetNamespace="uri:oozie:bundle:0.2">
+
+    <xs:element name="bundle-app" type="bundle:BUNDLE-APP"/>
+    <xs:simpleType name="IDENTIFIER">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="BUNDLE-APP">
+        <xs:sequence>
+            <xs:element name="parameters" type="bundle:PARAMETERS" minOccurs="0" maxOccurs="1"/>
+            <xs:element name="controls" type="bundle:CONTROLS" minOccurs="0" maxOccurs="1"/>
+            <xs:element name="coordinator" type="bundle:COORDINATOR" minOccurs="1" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:string" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="PARAMETERS">
+        <xs:sequence>
+            <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="value" minOccurs="0" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CONTROLS">
+        <xs:sequence minOccurs="0" maxOccurs="1">
+            <xs:element name="kick-off-time" type="xs:string" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="COORDINATOR">
+        <xs:sequence  minOccurs="1" maxOccurs="1">
+            <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="configuration" type="bundle:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="bundle:IDENTIFIER" use="required"/>
+        <xs:attribute name="critical" type="xs:string" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="CONFIGURATION">
+        <xs:sequence>
+            <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+</xs:schema>

Modified: incubator/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java (original)
+++ incubator/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java Wed Aug  8 07:26:32 2012
@@ -144,6 +144,7 @@ public enum ErrorCode {
     E0736(XLog.STD, "Workflow definition lenght [{0}] exceeded maximum allowed length [{1}]"),
     E0737(XLog.STD, "Invalid transition from node [{0}] to node [{1}] while using Fork/Join because node [{1}] is of type [{2}]"),
     E0738(XLog.STD, "The following {0} parameters are required but were not defined and no default values are available: {1}"),
+    E0739(XLog.STD, "Parameter name cannot be empty"),
 
     E0800(XLog.STD, "Action it is not running its in [{1}] state, action [{0}]"),
     E0801(XLog.STD, "Workflow already running, workflow [{0}]"),

Modified: incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java (original)
+++ incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java Wed Aug  8 07:26:32 2012
@@ -64,6 +64,7 @@ import org.apache.oozie.util.ParamChecke
 import org.apache.oozie.util.PropertiesUtils;
 import org.apache.oozie.util.XConfiguration;
 import org.apache.oozie.util.XmlUtils;
+import org.apache.oozie.util.ParameterVerifier;
 import org.jdom.Attribute;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -131,6 +132,8 @@ public class BundleSubmitXCommand extend
         try {
             InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
 
+            ParameterVerifier.verifyParameters(conf, XmlUtils.parseXml(bundleBean.getOrigJobXml()));
+            
             XmlUtils.removeComments(this.bundleBean.getOrigJobXml().toString());
             // Resolving all variables in the job properties.
             // This ensures the Hadoop Configuration semantics is preserved.

Modified: incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java (original)
+++ incubator/oozie/trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java Wed Aug  8 07:26:32 2012
@@ -217,10 +217,12 @@ public class CoordSubmitXCommand extends
             coordJob.setOrigJobXml(appXml);
             LOG.debug("jobXml after initial validation " + XmlUtils.prettyPrint(appXml).toString());
 
-            String appNamespace = readAppNamespace(appXml);
+            Element eXml = XmlUtils.parseXml(appXml);
+            
+            String appNamespace = readAppNamespace(eXml);
             coordJob.setAppNamespace(appNamespace);
 
-            ParameterVerifier.verifyParameters(conf, XmlUtils.parseXml(appXml));
+            ParameterVerifier.verifyParameters(conf, eXml);
             
             appXml = XmlUtils.removeComments(appXml);
             initEvaluators();
@@ -273,6 +275,11 @@ public class CoordSubmitXCommand extends
                 return output;
             }
         }
+        catch (JDOMException jex) {
+            exceptionOccured = true;
+            LOG.warn("ERROR: ", jex);
+            throw new CommandException(ErrorCode.E0700, jex.getMessage(), jex);
+        }
         catch (CoordinatorJobException cex) {
             exceptionOccured = true;
             LOG.warn("ERROR:  ", cex);
@@ -470,28 +477,21 @@ public class CoordSubmitXCommand extends
     /**
      * Read the application XML schema namespace
      *
-     * @param xmlContent input coordinator xml
+     * @param coordXmlElement input coordinator xml Element
      * @return app xml namespace
      * @throws CoordinatorJobException
      */
-    private String readAppNamespace(String xmlContent) throws CoordinatorJobException {
-        try {
-            Element coordXmlElement = XmlUtils.parseXml(xmlContent);
-            Namespace ns = coordXmlElement.getNamespace();
-            if (ns != null && bundleId != null && ns.getURI().equals(SchemaService.COORDINATOR_NAMESPACE_URI_1)) {
-                throw new CoordinatorJobException(ErrorCode.E1319, "bundle app can not submit coordinator namespace "
-                        + SchemaService.COORDINATOR_NAMESPACE_URI_1 + ", please use 0.2 or later");
-            }
-            if (ns != null) {
-                return ns.getURI();
-            }
-            else {
-                throw new CoordinatorJobException(ErrorCode.E0700, "the application xml namespace is not given");
-            }
+    private String readAppNamespace(Element coordXmlElement) throws CoordinatorJobException {
+        Namespace ns = coordXmlElement.getNamespace();
+        if (ns != null && bundleId != null && ns.getURI().equals(SchemaService.COORDINATOR_NAMESPACE_URI_1)) {
+            throw new CoordinatorJobException(ErrorCode.E1319, "bundle app can not submit coordinator namespace "
+                    + SchemaService.COORDINATOR_NAMESPACE_URI_1 + ", please use 0.2 or later");
         }
-        catch (JDOMException ex) {
-            LOG.warn("JDOMException :", ex);
-            throw new CoordinatorJobException(ErrorCode.E0700, ex.getMessage(), ex);
+        if (ns != null) {
+            return ns.getURI();
+        }
+        else {
+            throw new CoordinatorJobException(ErrorCode.E0700, "the application xml namespace is not given");
         }
     }
 

Modified: incubator/oozie/trunk/core/src/main/java/org/apache/oozie/service/SchemaService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/service/SchemaService.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/main/java/org/apache/oozie/service/SchemaService.java (original)
+++ incubator/oozie/trunk/core/src/main/java/org/apache/oozie/service/SchemaService.java Wed Aug  8 07:26:32 2012
@@ -67,7 +67,7 @@ public class SchemaService implements Se
         "oozie-workflow-0.4.xsd"};
     private static final String OOZIE_COORDINATOR_XSD[] = { "oozie-coordinator-0.1.xsd", "oozie-coordinator-0.2.xsd", 
         "oozie-coordinator-0.3.xsd", "oozie-coordinator-0.4.xsd"};
-    private static final String OOZIE_BUNDLE_XSD[] = { "oozie-bundle-0.1.xsd" };
+    private static final String OOZIE_BUNDLE_XSD[] = { "oozie-bundle-0.1.xsd", "oozie-bundle-0.2.xsd" };
     private static final String OOZIE_SLA_SEMANTIC_XSD[] = { "gms-oozie-sla-0.1.xsd" };
 
     private Schema loadSchema(Configuration conf, String[] baseSchemas, String extSchema) throws SAXException,

Modified: incubator/oozie/trunk/core/src/main/java/org/apache/oozie/util/ParameterVerifier.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/util/ParameterVerifier.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/main/java/org/apache/oozie/util/ParameterVerifier.java (original)
+++ incubator/oozie/trunk/core/src/main/java/org/apache/oozie/util/ParameterVerifier.java Wed Aug  8 07:26:32 2012
@@ -31,14 +31,18 @@ import org.apache.hadoop.conf.Configurat
  */
 public abstract class ParameterVerifier 
 {
-    private static final Pattern nsVersionPattern = Pattern.compile("uri:oozie:workflow:(\\d+.\\d+)");
+    private static final Pattern nsVersionPattern = Pattern.compile("uri:oozie:(workflow|coordinator|bundle):(\\d+.\\d+)");
+    
+    private static final double workflowMinVersion = 0.4;
+    private static final double coordinatorMinVersion = 0.4;
+    private static final double bundleMinVersion = 0.2;
     
     /**
-     * Verify the parameters section
+     * Verify the parameters section (if supported in the schema)
      *
      * @param conf The job configuration
-     * @param rootElement The root of the workflow definition
-     * @throws ParameterVerifierException If required parameters are not defined and have no default values, an exception is thrown
+     * @param rootElement The root element of the workflow, coordinator, or bundle definition
+     * @throws ParameterVerifierException If required parameters are not defined and have no default values, or if a name is empty
      */
     public static void verifyParameters(Configuration conf, Element rootElement) throws ParameterVerifierException {
         ParamChecker.notNull(conf, "conf");
@@ -46,43 +50,54 @@ public abstract class ParameterVerifier 
             return;
         }
         
-        Element params = rootElement.getChild("parameters", rootElement.getNamespace());
-        if (params != null) {
-            int numMissing = 0;
-            StringBuilder missingParameters = new StringBuilder();
-            Namespace paramsNs = params.getNamespace();
-            Iterator<Element> it = params.getChildren("property", paramsNs).iterator();
-            while (it.hasNext()) {
-                Element prop = it.next();
-                String name = prop.getChildTextTrim("name", paramsNs);
-                if (name != null) {
-                    if (conf.get(name) == null) {
-                        String defaultValue = prop.getChildTextTrim("value", paramsNs);
-                        if (defaultValue != null) {
-                            conf.set(name, defaultValue);
-                        } else {
-                            missingParameters.append(name);
-                            missingParameters.append(", ");
-                            numMissing++;
+        if (supportsParameters(rootElement.getNamespaceURI())) {
+            Element params = rootElement.getChild("parameters", rootElement.getNamespace());
+            if (params != null) {
+                int numMissing = 0;
+                StringBuilder missingParameters = new StringBuilder();
+                Namespace paramsNs = params.getNamespace();
+                Iterator<Element> it = params.getChildren("property", paramsNs).iterator();
+                while (it.hasNext()) {
+                    Element prop = it.next();
+                    String name = prop.getChildTextTrim("name", paramsNs);
+                    if (name != null) {
+                        if (name.isEmpty()) {
+                            throw new ParameterVerifierException(ErrorCode.E0739);
+                        }
+                        if (conf.get(name) == null) {
+                            String defaultValue = prop.getChildTextTrim("value", paramsNs);
+                            if (defaultValue != null) {
+                                conf.set(name, defaultValue);
+                            } else {
+                                missingParameters.append(name);
+                                missingParameters.append(", ");
+                                numMissing++;
+                            }
                         }
                     }
                 }
-            }
-            if (numMissing > 0) {
-                missingParameters.setLength(missingParameters.length() - 2);    //remove the trailing ", "
-                throw new ParameterVerifierException(ErrorCode.E0738, numMissing, missingParameters.toString());
-            }
-        } else {
-            // If the version is 0.4 or higher, log a warning when the <parameters> section is missing
-            String ns = rootElement.getNamespaceURI();
-            Matcher m = nsVersionPattern.matcher(ns);
-            if (m.matches() && m.groupCount() == 1) {
-                double v = Double.parseDouble(m.group(1));
-                if (v >= 0.4) {
-                    XLog.getLog(ParameterVerifier.class).warn("The application does not define formal parameters in its XML "
-                            + "definition");
+                if (numMissing > 0) {
+                    missingParameters.setLength(missingParameters.length() - 2);    //remove the trailing ", "
+                    throw new ParameterVerifierException(ErrorCode.E0738, numMissing, missingParameters.toString());
                 }
+            } else {
+                // Log a warning when the <parameters> section is missing
+                XLog.getLog(ParameterVerifier.class).warn("The application does not define formal parameters in its XML "
+                        + "definition");
             }
         }
     }
+    
+    static boolean supportsParameters(String namespaceURI) {
+        boolean supports = false;
+        Matcher m = nsVersionPattern.matcher(namespaceURI);
+        if (m.matches() && m.groupCount() == 2) {
+            String type = m.group(1);
+            double ver = Double.parseDouble(m.group(2));
+            supports = ((type.equals("workflow") && ver >= workflowMinVersion) || 
+                    (type.equals("coordinator") && ver >= coordinatorMinVersion) || 
+                    (type.equals("bundle") && ver >= bundleMinVersion));
+        }
+        return supports;
+    }
 }

Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/util/TestParameterVerifier.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/util/TestParameterVerifier.java?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/util/TestParameterVerifier.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/util/TestParameterVerifier.java Wed Aug  8 07:26:32 2012
@@ -121,4 +121,46 @@ public class TestParameterVerifier exten
         assertEquals(1, conf.size());
         assertEquals("planet", conf.get("hello"));
     }
+    
+    public void testVerifyParametersEmptyName() throws Exception {
+        Configuration conf = new Configuration(false);
+        
+        String str = "<root xmlns=\"uri:oozie:workflow:0.4\"><parameters>"
+                + "<property><name></name></property>"
+                + "</parameters></root>";
+        try {
+            ParameterVerifier.verifyParameters(conf, XmlUtils.parseXml(str));
+            fail();
+        } catch(ParameterVerifierException ex) {
+            assertEquals(ErrorCode.E0739, ex.getErrorCode());
+        }
+        
+        str = "<root xmlns=\"uri:oozie:workflow:0.4\"><parameters>"
+                + "<property><name>hello</name></property>"
+                + "<property><name></name></property>"
+                + "</parameters></root>";
+        try {
+            ParameterVerifier.verifyParameters(conf, XmlUtils.parseXml(str));
+            fail();
+        } catch(ParameterVerifierException ex) {
+            assertEquals(ErrorCode.E0739, ex.getErrorCode());
+        }
+    }
+    
+    public void testSupportsParameters() throws Exception {
+        assertFalse(ParameterVerifier.supportsParameters("uri:oozie:workflow:0.3"));
+        assertTrue(ParameterVerifier.supportsParameters("uri:oozie:workflow:0.4"));
+        assertTrue(ParameterVerifier.supportsParameters("uri:oozie:workflow:0.5"));
+        
+        assertFalse(ParameterVerifier.supportsParameters("uri:oozie:coordinator:0.3"));
+        assertTrue(ParameterVerifier.supportsParameters("uri:oozie:coordinator:0.4"));
+        assertTrue(ParameterVerifier.supportsParameters("uri:oozie:coordinator:0.5"));
+        
+        assertFalse(ParameterVerifier.supportsParameters("uri:oozie:bundle:0.1"));
+        assertTrue(ParameterVerifier.supportsParameters("uri:oozie:bundle:0.2"));
+        assertTrue(ParameterVerifier.supportsParameters("uri:oozie:bundle:0.3"));
+        
+        assertFalse(ParameterVerifier.supportsParameters("uri:oozie:foo:0.4"));
+        assertFalse(ParameterVerifier.supportsParameters("foo"));
+    }
 }

Modified: incubator/oozie/trunk/docs/src/site/twiki/BundleFunctionalSpec.twiki
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/docs/src/site/twiki/BundleFunctionalSpec.twiki?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/docs/src/site/twiki/BundleFunctionalSpec.twiki (original)
+++ incubator/oozie/trunk/docs/src/site/twiki/BundleFunctionalSpec.twiki Wed Aug  8 07:26:32 2012
@@ -159,6 +159,60 @@ A bundle definition is defined in XML by
 </bundle-app>
 </verbatim>
 
+---+++ 4.4.  Bundle Formal Parameters
+As of schema 0.2, a list of formal parameters can be provided which will allow Oozie to verify, at submission time, that said 
+properties are actually specified (i.e. before the job is executed and fails). Default values can also be provided. 
+
+*Example:*
+
+The previous Bundle Job application definition with formal parameters:
+
+<verbatim>
+<bundle-app name='APPNAME' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='uri:oozie:bundle:0.2'> 
+  <parameters>
+      <property>
+          <name>appPath</name>
+      </property>
+      <property>
+          <name>appPath2</name>
+          <value>hdfs://foo:9000/user/joe/job/job.properties</value>
+      </property>
+  </parameters>
+  <controls>
+       <kick-off-time>${kickOffTime}</kick-off-time>
+  </controls>
+   <coordinator name='coordJobFromBundle1' >
+       <app-path>${appPath}</app-path>
+       <configuration>
+         <property>
+              <name>startTime1</name>
+              <value>${START_TIME}</value>
+          </property>
+         <property>
+              <name>endTime1</name>
+              <value>${END_TIME}</value>
+          </property>
+      </configuration>
+   </coordinator>
+   <coordinator name='coordJobFromBundle2' >
+       <app-path>${appPath2}</app-path>
+       <configuration>
+         <property>
+              <name>startTime2</name>
+              <value>${START_TIME2}</value>
+          </property>
+         <property>
+              <name>endTime2</name>
+              <value>${END_TIME2}</value>
+          </property>
+      </configuration>
+   </coordinator>
+</bundle-app>
+</verbatim>
+
+In the above example, if =appPath= is not specified, Oozie will print an error message instead of submitting the job. If
+=appPath2= is not specified, Oozie will use the default value, =hdfs://foo:9000/user/joe/job/job.properties=.
+
 
 ---++ 5. User Propagation
 
@@ -238,7 +292,7 @@ Refer to the [[DG_CoordinatorRerun][Reru
 
 ---+++ Appendix A, Oozie Bundle XML-Schema
 
----++++ Oozie Bundle Schema
+---++++ Oozie Bundle Schema 0.1
 
 <verbatim>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bundle="uri:oozie:bundle:0.1"
@@ -286,6 +340,68 @@ Refer to the [[DG_CoordinatorRerun][Reru
 </xs:schema>
 </verbatim>
 
+---++++ Oozie Bundle Schema 0.2
+
+<verbatim>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bundle="uri:oozie:bundle:0.2"
+           elementFormDefault="qualified" targetNamespace="uri:oozie:bundle:0.2">
+
+    <xs:element name="bundle-app" type="bundle:BUNDLE-APP"/>
+    <xs:simpleType name="IDENTIFIER">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="BUNDLE-APP">
+        <xs:sequence>
+            <xs:element name="parameters" type="bundle:PARAMETERS" minOccurs="0" maxOccurs="1"/>
+            <xs:element name="controls" type="bundle:CONTROLS" minOccurs="0" maxOccurs="1"/>
+            <xs:element name="coordinator" type="bundle:COORDINATOR" minOccurs="1" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:string" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="PARAMETERS">
+        <xs:sequence>
+            <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="value" minOccurs="0" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CONTROLS">
+        <xs:sequence minOccurs="0" maxOccurs="1">
+            <xs:element name="kick-off-time" type="xs:string" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="COORDINATOR">
+        <xs:sequence  minOccurs="1" maxOccurs="1">
+            <xs:element name="app-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="configuration" type="bundle:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="bundle:IDENTIFIER" use="required"/>
+        <xs:attribute name="critical" type="xs:string" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="CONFIGURATION">
+        <xs:sequence>
+            <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
+                        <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+</xs:schema>
+</verbatim>
+
 
 [[index][::Go back to Oozie Documentation Index::]]
 

Modified: incubator/oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/release-log.txt?rev=1370681&r1=1370680&r2=1370681&view=diff
==============================================================================
--- incubator/oozie/trunk/release-log.txt (original)
+++ incubator/oozie/trunk/release-log.txt Wed Aug  8 07:26:32 2012
@@ -1,5 +1,6 @@
 -- Oozie 3.3.0 release (trunk - unreleased)
 
+OOZIE-942 Add formal Parameters to bundle XML (rkanter via virag)
 OOZIE-239 Add formal parameters to WF & COORD XML (rkanter via tucu)
 OOZIE-938 Remove some duplicated code in FsActionExecutor (rkanter via tucu)
 OOZIE-939 JT_PRINCIPAL and NN_PRINCIPAL must be added back to XOozieClient (rkanter via tucu)