[
https://issues.apache.org/jira/browse/NIFI-4118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074105#comment-16074105
]
ASF GitHub Bot commented on NIFI-4118:
--------------------------------------
Github user jvwing commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1942#discussion_r125534346
--- Diff:
nifi-nar-bundles/nifi-rethinkdb-bundle/nifi-rethinkdb-processors/src/main/java/org/apache/nifi/processors/rethinkdb/AbstractRethinkDbProcessor.java
---
@@ -0,0 +1,170 @@
+/*
+ * 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.rethinkdb;
+
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.DataUnit;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.util.StandardValidators;
+import com.rethinkdb.RethinkDB;
+import com.rethinkdb.gen.ast.Table;
+import com.rethinkdb.net.Connection;
+
+/**
+ * Abstract base class for RethinkDb processors
+ */
+abstract class AbstractRethinkDbProcessor extends AbstractProcessor {
+
+ protected static final PropertyDescriptor CHARSET = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-charset")
+ .displayName("Character Set")
+ .description("Specifies the character set of the document
data.")
+ .required(true)
+ .defaultValue("UTF-8")
+ .expressionLanguageSupported(true)
+ .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor DB_NAME = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-dbname")
+ .displayName("DB Name")
+ .description("RethinkDb database to connect to")
+ .required(true)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor DB_HOST = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-host")
+ .displayName("Hostname")
+ .description("RethinkDb hostname")
+ .required(true)
+ .defaultValue("localhost")
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor DB_PORT = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-port")
+ .displayName("DB Port")
+ .description("RethinkDb database port to connect to")
+ .required(true)
+ .defaultValue("28015")
+ .addValidator(StandardValidators.PORT_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor USERNAME = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-username")
+ .displayName("Username")
+ .description("Username for accessing RethinkDb")
+ .required(false)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor PASSWORD = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-password")
+ .displayName("Password")
+ .description("Password for user")
+ .required(false)
+ .sensitive(true)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor TABLE_NAME = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-table")
+ .displayName("Table name")
+ .description("RethinkDb table to connect to")
+ .required(true)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+ protected static final PropertyDescriptor MAX_DOCUMENTS_SIZE = new
PropertyDescriptor.Builder()
+ .name("rethinkdb-max-document-size")
+ .displayName("Max size of documents in MBs")
+ .description("Maximum size of documents allowed to be posted
in one batch")
+ .defaultValue("1 MB")
+ .required(true)
+ .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
+ .build();
+
+ static final Relationship REL_SUCCESS = new
Relationship.Builder().name("success")
+ .description("Sucessful FlowFiles are routed to this
relationship").build();
+
+ static final Relationship REL_FAILURE = new
Relationship.Builder().name("success")
--- End diff --
Should this be named `failure`?
> Create Nifi RethinkDB Put processor
> -----------------------------------
>
> Key: NIFI-4118
> URL: https://issues.apache.org/jira/browse/NIFI-4118
> Project: Apache NiFi
> Issue Type: New Feature
> Components: Extensions
> Affects Versions: 1.3.0
> Environment: All
> Reporter: Mans Singh
> Assignee: Mans Singh
> Priority: Minor
> Labels: document, stream,
> Fix For: 1.4.0
>
>
> Create Nifi processor for streaming documents into RethinkDB.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)