Repository: nifi Updated Branches: refs/heads/master 4e7a856f7 -> 1ac5b9314
http://git-wip-us.apache.org/repos/asf/nifi/blob/1ac5b931/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java index e5455fd..fdcf285 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java @@ -18,15 +18,11 @@ package org.apache.nifi.hbase; import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; -import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.controller.ControllerService; -import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.hbase.put.PutColumn; import org.apache.nifi.hbase.put.PutFlowFile; import org.apache.nifi.hbase.scan.Column; import org.apache.nifi.hbase.scan.ResultHandler; -import org.apache.nifi.hbase.validate.ConfigFilesValidator; -import org.apache.nifi.processor.util.StandardValidators; import java.io.IOException; import java.util.Collection; @@ -36,52 +32,6 @@ import java.util.List; @CapabilityDescription("A controller service for accessing an HBase client.") public interface HBaseClientService extends ControllerService { - PropertyDescriptor HADOOP_CONF_FILES = new PropertyDescriptor.Builder() - .name("Hadoop Configuration Files") - .description("Comma-separated list of Hadoop Configuration files," + - " such as hbase-site.xml and core-site.xml for kerberos, " + - "including full paths to the files.") - .addValidator(new ConfigFilesValidator()) - .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) - .build(); - - PropertyDescriptor ZOOKEEPER_QUORUM = new PropertyDescriptor.Builder() - .name("ZooKeeper Quorum") - .description("Comma-separated list of ZooKeeper hosts for HBase. Required if Hadoop Configuration Files are not provided.") - .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) - .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) - .build(); - - PropertyDescriptor ZOOKEEPER_CLIENT_PORT = new PropertyDescriptor.Builder() - .name("ZooKeeper Client Port") - .description("The port on which ZooKeeper is accepting client connections. Required if Hadoop Configuration Files are not provided.") - .addValidator(StandardValidators.PORT_VALIDATOR) - .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) - .build(); - - PropertyDescriptor ZOOKEEPER_ZNODE_PARENT = new PropertyDescriptor.Builder() - .name("ZooKeeper ZNode Parent") - .description("The ZooKeeper ZNode Parent value for HBase (example: /hbase). Required if Hadoop Configuration Files are not provided.") - .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) - .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) - .build(); - - PropertyDescriptor HBASE_CLIENT_RETRIES = new PropertyDescriptor.Builder() - .name("HBase Client Retries") - .description("The number of times the HBase client will retry connecting. Required if Hadoop Configuration Files are not provided.") - .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) - .defaultValue("1") - .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) - .build(); - - PropertyDescriptor PHOENIX_CLIENT_JAR_LOCATION = new PropertyDescriptor.Builder() - .name("Phoenix Client JAR Location") - .description("The full path to the Phoenix client JAR. Required if Phoenix is installed on top of HBase.") - .addValidator(StandardValidators.FILE_EXISTS_VALIDATOR) - .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) - .dynamicallyModifiesClasspath(true) - .build(); - /** * Puts a batch of mutations to the given table. * http://git-wip-us.apache.org/repos/asf/nifi/blob/1ac5b931/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java deleted file mode 100644 index 9421440..0000000 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.hbase.validate; - -import org.apache.nifi.components.ValidationContext; -import org.apache.nifi.components.ValidationResult; -import org.apache.nifi.components.Validator; -import org.apache.nifi.processor.util.StandardValidators; - -public class ConfigFilesValidator implements Validator { - - @Override - public ValidationResult validate(final String subject, final String value, final ValidationContext context) { - final String[] filenames = value.split(","); - for (final String filename : filenames) { - final ValidationResult result = StandardValidators.FILE_EXISTS_VALIDATOR.validate(subject, filename.trim(), context); - if (!result.isValid()) { - return result; - } - } - - return new ValidationResult.Builder().subject(subject).input(value).valid(true).build(); - } -} http://git-wip-us.apache.org/repos/asf/nifi/blob/1ac5b931/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java index 9425846..78044c7 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java @@ -52,6 +52,7 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.controller.AbstractControllerService; import org.apache.nifi.controller.ConfigurationContext; import org.apache.nifi.controller.ControllerServiceInitializationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.hadoop.KerberosProperties; import org.apache.nifi.hadoop.SecurityUtil; import org.apache.nifi.hbase.put.PutColumn; @@ -59,6 +60,7 @@ import org.apache.nifi.hbase.put.PutFlowFile; import org.apache.nifi.hbase.scan.Column; import org.apache.nifi.hbase.scan.ResultCell; import org.apache.nifi.hbase.scan.ResultHandler; +import org.apache.nifi.hbase.validate.ConfigFilesValidator; import org.apache.nifi.kerberos.KerberosCredentialsService; import org.apache.nifi.processor.util.StandardValidators; import org.apache.nifi.reporting.InitializationException; @@ -100,6 +102,51 @@ public class HBase_1_1_2_ClientService extends AbstractControllerService impleme .required(false) .build(); + static final PropertyDescriptor HADOOP_CONF_FILES = new PropertyDescriptor.Builder() + .name("Hadoop Configuration Files") + .description("Comma-separated list of Hadoop Configuration files," + + " such as hbase-site.xml and core-site.xml for kerberos, " + + "including full paths to the files.") + .addValidator(new ConfigFilesValidator()) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + static final PropertyDescriptor ZOOKEEPER_QUORUM = new PropertyDescriptor.Builder() + .name("ZooKeeper Quorum") + .description("Comma-separated list of ZooKeeper hosts for HBase. Required if Hadoop Configuration Files are not provided.") + .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + static final PropertyDescriptor ZOOKEEPER_CLIENT_PORT = new PropertyDescriptor.Builder() + .name("ZooKeeper Client Port") + .description("The port on which ZooKeeper is accepting client connections. Required if Hadoop Configuration Files are not provided.") + .addValidator(StandardValidators.PORT_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + static final PropertyDescriptor ZOOKEEPER_ZNODE_PARENT = new PropertyDescriptor.Builder() + .name("ZooKeeper ZNode Parent") + .description("The ZooKeeper ZNode Parent value for HBase (example: /hbase). Required if Hadoop Configuration Files are not provided.") + .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + static final PropertyDescriptor HBASE_CLIENT_RETRIES = new PropertyDescriptor.Builder() + .name("HBase Client Retries") + .description("The number of times the HBase client will retry connecting. Required if Hadoop Configuration Files are not provided.") + .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) + .defaultValue("1") + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + static final PropertyDescriptor PHOENIX_CLIENT_JAR_LOCATION = new PropertyDescriptor.Builder() + .name("Phoenix Client JAR Location") + .description("The full path to the Phoenix client JAR. Required if Phoenix is installed on top of HBase.") + .addValidator(StandardValidators.FILE_EXISTS_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .dynamicallyModifiesClasspath(true) + .build(); static final String HBASE_CONF_ZK_QUORUM = "hbase.zookeeper.quorum"; static final String HBASE_CONF_ZK_PORT = "hbase.zookeeper.property.clientPort"; http://git-wip-us.apache.org/repos/asf/nifi/blob/1ac5b931/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java new file mode 100644 index 0000000..9421440 --- /dev/null +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/validate/ConfigFilesValidator.java @@ -0,0 +1,38 @@ +/* + * 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.hbase.validate; + +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.components.Validator; +import org.apache.nifi.processor.util.StandardValidators; + +public class ConfigFilesValidator implements Validator { + + @Override + public ValidationResult validate(final String subject, final String value, final ValidationContext context) { + final String[] filenames = value.split(","); + for (final String filename : filenames) { + final ValidationResult result = StandardValidators.FILE_EXISTS_VALIDATOR.validate(subject, filename.trim(), context); + if (!result.isValid()) { + return result; + } + } + + return new ValidationResult.Builder().subject(subject).input(value).valid(true).build(); + } +} http://git-wip-us.apache.org/repos/asf/nifi/blob/1ac5b931/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml index 6db2455..4b89407 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml @@ -28,6 +28,12 @@ <dependencies> <dependency> <groupId>org.apache.nifi</groupId> + <artifactId>nifi-jetty-bundle</artifactId> + <version>1.9.0-SNAPSHOT</version> + <type>nar</type> + </dependency> + <dependency> + <groupId>org.apache.nifi</groupId> <artifactId>nifi-ssl-context-service-api</artifactId> <scope>compile</scope> </dependency> http://git-wip-us.apache.org/repos/asf/nifi/blob/1ac5b931/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index cecfed2..80d8cf1 100644 --- a/pom.xml +++ b/pom.xml @@ -1,13 +1,13 @@ <?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 +<!-- 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -99,7 +99,7 @@ <repositories> <repository> <id>central</id> - <!-- This should be at top, it makes maven try the central repo + <!-- This should be at top, it makes maven try the central repo first and then others and hence faster dep resolution --> <name>Maven Repository</name> <url>https://repo1.maven.org/maven2</url> @@ -135,7 +135,7 @@ <dependencyManagement> <dependencies> - <!-- The following dependency management entries exist because these are jars + <!-- The following dependency management entries exist because these are jars that live in the top-level lib directory and will be present in the parent-first classloading of all child nars. Therefore we dont want child nars using different versions anyway.--> @@ -549,7 +549,7 @@ </module> <module name="OuterTypeFilename" /> <module name="LineLength"> - <!-- needs extra, because Eclipse formatter + <!-- needs extra, because Eclipse formatter ignores the ending left brace --> <property name="max" value="200" /> <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://" /> @@ -626,9 +626,9 @@ </build> <profiles> <profile> - <!-- Performs execution of Integration Tests using the Maven - FailSafe Plugin. The view of integration tests in this context are those - tests interfacing with external sources and services requiring additional + <!-- Performs execution of Integration Tests using the Maven + FailSafe Plugin. The view of integration tests in this context are those + tests interfacing with external sources and services requiring additional resources or credentials that cannot be explicitly provided. Also appropriate for tests which depend on inter-thread and/or network or having timing considerations which could make the tests brittle on various environments.--> @@ -651,11 +651,11 @@ </build> </profile> <profile> - <!-- Checks style and licensing requirements. This is a good - idea to run for contributions and for the release process. While it would - be nice to run always these plugins can considerably slow the build and have - proven to create unstable builds in our multi-module project and when building - using multiple threads. The stability issues seen with Checkstyle in multi-module + <!-- Checks style and licensing requirements. This is a good + idea to run for contributions and for the release process. While it would + be nice to run always these plugins can considerably slow the build and have + proven to create unstable builds in our multi-module project and when building + using multiple threads. The stability issues seen with Checkstyle in multi-module builds include false-positives and false negatives. --> <id>contrib-check</id> <build> @@ -692,11 +692,11 @@ </build> </profile> <profile> - <!-- This profile will disable DocLint which performs strict - JavaDoc processing which was introduced in JDK 8. These are technically errors - in the JavaDoc which we need to eventually address. However, if a release - is performed using JDK 8, the JavaDoc generation would fail. By activating - this profile when running on JDK 8 we can ensure the JavaDocs continue to + <!-- This profile will disable DocLint which performs strict + JavaDoc processing which was introduced in JDK 8. These are technically errors + in the JavaDoc which we need to eventually address. However, if a release + is performed using JDK 8, the JavaDoc generation would fail. By activating + this profile when running on JDK 8 we can ensure the JavaDocs continue to generate successfully --> <id>disable-doclint</id> <activation> @@ -716,15 +716,15 @@ </pluginManagement> </build> </profile> - <!-- The following profiles are here as a convenience for folks that - want to build against vendor-specific distributions of the various Hadoop - ecosystem libraries. These will alter which dependencies are sourced in a - manner that can adjust the correct LICENSE and NOTICE requirements for any - affected jar and the resulting assembly overall. These L&N impacts are not - automatically handled by the build process and are the responsibility of + <!-- The following profiles are here as a convenience for folks that + want to build against vendor-specific distributions of the various Hadoop + ecosystem libraries. These will alter which dependencies are sourced in a + manner that can adjust the correct LICENSE and NOTICE requirements for any + affected jar and the resulting assembly overall. These L&N impacts are not + automatically handled by the build process and are the responsibility of those creating and using the resulting binary artifacts. --> <profile> - <!-- This profile adds the Hortonworks repository for resolving + <!-- This profile adds the Hortonworks repository for resolving Hortonworks Data Platform (HDP) artifacts for the Hadoop bundles --> <id>hortonworks</id> <repositories> @@ -760,12 +760,12 @@ </repository> </repositories> <properties> - <!-- Vendor-specific version number included here as default, + <!-- Vendor-specific version number included here as default, should be overridden on the command-line <hadoop.version>2.7.1.2.4.0.0-169</hadoop.version> --> </properties> </profile> <profile> - <!-- This profile will add the MapR repository for resolving + <!-- This profile will add the MapR repository for resolving MapR Hadoop artifacts for the Hadoop bundles --> <id>mapr</id> <repositories> @@ -782,12 +782,12 @@ </repository> </repositories> <properties> - <!-- Vendor-specific version number included here as default, + <!-- Vendor-specific version number included here as default, should be overridden on the command-line <hadoop.version>2.7.0-mapr-1602</hadoop.version> --> </properties> </profile> <profile> - <!-- This profile will add the Cloudera repository for resolving + <!-- This profile will add the Cloudera repository for resolving Cloudera Distribution of Hadoop (CDH) artifacts for the Hadoop bundles --> <id>cloudera</id> <repositories> @@ -804,7 +804,7 @@ </repository> </repositories> <properties> - <!-- Vendor-specific version number included here as default, + <!-- Vendor-specific version number included here as default, should be overridden on the command-line <hadoop.version>2.6.0-cdh5.8.1</hadoop.version> --> </properties> </profile>
