You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2018/12/16 12:47:48 UTC

[GitHub] zenfenan commented on a change in pull request #3218: NIFI-5895 - Add a processor to start an Oozie workflow

zenfenan commented on a change in pull request #3218: NIFI-5895 - Add a processor to start an Oozie workflow
URL: https://github.com/apache/nifi/pull/3218#discussion_r241979160
 
 

 ##########
 File path: nifi-nar-bundles/nifi-oozie-bundle/nifi-oozie-processors/src/main/java/org/apache/nifi/processors/oozie/SubmitOozieWorkflow.java
 ##########
 @@ -0,0 +1,249 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.processors.oozie;
+
+import static org.apache.commons.lang3.StringUtils.trimToEmpty;
+
+import java.io.IOException;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.net.ssl.SSLContext;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.expression.AttributeExpression;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.hadoop.SecurityUtil;
+import org.apache.nifi.kerberos.KerberosCredentialsService;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.processors.oozie.util.SslAuthOozieClient;
+import org.apache.nifi.ssl.RestrictedSSLContextService;
+import org.apache.nifi.ssl.SSLContextService.ClientAuth;
+import org.apache.oozie.client.AuthOozieClient.AuthType;
+import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.client.OozieClientException;
+
+@Tags({"oozie", "job", "workflow"})
+@CapabilityDescription("This processor is used to submit and start an Oozie workflow")
+@WritesAttributes({@WritesAttribute(attribute="oozie.workflow.job.id", description="Job ID for the submitted workflow")})
+@InputRequirement(Requirement.INPUT_REQUIRED)
+public class SubmitOozieWorkflow extends AbstractProcessor {
+
+    private final static String OOZIE_WORKFLOW_JOB_ID = "oozie.workflow.job.id";
+
+    public static final PropertyDescriptor URL = new PropertyDescriptor.Builder()
+            .name("oozie-url")
+            .displayName("Oozie server URL")
+            .description("The URL of the Oozie server. Example: http://oozie.example.com:11000/oozie")
+            .required(true)
+            .addValidator(StandardValidators.URL_VALIDATOR)
+            .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
+            .build();
+
+    public static final PropertyDescriptor APP_PATH = new PropertyDescriptor.Builder()
+            .name("oozie-app-path")
+            .displayName("HDFS Application Path")
 
 Review comment:
   I would recommend it to be changed to something like `Workflow Path`. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services