Package org.jdom

Examples of org.jdom.Namespace


        String consoleUrl = action.getConsoleUrl();
        assertNotNull(jobId);
        assertNotNull(jobTracker);
        assertNotNull(consoleUrl);
        Element e = XmlUtils.parseXml(action.getConf());
        Namespace ns = Namespace.getNamespace("uri:oozie:hive-action:0.2");
        XConfiguration conf =
                new XConfiguration(new StringReader(XmlUtils.prettyPrint(e.getChild("configuration", ns)).toString()));
        conf.set("mapred.job.tracker", e.getChildTextTrim("job-tracker", ns));
        conf.set("fs.default.name", e.getChildTextTrim("name-node", ns));
        conf.set("user.name", context.getProtoActionConf().get("user.name"));
View Full Code Here


     * If found, the job is not submitted and user is informed to correct the error, instead of defaulting to the first instance value in the list
     */
    private void checkMultipleTimeInstances(Element eCoordJob, String eventType, String dataType) throws CoordinatorJobException {
        Element eventsSpec, dataSpec, instance;
        List<Element> instanceSpecList;
        Namespace ns = eCoordJob.getNamespace();
        String instanceValue;
        eventsSpec = eCoordJob.getChild(eventType, ns);
        if (eventsSpec != null) {
            dataSpec = eventsSpec.getChild(dataType, ns);
            if (dataSpec != null) {
View Full Code Here

     * @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");
            }
        }
View Full Code Here

    @Override
    protected Configuration setupLauncherConf(Configuration conf, Element actionXml, Path appPath, Context context)
            throws ActionExecutorException {
        super.setupLauncherConf(conf, actionXml, appPath, context);
        Namespace ns = actionXml.getNamespace();
        String script = actionXml.getChild("script", ns).getTextTrim();
        String pigName = new Path(script).getName();
        String pigScriptContent = context.getProtoActionConf().get(XOozieClient.PIG_SCRIPT);

        Path pigScriptFile = null;
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    Configuration setupActionConf(Configuration actionConf, Context context, Element actionXml, Path appPath)
            throws ActionExecutorException {
        super.setupActionConf(actionConf, context, actionXml, appPath);
        Namespace ns = actionXml.getNamespace();

        String script = actionXml.getChild("script", ns).getTextTrim();
        String pigName = new Path(script).getName();

        List<Element> params = (List<Element>) actionXml.getChildren("param", ns);
View Full Code Here

    }

    @Override
    protected String getLauncherMain(Configuration launcherConf, Element actionXml) {
        String mainClass;
        Namespace ns = actionXml.getNamespace();
        if (actionXml.getChild("streaming", ns) != null) {
            mainClass = launcherConf.get(LauncherMapper.CONF_OOZIE_ACTION_MAIN_CLASS, StreamingMain.class.getName());
        }
        else {
            if (actionXml.getChild("pipes", ns) != null) {
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    Configuration setupActionConf(Configuration actionConf, Context context, Element actionXml, Path appPath)
            throws ActionExecutorException {
        Namespace ns = actionXml.getNamespace();
        if (actionXml.getChild("streaming", ns) != null) {
            Element streamingXml = actionXml.getChild("streaming", ns);
            String mapper = streamingXml.getChildTextTrim("mapper", ns);
            String reducer = streamingXml.getChildTextTrim("reducer", ns);
            String recordReader = streamingXml.getChildTextTrim("record-reader", ns);
View Full Code Here

    // Return the value of the specified configuration property
    private String evaluateConfigurationProperty(Element actionConf, String key, String defaultValue) throws ActionExecutorException {
        try {
            if (actionConf != null) {
                Namespace ns = actionConf.getNamespace();
                Element e = actionConf.getChild("configuration", ns);
                String strConf = XmlUtils.prettyPrint(e).toString();
                XConfiguration inlineConf = new XConfiguration(new StringReader(strConf));
                return inlineConf.get(key, defaultValue);
            }
View Full Code Here

     * @param actionXml the action XML.
     * @return the action sharelib post fix, this implementation returns <code>NULL</code>
     * or <code>streaming</code> if the mapreduce action is streaming.
     */
    protected String getShareLibPostFix(Context context, Element actionXml) {
        Namespace ns = actionXml.getNamespace();
        return (actionXml.getChild("streaming", ns) != null) ? "mapreduce-streaming" : null;
    }
View Full Code Here

        //verifying is a valid WF
        WorkflowAppService wps = Services.get().get(WorkflowAppService.class);
        wps.parseDef(xml);

        Element wfE = XmlUtils.parseXml(xml);
        Namespace ns = wfE.getNamespace();
        Element actionE = wfE.getChild("action", ns).getChild("map-reduce", ns);
        Element confE = actionE.getChild("configuration", ns);
        Map<String, String> props = new HashMap<String, String>();
        for (Object prop : confE.getChildren("property", ns)) {
            Element propE = (Element) prop;
View Full Code Here

TOP

Related Classes of org.jdom.Namespace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.