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 2019/12/30 22:09:57 UTC

[GitHub] [nifi] phrocker commented on a change in pull request #3926: NIFI-818: Initial implementation of Apache Accumulo on NiFi

phrocker commented on a change in pull request #3926: NIFI-818: Initial implementation of Apache Accumulo on NiFi
URL: https://github.com/apache/nifi/pull/3926#discussion_r362108338
 
 

 ##########
 File path: nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/src/main/java/org/apache/nifi/accumulo/processors/BaseAccumuloProcessor.java
 ##########
 @@ -0,0 +1,82 @@
+/*
+ * 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.accumulo.processors;
+
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.accumulo.controllerservices.BaseAccumuloService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Base Accumulo class that provides connector services, table name, and thread
+ * properties
+ */
+public abstract class BaseAccumuloProcessor extends AbstractProcessor {
+
+    protected static final PropertyDescriptor ACCUMULO_CONNECTOR_SERVICE = new PropertyDescriptor.Builder()
+            .name("Accumulo Connector Service")
+            .description("Specifies the Controller Service to use for accessing Accumulo.")
+            .required(true)
+            .identifiesControllerService(BaseAccumuloService.class)
+            .build();
+
+
+    protected static final PropertyDescriptor TABLE_NAME = new PropertyDescriptor.Builder()
+            .name("Table Name")
+            .description("The name of the Accumulo Table into which data will be placed")
+            .required(true)
+            .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    protected static final PropertyDescriptor CREATE_TABLE = new PropertyDescriptor.Builder()
+            .name("Create Table")
+            .description("Creates a table if it does not exist. This property will only be used when EL is not present in 'Table Name'")
+            .required(true)
+            .defaultValue("False")
+            .allowableValues("True", "False")
+            .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
+            .build();
+
+
+    protected static final PropertyDescriptor THREADS = new PropertyDescriptor.Builder()
+            .name("Threads")
+            .description("Number of threads used for reading and writing")
+            .required(false)
+            .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
+            .defaultValue("10")
+            .build();
+
+
+    @Override
+    public List<PropertyDescriptor> getSupportedPropertyDescriptors() {
 
 Review comment:
   Good point. I've noticed a lot of hygiene stuff cropping up after I made some custom extensions ( not in this package ). The ones you've noted and the ones I noted will be resolved in the next commit. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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