Search in sources :

Example 1 with KerberosProperties

use of com.thinkbiganalytics.nifi.security.KerberosProperties in project kylo by Teradata.

the class ExecutePySpark method init.

@Override
protected void init(@Nonnull final ProcessorInitializationContext context) {
    super.init(context);
    /* Create Kerberos properties */
    final SpringSecurityContextLoader securityContextLoader = SpringSecurityContextLoader.create(context);
    final KerberosProperties kerberosProperties = securityContextLoader.getKerberosProperties();
    KERBEROS_KEYTAB = kerberosProperties.createKerberosKeytabProperty();
    KERBEROS_PRINCIPAL = kerberosProperties.createKerberosPrincipalProperty();
    /* Create list of properties */
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(KERBEROS_PRINCIPAL);
    properties.add(KERBEROS_KEYTAB);
    properties.add(HADOOP_CONFIGURATION_RESOURCES);
    properties.add(PYSPARK_APP_FILE);
    properties.add(PYSPARK_APP_ARGS);
    properties.add(PYSPARK_APP_NAME);
    properties.add(PYSPARK_ADDITIONAL_FILES);
    properties.add(SPARK_MASTER);
    properties.add(SPARK_YARN_DEPLOY_MODE);
    properties.add(YARN_QUEUE);
    properties.add(SPARK_HOME);
    properties.add(DRIVER_MEMORY);
    properties.add(EXECUTOR_MEMORY);
    properties.add(EXECUTOR_INSTANCES);
    properties.add(EXECUTOR_CORES);
    properties.add(NETWORK_TIMEOUT);
    properties.add(ADDITIONAL_SPARK_CONFIG_OPTIONS);
    this.properties = Collections.unmodifiableList(properties);
    /* Create list of relationships */
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
Also used : PropertyDescriptor(org.apache.nifi.components.PropertyDescriptor) SpringSecurityContextLoader(com.thinkbiganalytics.nifi.security.SpringSecurityContextLoader) Relationship(org.apache.nifi.processor.Relationship) ArrayList(java.util.ArrayList) KerberosProperties(com.thinkbiganalytics.nifi.security.KerberosProperties) HashSet(java.util.HashSet)

Example 2 with KerberosProperties

use of com.thinkbiganalytics.nifi.security.KerberosProperties in project kylo by Teradata.

the class ExecuteSparkJob method init.

@Override
protected void init(@Nonnull final ProcessorInitializationContext context) {
    super.init(context);
    // Create Kerberos properties
    final SpringSecurityContextLoader securityContextLoader = SpringSecurityContextLoader.create(context);
    final KerberosProperties kerberosProperties = securityContextLoader.getKerberosProperties();
    kerberosKeyTab = kerberosProperties.createKerberosKeytabProperty();
    kerberosPrincipal = kerberosProperties.createKerberosPrincipalProperty();
    // Create list of properties
    final List<PropertyDescriptor> pds = new ArrayList<>();
    pds.add(APPLICATION_JAR);
    pds.add(EXTRA_JARS);
    pds.add(MAIN_CLASS);
    pds.add(MAIN_ARGS);
    pds.add(SPARK_MASTER);
    pds.add(SPARK_YARN_DEPLOY_MODE);
    pds.add(SPARK_HOME);
    pds.add(PROCESS_TIMEOUT);
    pds.add(DRIVER_MEMORY);
    pds.add(EXECUTOR_MEMORY);
    pds.add(NUMBER_EXECUTORS);
    pds.add(SPARK_APPLICATION_NAME);
    pds.add(EXECUTOR_CORES);
    pds.add(NETWORK_TIMEOUT);
    pds.add(HADOOP_CONFIGURATION_RESOURCES);
    pds.add(kerberosPrincipal);
    pds.add(kerberosKeyTab);
    pds.add(YARN_QUEUE);
    pds.add(SPARK_CONFS);
    pds.add(EXTRA_SPARK_FILES);
    pds.add(DATASOURCES);
    pds.add(METADATA_SERVICE);
    propDescriptors = Collections.unmodifiableList(pds);
}
Also used : PropertyDescriptor(org.apache.nifi.components.PropertyDescriptor) SpringSecurityContextLoader(com.thinkbiganalytics.nifi.security.SpringSecurityContextLoader) ArrayList(java.util.ArrayList) KerberosProperties(com.thinkbiganalytics.nifi.security.KerberosProperties)

Example 3 with KerberosProperties

use of com.thinkbiganalytics.nifi.security.KerberosProperties in project kylo by Teradata.

the class AbstractHadoopProcessor method init.

@Override
protected void init(@Nonnull final ProcessorInitializationContext context) {
    super.init(context);
    hdfsResources.set(new HdfsResources(null, null, null));
    // Create Kerberos properties
    final SpringSecurityContextLoader securityContextLoader = SpringSecurityContextLoader.create(context);
    final KerberosProperties kerberosProperties = securityContextLoader.getKerberosProperties();
    kerberosKeytab = kerberosProperties.createKerberosKeytabProperty();
    kerberosPrincipal = kerberosProperties.createKerberosPrincipalProperty();
    // Create list of properties
    final List<PropertyDescriptor> props = new ArrayList<>();
    props.add(HADOOP_CONFIGURATION_RESOURCES);
    props.add(kerberosPrincipal);
    props.add(kerberosKeytab);
    props.add(KerberosProperties.KERBEROS_RELOGIN_PERIOD);
    properties = Collections.unmodifiableList(props);
}
Also used : PropertyDescriptor(org.apache.nifi.components.PropertyDescriptor) SpringSecurityContextLoader(com.thinkbiganalytics.nifi.security.SpringSecurityContextLoader) ArrayList(java.util.ArrayList) KerberosProperties(com.thinkbiganalytics.nifi.security.KerberosProperties)

Example 4 with KerberosProperties

use of com.thinkbiganalytics.nifi.security.KerberosProperties in project kylo by Teradata.

the class ExportSqoop method init.

@Override
protected void init(@Nonnull final ProcessorInitializationContext context) {
    super.init(context);
    /* Create Kerberos properties */
    final SpringSecurityContextLoader securityContextLoader = SpringSecurityContextLoader.create(context);
    final KerberosProperties kerberosProperties = securityContextLoader.getKerberosProperties();
    KERBEROS_KEYTAB = kerberosProperties.createKerberosKeytabProperty();
    KERBEROS_PRINCIPAL = kerberosProperties.createKerberosPrincipalProperty();
    /* Create list of properties */
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(KERBEROS_PRINCIPAL);
    properties.add(KERBEROS_KEYTAB);
    properties.add(SQOOP_CONNECTION_SERVICE);
    properties.add(SOURCE_HDFS_DIRECTORY);
    properties.add(SOURCE_HDFS_FILE_DELIMITER);
    properties.add(SOURCE_NULL_INTERPRETATION_STRATEGY);
    properties.add(SOURCE_NULL_CUSTOM_STRING_IDENTIFIER);
    properties.add(SOURCE_NULL_CUSTOM_NON_STRING_IDENTIFIER);
    properties.add(HCATALOG_DATABASE);
    properties.add(HCATALOG_TABLE);
    properties.add(SQOOP_SYSTEM_PROPERTIES);
    properties.add(SQOOP_ADDITIONAL_ARGUMENTS);
    properties.add(TARGET_TABLE_NAME);
    properties.add(CLUSTER_MAP_TASKS);
    this.properties = Collections.unmodifiableList(properties);
    /* Create list of relationships */
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
Also used : PropertyDescriptor(org.apache.nifi.components.PropertyDescriptor) SpringSecurityContextLoader(com.thinkbiganalytics.nifi.security.SpringSecurityContextLoader) Relationship(org.apache.nifi.processor.Relationship) ArrayList(java.util.ArrayList) KerberosProperties(com.thinkbiganalytics.nifi.security.KerberosProperties) HashSet(java.util.HashSet)

Example 5 with KerberosProperties

use of com.thinkbiganalytics.nifi.security.KerberosProperties in project kylo by Teradata.

the class ThriftConnectionPool method init.

@Override
protected void init(@Nonnull final ControllerServiceInitializationContext config) throws InitializationException {
    // Create Kerberos properties
    final SpringSecurityContextLoader securityContextLoader = SpringSecurityContextLoader.create(config);
    final KerberosProperties kerberosProperties = securityContextLoader.getKerberosProperties();
    kerberosKeytab = kerberosProperties.createKerberosKeytabProperty();
    kerberosPrincipal = kerberosProperties.createKerberosPrincipalProperty();
    // Create list of properties
    final List<PropertyDescriptor> props = new ArrayList<>();
    props.add(DATABASE_URL);
    props.add(DB_DRIVERNAME);
    props.add(DB_DRIVER_JAR_URL);
    props.add(DB_USER);
    props.add(DB_PASSWORD);
    props.add(DB_VALIDATION_QUERY);
    props.add(DB_VALIDATION_QUERY_TIMEOUT);
    props.add(MAX_WAIT_TIME);
    props.add(MAX_TOTAL_CONNECTIONS);
    props.add(HADOOP_CONFIGURATION_RESOURCES);
    props.add(kerberosPrincipal);
    props.add(kerberosKeytab);
    properties = Collections.unmodifiableList(props);
}
Also used : PropertyDescriptor(org.apache.nifi.components.PropertyDescriptor) SpringSecurityContextLoader(com.thinkbiganalytics.nifi.security.SpringSecurityContextLoader) ArrayList(java.util.ArrayList) KerberosProperties(com.thinkbiganalytics.nifi.security.KerberosProperties)

Aggregations

KerberosProperties (com.thinkbiganalytics.nifi.security.KerberosProperties)6 SpringSecurityContextLoader (com.thinkbiganalytics.nifi.security.SpringSecurityContextLoader)6 ArrayList (java.util.ArrayList)6 PropertyDescriptor (org.apache.nifi.components.PropertyDescriptor)6 HashSet (java.util.HashSet)3 Relationship (org.apache.nifi.processor.Relationship)3