[jira] [Resolved] (NIFI-5501) MySQL connection cleanup thread leak

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-5501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann resolved NIFI-5501.

Resolution: Invalid

This bug is related to the MySQL JDBC Driver, which is referenced in NiFi 
components, but is maintained and distributed directly from the vendor.

> MySQL connection cleanup thread leak
> 
>
> Key: NIFI-5501
> URL: https://issues.apache.org/jira/browse/NIFI-5501
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.7.1
> Environment: - Ubuntu 18.04 LTS
> - mysql-connector-java-5.1.46
> - Java 1.8.0_171
>Reporter: Tanapol Nearunchorn
>Priority: Major
> Attachments: nifi-threaddump.txt
>
>
> There are thousands of "Abandoned connection cleanup thread" left running 
> that cause memory leak in NiFi.
> I got a thread dump example here (full thread dump also attached):
> {code:java}
> "Abandoned connection cleanup thread" #18371 daemon prio=5 os_prio=0 
> tid=0x7f3b840e7800 nid=0x76a3 in Object.wait() [0x7f3b24ebb000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
> - locked <0x000348a12628> (a java.lang.ref.ReferenceQueue$Lock)
> at 
> com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> Locked ownable synchronizers:
> - <0x000348a12648> (a java.util.concurrent.ThreadPoolExecutor$Worker)
> {code}
> I'm not sure where these threads come from which component because in my 
> flow, I used CaptureChangeMySQL processor and DBCPConnectionPool controller 
> service.
> As I also found related problem here: [mysql Bug 
> #69526|https://bugs.mysql.com/bug.php?id=69526] but it quite a bit old.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (NIFI-8517) Cannot enable Distributed Map Cache Client in CaptureChangeMySQL

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-8517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann resolved NIFI-8517.

  Assignee: David Handermann
Resolution: Information Provided

The {{No suitable driver found}} error indicates that the {{MySQL Driver 
Locations}} property does not reference a working MySQL JDBC Driver JAR file. 
The Distributed Map Cache Client is optional for CaptureChangeMySQL, but it 
enables enriched information of binary log events, such as Table Names.

> Cannot enable Distributed Map Cache Client in CaptureChangeMySQL
> 
>
> Key: NIFI-8517
> URL: https://issues.apache.org/jira/browse/NIFI-8517
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.12.1, 1.13.2
>Reporter: Luki
>Assignee: David Handermann
>Priority: Major
>  Labels: features
> Attachments: Screen Shot 2021-05-05 at 19.50.24.png, reproduction.xml
>
>
> If I don't enable the Distributed Map Cache Client property in the 
> CaptureChangeMySQL processor I get a warning log:
> {{"No Distributed Map Cache Client is specified, so no event enrichment 
> (resolution of column names, e.g.) will be performed."}}
>  
> If I enable the Distributed Map Cache Client I get the following error:
> {{"Error creating binlog enrichment JDBC connection to any of the specified 
> hosts"}}
>  
> Both DistributedMapCacheServer and DistributedMapCacheClientService are 
> running fine, I can communicate with the server on localhost:4557.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (NIFI-10324) Convert additional website pages to Markdown

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann resolved NIFI-10324.
-
Resolution: Fixed

> Convert additional website pages to Markdown
> 
>
> Key: NIFI-10324
> URL: https://issues.apache.org/jira/browse/NIFI-10324
> Project: Apache NiFi
>  Issue Type: Task
>  Components: Documentation & Website
>Reporter: David Handermann
>Assignee: David Handermann
>Priority: Minor
>
> Following the migration to Hugo, additional Apache NiFi website pages should 
> be converted to Markdown for simplified maintenance and potential future 
> redesign.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-10358) Apply SSL Properties to JDBC Connection in CaptureChangeMySQL

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-10358:

Status: Patch Available  (was: In Progress)

> Apply SSL Properties to JDBC Connection in CaptureChangeMySQL
> -
>
> Key: NIFI-10358
> URL: https://issues.apache.org/jira/browse/NIFI-10358
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Extensions
>Reporter: David Handermann
>Assignee: David Handermann
>Priority: Minor
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The {{CaptureChangeMySQL}} Processor supports TLS for Binary Log connections 
> using the {{SSL Mode}} and {{SSL Context Service}} properties, but these 
> settings do not apply to the JDBC enrichment connection.
> Without apply the SSL properties to the JDBC connection, 
> {{CaptureChangeMySQL}} depends on the default MySQL JDBC Connector 
> configuration to negotiate TLS settings. MySQL JDBC Connector versions prior 
> to 8.0.28 enable deprecated TLS versions 1.0 and 1.1, but Java 8 Update 292 
> and following disable TLS 1.0 and 1.1 in the default java.security 
> configuration. As a result of this behavior, {{CaptureChangeMySQL}} can fail 
> to establish a JDBC connection when running on a newer version of Java and an 
> older version of the MySQL JDBC Connector. It is possible to work around the 
> problem by upgrading to MySQL JDBC Connector 8.0.28 and following, which 
> selects TLS 1.2 as the default protocol version. Although this resolves TLS 
> protocol negotiation issues, it does not support customization of the TLS 
> keystore and truststore properties, which may be necessary for some MySQL 
> installations.
> Configuring the JDBC connection properties based on the {{SSL Mode}} and 
> {{SSL Context Service}} properties should provide a more intuitive and 
> flexible configuration approach.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] exceptionfactory opened a new pull request, #6306: NIFI-10358 Update CaptureChangeMySQL to use SSL JDBC properties

2022-08-16 Thread GitBox


exceptionfactory opened a new pull request, #6306:
URL: https://github.com/apache/nifi/pull/6306

   # Summary
   
   [NIFI-10358](https://issues.apache.org/jira/browse/NIFI-10358) Updates the 
`CaptureChangeMySQL` Processor apply `SSL Mode` and `SSL Context Service` 
configuration settings to the enrichment JDBC connection.
   
   In addition to the primary binary log connection, the `CaptureChangeMySQL` 
Processor maintains a secondary JDBC connection to the MySQL server when 
configured with a `Distributed Map Cache Client` to provide schema information.
   
   Recent versions of the MySQL Connector for Java attempt to negotiate a TLS 
connection in the default configuration, based on MySQL server support for TLS. 
MySQL JDBC Driver versions prior to 8.0.28 have TLS 1.0 and TLS 1.1 enabled, 
which can result in connection attempts throwing an `SSLException` when running 
Apache NiFi on versions of Java that disable those deprecated TLS protocol 
versions.
   
   In addition to TLS protocol negotiation issues, the `CaptureChangeMySQL` 
Processor does not support the option to configure JDBC connection properties. 
Updating the Processor to set MySQL JDBC connection properties based on the 
`SSL Mode` selected provides a more intuitive configuration and improves 
support for TLS negotiation using certificates issued by private certificate 
authorities.
   
   The implementation leverages several [MySQL Connector Security 
Properties](https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-connp-props-security.html)
 that have been deprecated, but remain supported. This approach enables 
compatibility with a wide range of MySQL JDBC Driver versions.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-0`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [X] Build completed using `mvn clean install -P contrib-check`
 - [X] JDK 8
 - [X] JDK 11
 - [X] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] mr1716 commented on pull request #6305: NIFI-10361: Upgrade commons-jexl3 to version 3.2.1

2022-08-16 Thread GitBox


mr1716 commented on PR #6305:
URL: https://github.com/apache/nifi/pull/6305#issuecomment-1217303517

   This built successfully when I did the pull request earlier.


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1367: MINIFICPP-1822 - Add alert capability

2022-08-16 Thread GitBox


szaszm commented on code in PR #1367:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1367#discussion_r945896725


##
libminifi/include/utils/Hash.h:
##
@@ -0,0 +1,31 @@
+/**
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include 
+
+namespace org::apache::nifi::minifi::utils {
+
+// boost::hash_combine

Review Comment:
   Please clarify that this is coming from the docs, not the sources. Copying 
the source would require appropriate LICENSE/NOTICE changes, while 
reimplementing what the docs document is a new work from a copyright 
perspective.



##
libminifi/src/utils/TimeUtil.cpp:
##
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+
+#include "utils/TimeUtil.h"
+
+namespace org::apache::nifi::minifi::utils::timeutils {
+
+static std::mutex global_clock_mtx;
+static std::shared_ptr global_clock{std::make_shared()};
+
+std::shared_ptr getClock() {
+  std::lock_guard lock(global_clock_mtx);
+  return global_clock;
+}
+
+// test-only utility to specify what clock to use
+void setClock(std::shared_ptr clock) {
+  std::lock_guard lock(global_clock_mtx);
+  global_clock = std::move(clock);
+}

Review Comment:
   These globals can be avoided. Please use dependency injection.



##
libminifi/include/utils/Hash.h:
##
@@ -0,0 +1,31 @@
+/**
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include 
+
+namespace org::apache::nifi::minifi::utils {
+
+// boost::hash_combine
+inline size_t hash_combine(size_t seed, size_t h) noexcept {
+  seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
+  return seed;
+}

Review Comment:
   If we want to follow the boost interface:
   ```suggestion
   inline void hash_combine(size_t& seed, size_t new_hash) noexcept {
 seed ^= new_hash + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
   }
   ```
   
   or simplify if not:
   ```suggestion
   inline size_t hash_combine(size_t seed, size_t new_hash) noexcept {
 return seed ^ new_hash + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
   }
   ```
   
   I changed the second parameter name in both suggestions to be more 
descriptive.
   
   I would go for the first version, but I'm fine with either one.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] Lehel44 commented on a diff in pull request #6301: NIFI-10356: Create GetHubSpot processor

2022-08-16 Thread GitBox


Lehel44 commented on code in PR #6301:
URL: https://github.com/apache/nifi/pull/6301#discussion_r947285954


##
nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java:
##
@@ -0,0 +1,320 @@
+/*
+ * 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.hubspot;
+
+import com.fasterxml.jackson.core.JsonEncoding;
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
+import org.apache.nifi.annotation.behavior.PrimaryNodeOnly;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.TriggerSerially;
+import org.apache.nifi.annotation.behavior.TriggerWhenEmpty;
+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.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.state.Scope;
+import org.apache.nifi.components.state.StateMap;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.web.client.api.HttpResponseEntity;
+import org.apache.nifi.web.client.api.HttpUriBuilder;
+import org.apache.nifi.web.client.provider.api.WebClientServiceProvider;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@PrimaryNodeOnly
+@TriggerSerially
+@TriggerWhenEmpty
+@InputRequirement(Requirement.INPUT_FORBIDDEN)
+@Tags({"hubspot"})
+@CapabilityDescription("Retrieves JSON data from a private HubSpot 
application."
++ " Supports incremental retrieval: Users can set the \"limit\" 
property which serves as the upper limit of the retrieved objects."
++ " When this property is set the processor will retrieve new records. 
This processor is intended to be run on the Primary Node only.")
+@Stateful(scopes = Scope.CLUSTER, description = "When the 'Limit' attribute is 
set, the paging cursor is saved after executing a request."
++ " Only the objects after the paging cursor will be retrieved. The 
maximum number of retrieved objects is the 'Limit' attribute."
++ " State is stored across the cluster so that this Processor can be 
run on Primary Node only and if a new Primary Node is selected,"
++ " the new node can pick up where the previous node left off, without 
duplicating the data.")
+public class GetHubSpot extends AbstractProcessor {
+
+// OBJECTS
+
+static final AllowableValue COMPANIES = new AllowableValue(
+"/crm/v3/objects/companies",
+"Companies",
+"In HubSpot, the companies object is a standard CRM object. 
Individual company records can be used to store information about businesses" +
+" and organizations within company properties."
+);
+static final AllowableValue CONTACTS = new AllowableValue(
+"/crm/v3/objects/contacts",
+"Contacts",
+"In HubSpot, contacts store information about individuals. From 
marketing automation to smart content, the lead-specific data found in" +
+" contact records helps users leverage much of HubSpot's 
functionality."
+);
+static final AllowableValue DEALS = new AllowableValue(
+

[GitHub] [nifi] emiliosetiadarma closed pull request #6193: NIFI-9451 add input character set property for PutEmail and additiona…

2022-08-16 Thread GitBox


emiliosetiadarma closed pull request #6193: NIFI-9451 add input character set 
property for PutEmail and additiona…
URL: https://github.com/apache/nifi/pull/6193


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] emiliosetiadarma commented on pull request #6193: NIFI-9451 add input character set property for PutEmail and additiona…

2022-08-16 Thread GitBox


emiliosetiadarma commented on PR #6193:
URL: https://github.com/apache/nifi/pull/6193#issuecomment-1217204855

   Closing while revising


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] Lehel44 commented on a diff in pull request #6301: NIFI-10356: Create GetHubSpot processor

2022-08-16 Thread GitBox


Lehel44 commented on code in PR #6301:
URL: https://github.com/apache/nifi/pull/6301#discussion_r947270902


##
nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java:
##
@@ -0,0 +1,320 @@
+/*
+ * 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.hubspot;
+
+import com.fasterxml.jackson.core.JsonEncoding;
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
+import org.apache.nifi.annotation.behavior.PrimaryNodeOnly;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.TriggerSerially;
+import org.apache.nifi.annotation.behavior.TriggerWhenEmpty;
+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.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.state.Scope;
+import org.apache.nifi.components.state.StateMap;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.web.client.api.HttpResponseEntity;
+import org.apache.nifi.web.client.api.HttpUriBuilder;
+import org.apache.nifi.web.client.provider.api.WebClientServiceProvider;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@PrimaryNodeOnly
+@TriggerSerially
+@TriggerWhenEmpty
+@InputRequirement(Requirement.INPUT_FORBIDDEN)
+@Tags({"hubspot"})
+@CapabilityDescription("Retrieves JSON data from a private HubSpot 
application."
++ " Supports incremental retrieval: Users can set the \"limit\" 
property which serves as the upper limit of the retrieved objects."
++ " When this property is set the processor will retrieve new records. 
This processor is intended to be run on the Primary Node only.")
+@Stateful(scopes = Scope.CLUSTER, description = "When the 'Limit' attribute is 
set, the paging cursor is saved after executing a request."
++ " Only the objects after the paging cursor will be retrieved. The 
maximum number of retrieved objects is the 'Limit' attribute."
++ " State is stored across the cluster so that this Processor can be 
run on Primary Node only and if a new Primary Node is selected,"
++ " the new node can pick up where the previous node left off, without 
duplicating the data.")
+public class GetHubSpot extends AbstractProcessor {
+
+// OBJECTS
+
+static final AllowableValue COMPANIES = new AllowableValue(
+"/crm/v3/objects/companies",
+"Companies",
+"In HubSpot, the companies object is a standard CRM object. 
Individual company records can be used to store information about businesses" +
+" and organizations within company properties."
+);
+static final AllowableValue CONTACTS = new AllowableValue(
+"/crm/v3/objects/contacts",
+"Contacts",
+"In HubSpot, contacts store information about individuals. From 
marketing automation to smart content, the lead-specific data found in" +
+" contact records helps users leverage much of HubSpot's 
functionality."
+);
+static final AllowableValue DEALS = new AllowableValue(
+

[GitHub] [nifi] Lehel44 commented on a diff in pull request #6301: NIFI-10356: Create GetHubSpot processor

2022-08-16 Thread GitBox


Lehel44 commented on code in PR #6301:
URL: https://github.com/apache/nifi/pull/6301#discussion_r947270902


##
nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java:
##
@@ -0,0 +1,320 @@
+/*
+ * 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.hubspot;
+
+import com.fasterxml.jackson.core.JsonEncoding;
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
+import org.apache.nifi.annotation.behavior.PrimaryNodeOnly;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.TriggerSerially;
+import org.apache.nifi.annotation.behavior.TriggerWhenEmpty;
+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.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.state.Scope;
+import org.apache.nifi.components.state.StateMap;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.web.client.api.HttpResponseEntity;
+import org.apache.nifi.web.client.api.HttpUriBuilder;
+import org.apache.nifi.web.client.provider.api.WebClientServiceProvider;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@PrimaryNodeOnly
+@TriggerSerially
+@TriggerWhenEmpty
+@InputRequirement(Requirement.INPUT_FORBIDDEN)
+@Tags({"hubspot"})
+@CapabilityDescription("Retrieves JSON data from a private HubSpot 
application."
++ " Supports incremental retrieval: Users can set the \"limit\" 
property which serves as the upper limit of the retrieved objects."
++ " When this property is set the processor will retrieve new records. 
This processor is intended to be run on the Primary Node only.")
+@Stateful(scopes = Scope.CLUSTER, description = "When the 'Limit' attribute is 
set, the paging cursor is saved after executing a request."
++ " Only the objects after the paging cursor will be retrieved. The 
maximum number of retrieved objects is the 'Limit' attribute."
++ " State is stored across the cluster so that this Processor can be 
run on Primary Node only and if a new Primary Node is selected,"
++ " the new node can pick up where the previous node left off, without 
duplicating the data.")
+public class GetHubSpot extends AbstractProcessor {
+
+// OBJECTS
+
+static final AllowableValue COMPANIES = new AllowableValue(
+"/crm/v3/objects/companies",
+"Companies",
+"In HubSpot, the companies object is a standard CRM object. 
Individual company records can be used to store information about businesses" +
+" and organizations within company properties."
+);
+static final AllowableValue CONTACTS = new AllowableValue(
+"/crm/v3/objects/contacts",
+"Contacts",
+"In HubSpot, contacts store information about individuals. From 
marketing automation to smart content, the lead-specific data found in" +
+" contact records helps users leverage much of HubSpot's 
functionality."
+);
+static final AllowableValue DEALS = new AllowableValue(
+

[jira] [Created] (NIFI-10363) Nifi Registry start fail with NoClassDefFoundError: software/amazon/awssdk/auth/credentials/AwsCredentials

2022-08-16 Thread Jira
Zoltán Kornél Török created NIFI-10363:
--

 Summary: Nifi Registry start fail with NoClassDefFoundError: 
software/amazon/awssdk/auth/credentials/AwsCredentials
 Key: NIFI-10363
 URL: https://issues.apache.org/jira/browse/NIFI-10363
 Project: Apache NiFi
  Issue Type: Bug
  Components: NiFi Registry
Affects Versions: 1.17.0
Reporter: Zoltán Kornél Török
Assignee: Zoltán Kornél Török
 Fix For: 1.18.0


In https://issues.apache.org/jira/browse/NIFI-9848, the maven-assembly-plugin 
version is increased 3.3.0 from 2.4.3 in nifi-registry.

Because of that some of the AWS libraries are not included into lib/spp 
directory, which cause the following error, if nifi-registry.properties 
contains encrypted values:
{code:java}
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErr Exception in thread "main" 
java.lang.RuntimeException: Unable to load properties: 
java.lang.IllegalArgumentException: There was an issue decrypting protected 
properties
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.registry.NiFiRegistry.main(NiFiRegistry.java:164)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErr Caused by: java.lang.IllegalArgumentException: 
There was an issue decrypting protected properties
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.registry.NiFiRegistry.initializeProperties(NiFiRegistry.java:207)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.registry.NiFiRegistry.main(NiFiRegistry.java:162)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErr Caused by: java.lang.NoClassDefFoundError: 
software/amazon/awssdk/auth/credentials/AwsCredentials
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.properties.StandardSensitivePropertyProviderFactory.getProvider(StandardSensitivePropertyProviderFactory.java:205)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.properties.StandardSensitivePropertyProviderFactory.getSupportedProviders(StandardSensitivePropertyProviderFactory.java:152)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.registry.properties.NiFiRegistryPropertiesLoader.load(NiFiRegistryPropertiesLoader.java:130)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.registry.properties.NiFiRegistryPropertiesLoader.load(NiFiRegistryPropertiesLoader.java:146)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
java.lang.reflect.Method.invoke(Method.java:498)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErrat 
org.apache.nifi.registry.NiFiRegistry.initializeProperties(NiFiRegistry.java:202)
2022-08-15 17:54:36,077 ERROR [NiFi logging handler] 
org.apache.nifi.registry.StdErr... 1 more
2022-08-15 17:54:36,077 ERROR [NiFi logging handl

[GitHub] [nifi] Lehel44 commented on a diff in pull request #6301: NIFI-10356: Create GetHubSpot processor

2022-08-16 Thread GitBox


Lehel44 commented on code in PR #6301:
URL: https://github.com/apache/nifi/pull/6301#discussion_r947260325


##
nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/pom.xml:
##
@@ -0,0 +1,104 @@
+
+
+http://www.w3.org/2001/XMLSchema-instance";
+ xmlns="http://maven.apache.org/POM/4.0.0";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+nifi-hubspot-bundle
+org.apache.nifi
+1.18.0-SNAPSHOT
+
+4.0.0
+
+nifi-hubspot-processors
+
+
+
+commons-io
+commons-io
+
+
+org.apache.nifi
+nifi-web-client-api
+1.18.0-SNAPSHOT
+compile
+
+
+com.fasterxml.jackson.core
+jackson-databind
+
+

Review Comment:
   I would leave it there to separate test and non test dependencies, but I 
reordered them correctly.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (NIFI-10362) Cluster can disconnect node as soon as it rejoins cluster upon restart

2022-08-16 Thread Mark Payne (Jira)
Mark Payne created NIFI-10362:
-

 Summary: Cluster can disconnect node as soon as it rejoins cluster 
upon restart
 Key: NIFI-10362
 URL: https://issues.apache.org/jira/browse/NIFI-10362
 Project: Apache NiFi
  Issue Type: Bug
  Components: Core Framework
Reporter: Mark Payne
Assignee: Mark Payne


When the Cluster Coordinator disconnects a node due to a user requesting that 
the node get disconnected, the node is immediately marked as DISCONNECTED, and 
then a background thread is responsible for notifying the node that it's been 
disconnected. The background task attempts several times if it cannot 
successfully send the notification.

However, if the node is disconnected and then restarted before it's been 
notified, we have a situation in which the node becomes CONNECTING (and 
possibly then CONNECTED), and then the background task is triggered. This then 
results in the node being told that it's DISCONNECTED. But the Cluster 
Coordinator doesn't think so (because its already changed the state back to 
CONNECTING/CONNECTED).

While the chances that this happens are slim in production and it's easily 
worked around (by simply waiting a few seconds after disconnecting a node 
before restarting it, or just restarting without disconnecting) it causes a lot 
of problems for system tests and potentially other automated activities.

It results in the following log message in the Cluster Coordinator:
{code:java}
2022-08-15 00:47:50,200 ERROR [Disconnect localhost:5672] 
org.apache.nifi.cluster.coordination.node.NodeClusterCoordinator Failed to 
notify localhost:5672 that it has been disconnected from the cluster due to 
User anonymous requested that node be disconnected from cluster {code}
And then we see confusing error messages such as:
{code:java}
2022-08-15 00:48:01,461 INFO [Replicate Request Thread-23] 
org.apache.nifi.cluster.coordination.http.replication.ThreadPoolRequestReplicator
 Received a status of 200 from localhost:5672 for request PUT 
/nifi-api/flow/process-groups/root when performing first stage of two-stage 
commit. The action will not occur. Node explanation: 
{"id":"root","state":"STOPPED"} {code}
This is because when the cluster coordinator replicates the request to all 
nodes, the node that thinks it is disconnected receives the request and 
performs the action. It then responds with a "200 OK" but it should have noted 
that it's the first phase of a 2-phase action and responded with "201 Continue".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] mr1716 opened a new pull request, #6305: NIFI-10361 - Upgrade commons-jexl3 to version 3.2.1

2022-08-16 Thread GitBox


mr1716 opened a new pull request, #6305:
URL: https://github.com/apache/nifi/pull/6305

   
   
   
   
   
   
   
   
   
   
   
   
   
   # Summary
   
   [NIFI-10361](https://issues.apache.org/jira/browse/NIFI-10361)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI-10361) 
issue created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-0`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
 - [X] JDK 8
 - [X] JDK 11
 - [X] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (NIFI-10361) Upgrade commons-jexl3 to version 3.2.1

2022-08-16 Thread Mike R (Jira)
Mike R created NIFI-10361:
-

 Summary: Upgrade commons-jexl3 to version 3.2.1
 Key: NIFI-10361
 URL: https://issues.apache.org/jira/browse/NIFI-10361
 Project: Apache NiFi
  Issue Type: Bug
Reporter: Mike R


Upgrade commons-jexl3 to version 3.2.1 from 3.1



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] exceptionfactory commented on pull request #6297: Bump hadoop-common from 2.7.3 to 3.2.4 in /nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle

2022-08-16 Thread GitBox


exceptionfactory commented on PR #6297:
URL: https://github.com/apache/nifi/pull/6297#issuecomment-1217037598

   Upgrading major Hadoop versions would result in breaking changes for HBase 
1.1.2.


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] exceptionfactory closed pull request #6297: Bump hadoop-common from 2.7.3 to 3.2.4 in /nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle

2022-08-16 Thread GitBox


exceptionfactory closed pull request #6297: Bump hadoop-common from 2.7.3 to 
3.2.4 in 
/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle
URL: https://github.com/apache/nifi/pull/6297


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] dependabot[bot] commented on pull request #6297: Bump hadoop-common from 2.7.3 to 3.2.4 in /nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle

2022-08-16 Thread GitBox


dependabot[bot] commented on PR #6297:
URL: https://github.com/apache/nifi/pull/6297#issuecomment-1217037753

   OK, I won't notify you again about this release, but will get in touch when 
a new version is available. If you'd rather skip all updates until the next 
major or minor version, let me know by commenting `@dependabot ignore this 
major version` or `@dependabot ignore this minor version`.
   
   If you change your mind, just re-open this PR and I'll resolve any conflicts 
on it.


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (NIFI-10360) VOLUME declaration prevents updating flow from CI

2022-08-16 Thread Vitalii Zhakov (Jira)
Vitalii Zhakov created NIFI-10360:
-

 Summary: VOLUME declaration prevents updating flow from CI
 Key: NIFI-10360
 URL: https://issues.apache.org/jira/browse/NIFI-10360
 Project: Apache NiFi
  Issue Type: Bug
  Components: Docker
Affects Versions: 1.17.0, 1.16.0
Reporter: Vitalii Zhakov


Hello!

I have CD pipeline:

1) build docker image with Nifi flow

FROM apache/nifi:1.16.0

USER nifi
COPY --chown=nifi ./build_env/images/nifi/drivers/ /opt/nifi/nifi-current/lib/
COPY --chown=nifi ./build_env/images/nifi/project/conf/ 
/opt/nifi/nifi-current/conf/
CMD ["../scripts/start.sh"] 

2) deploy to registry
3) run docker container FROM registry's image

VOLUME declaration prevents getting changes from image (container used data in 
/opt/nifi/nifi-current/conf/ from local volume instead of registry).
Deleting container and starting new get changes to Nifi's flow, but system has 
7 garbage volumes every deploy.

Maybe creating VOLUME in Dockerfile is atavism now?
If user removes contaner, docker creates new VOLUME and data will be lost.

VOLUME instructions created in NIFI-5438



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] gresockj opened a new pull request, #6304: NIFI-9401: HashiCorpVaultParameterProvider

2022-08-16 Thread GitBox


gresockj opened a new pull request, #6304:
URL: https://github.com/apache/nifi/pull/6304

   
   # Summary
   
   [NIFI-9401](https://issues.apache.org/jira/browse/NIFI-9401)
   
   This is only a draft.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-0`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
 - [ ] JDK 8
 - [ ] JDK 11
 - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] adam-markovics commented on a diff in pull request #1367: MINIFICPP-1822 - Add alert capability

2022-08-16 Thread GitBox


adam-markovics commented on code in PR #1367:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1367#discussion_r947007813


##
libminifi/include/utils/TimeUtil.h:
##
@@ -70,6 +72,16 @@ class Clock {
  public:
   virtual ~Clock() = default;
   virtual std::chrono::milliseconds timeSinceEpoch() const = 0;
+  virtual std::chrono::milliseconds wait_until(std::condition_variable& cv, 
std::unique_lock& lck, std::chrono::milliseconds time, const 
std::function& pred) {
+auto now = timeSinceEpoch();
+if (now < time) {
+  cv.wait_for(lck, time - now, [&] {
+now = timeSinceEpoch();
+return now >= time || pred();
+  });
+}
+return timeSinceEpoch();

Review Comment:
   I think it would be better to tell in the return value that a timeout 
happened or the predicate returned true.



##
libminifi/src/core/logging/alert/AlertSink.cpp:
##
@@ -0,0 +1,269 @@
+/**
+ * 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.
+ */
+
+#include "core/logging/alert/AlertSink.h"
+#include "core/TypedValues.h"
+#include "core/ClassLoader.h"
+#include "utils/HTTPClient.h"
+#include "utils/Hash.h"
+#include "core/logging/Utils.h"
+#include "controllers/SSLContextService.h"
+
+#include "rapidjson/rapidjson.h"
+#include "rapidjson/document.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/writer.h"
+
+namespace org::apache::nifi::minifi::core::logging {
+
+AlertSink::AlertSink(Config config, std::shared_ptr logger)
+: config_(std::move(config)),
+  buffer_(config_.buffer_limit, config_.batch_size),
+  logger_(std::move(logger)) {
+  set_level(config_.level);
+  live_logs_.setLifetime(config_.rate_limit);
+  next_flush_ = clock_->timeSinceEpoch() + config_.flush_period;
+  flush_thread_ = std::thread([this] {run();});
+}
+
+std::shared_ptr AlertSink::create(const std::string& 
prop_name_prefix, const std::shared_ptr& logger_properties, 
std::shared_ptr logger) {
+  Config config;
+
+  if (auto url = logger_properties->getString(prop_name_prefix + ".url")) {
+config.url = url.value();
+  } else {
+logger->log_info("Missing '%s.url' value, network logging won't be 
available", prop_name_prefix);
+return {};
+  }
+
+  if (auto filter_str = logger_properties->getString(prop_name_prefix + 
".filter")) {
+try {
+  config.filter = utils::Regex{filter_str.value()};
+} catch (const std::regex_error& err) {
+  logger->log_error("Invalid '%s.filter' value, network logging won't be 
available: %s", prop_name_prefix, err.what());
+  return {};
+}
+  } else {
+logger->log_error("Missing '%s.filter' value, network logging won't be 
available", prop_name_prefix);
+return {};
+  }
+
+  auto readPropertyOr = [&] (auto suffix, auto parser, auto fallback) {
+if (auto prop_str = logger_properties->getString(prop_name_prefix + 
suffix)) {
+  if (auto prop_val = parser(prop_str.value())) {
+return prop_val.value();
+  }
+  logger->log_error("Invalid '%s' value, using default '%s'", 
prop_name_prefix + suffix, fallback);
+} else {
+  logger->log_info("Missing '%s' value, using default '%s'", 
prop_name_prefix + suffix, fallback);
+}
+return parser(fallback).value();
+  };
+
+  auto datasize_parser = [] (const std::string& str) -> std::optional {
+int val;
+if (DataSizeValue::StringToInt(str, val)) {
+  return val;
+}
+return {};
+  };
+
+  config.batch_size = readPropertyOr(".batch.size", datasize_parser, "100 KB");
+  config.flush_period = readPropertyOr(".flush.period", 
TimePeriodValue::fromString, "5 s").getMilliseconds();
+  config.rate_limit = readPropertyOr(".rate.limit", 
TimePeriodValue::fromString, "10 min").getMilliseconds();
+  config.buffer_limit = readPropertyOr(".buffer.limit", datasize_parser, "1 
MB");
+  config.level = readPropertyOr(".level", utils::parse_log_level, "trace");
+  config.ssl_service_name = logger_properties->getString(prop_name_prefix + 
".ssl.context.service");
+
+  return std::shared_ptr(new AlertSink(std::move(config), 
std::move(logger)));
+}
+
+void AlertSink::initialize(core::controller::ControllerServiceProvider* 
controller, std::shared_ptr agent_id) {
+  auto services = std::make_uni

[jira] [Resolved] (NIFI-10355) Upgrade Cassandra Driver Core To 4.14.1

2022-08-16 Thread Mike R (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike R resolved NIFI-10355.
---
Resolution: Won't Do

Covered by another issue

> Upgrade Cassandra Driver Core To 4.14.1
> ---
>
> Key: NIFI-10355
> URL: https://issues.apache.org/jira/browse/NIFI-10355
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.17.0
>Reporter: Mike R
>Priority: Major
>
> Upgrade Cassandra Driver Core To 4.14.1 to remediate vulnerabilities in the 
> existing 3.10.0 implementation



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Closed] (NIFI-10355) Upgrade Cassandra Driver Core To 4.14.1

2022-08-16 Thread Mike R (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike R closed NIFI-10355.
-

> Upgrade Cassandra Driver Core To 4.14.1
> ---
>
> Key: NIFI-10355
> URL: https://issues.apache.org/jira/browse/NIFI-10355
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.17.0
>Reporter: Mike R
>Priority: Major
>
> Upgrade Cassandra Driver Core To 4.14.1 to remediate vulnerabilities in the 
> existing 3.10.0 implementation



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Closed] (NIFI-10354) Upgrade jackson-mapper-asl from 1.9.13

2022-08-16 Thread Mike R (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike R closed NIFI-10354.
-

> Upgrade jackson-mapper-asl from 1.9.13
> --
>
> Key: NIFI-10354
> URL: https://issues.apache.org/jira/browse/NIFI-10354
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.17.0
>Reporter: Mike R
>Priority: Major
>
> Upgrade jackson-mapper-asl from version 1.9.13 to remediate 
> [CVE-2019-10172|https://nvd.nist.gov/vuln/detail/CVE-2019-10172]. The most 
> recent version is 2.13.3 and has moved to [Maven Repository: 
> com.fasterxml.jackson.core » jackson-databind 
> (mvnrepository.com)|https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (NIFI-10354) Upgrade jackson-mapper-asl from 1.9.13

2022-08-16 Thread Mike R (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike R resolved NIFI-10354.
---
Resolution: Won't Fix

Not doable based upon some items needing this software

> Upgrade jackson-mapper-asl from 1.9.13
> --
>
> Key: NIFI-10354
> URL: https://issues.apache.org/jira/browse/NIFI-10354
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.17.0
>Reporter: Mike R
>Priority: Major
>
> Upgrade jackson-mapper-asl from version 1.9.13 to remediate 
> [CVE-2019-10172|https://nvd.nist.gov/vuln/detail/CVE-2019-10172]. The most 
> recent version is 2.13.3 and has moved to [Maven Repository: 
> com.fasterxml.jackson.core » jackson-databind 
> (mvnrepository.com)|https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-10244) Add WebClientService Abstraction for HTTP Operations

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-10244:

Fix Version/s: 1.18.0
   Resolution: Fixed
   Status: Resolved  (was: Patch Available)

> Add WebClientService Abstraction for HTTP Operations
> 
>
> Key: NIFI-10244
> URL: https://issues.apache.org/jira/browse/NIFI-10244
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Core Framework, Extensions
>Reporter: David Handermann
>Assignee: David Handermann
>Priority: Major
> Fix For: 1.18.0
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Multiple framework and extension components perform various HTTP operations 
> using a variety of HTTP libraries. Processors such as InvokeHTTP and 
> Controller Services such as RestLookupService use OkHttp while other 
> components, such as PostHTTP, use Apache HttpComponents. Other components, 
> such as the Confluent Schema Registry Client and the NiFi Registry Client use 
> Jersey. Supporting multiple HTTP client libraries presents challenges for 
> dependency management and maintenance efforts.
> A new HTTP service interface should be developed to abstract HTTP operations 
> and common protocol configuration settings. This shared service interface can 
> support a variety of use cases and should be able to replace direct HTTP 
> client library interaction.
> The service interface should support standard HTTP request-response features, 
> avoiding any external dependencies. The interface definition and standard 
> implementation should support synchronous HTTP operations, using a fluent 
> style of for composing requests and handling responses.
> The service implementation should support configurable properties for socket 
> communication timeouts, HTTP application protocol selection, and TLS 
> communication.
> The interface and implementation should be specified in separate common 
> modules, which should also provide the basis for a Controller Service 
> interface and implementation. This design should support both framework-level 
> reuse as well as user-facing component configuration.
> The Controller Service interface and implementation should provide a reusable 
> foundation for Processors that require HTTP operations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-10359) Upgrade And Centralize hbase-client versions used

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-10359:

Issue Type: Improvement  (was: Bug)

> Upgrade And Centralize hbase-client versions used
> -
>
> Key: NIFI-10359
> URL: https://issues.apache.org/jira/browse/NIFI-10359
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.17.0
>Reporter: Mike R
>Priority: Major
>
> There are several versions of hbase used in NiFi, which include 2.2.2 and 
> 1.3.4. These various components can be found in the NiFi HBase 2 Client 
> Service, NiFi HBase 1 1 2 Client Service, and NiFi HBase 2 Client Service. 
> These all provide versions of hbase client that have vulnerabilities that can 
> be remediated by updating the client version if possible.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] Lehel44 closed pull request #6213: NIFI-10213: Created GetShopify processor

2022-08-16 Thread GitBox


Lehel44 closed pull request #6213: NIFI-10213: Created GetShopify processor
URL: https://github.com/apache/nifi/pull/6213


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (NIFI-10359) Upgrade And Centralize hbase-client versions used

2022-08-16 Thread Mike R (Jira)
Mike R created NIFI-10359:
-

 Summary: Upgrade And Centralize hbase-client versions used
 Key: NIFI-10359
 URL: https://issues.apache.org/jira/browse/NIFI-10359
 Project: Apache NiFi
  Issue Type: Bug
Affects Versions: 1.17.0
Reporter: Mike R


There are several versions of hbase used in NiFi, which include 2.2.2 and 
1.3.4. These various components can be found in the NiFi HBase 2 Client 
Service, NiFi HBase 1 1 2 Client Service, and NiFi HBase 2 Client Service. 
These all provide versions of hbase client that have vulnerabilities that can 
be remediated by updating the client version if possible.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] Lehel44 commented on pull request #6213: NIFI-10213: Created GetShopify processor

2022-08-16 Thread GitBox


Lehel44 commented on PR #6213:
URL: https://github.com/apache/nifi/pull/6213#issuecomment-1216818899

   Created new PR, rebased on the new web client provider service: 
https://github.com/apache/nifi/pull/6303


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] Lehel44 opened a new pull request, #6303: NIFI-10213: Create GetShopify processor

2022-08-16 Thread GitBox


Lehel44 opened a new pull request, #6303:
URL: https://github.com/apache/nifi/pull/6303

   
   
   
   
   
   
   
   
   
   
   
   
   
   # Summary
   
   [NIFI-10213](https://issues.apache.org/jira/browse/NIFI-10213)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI-10213) 
issue created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-0`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
 - [ ] JDK 8
 - [ ] JDK 11
 - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] turcsanyip commented on a diff in pull request #6279: NIFI-10230 added FetchSmb

2022-08-16 Thread GitBox


turcsanyip commented on code in PR #6279:
URL: https://github.com/apache/nifi/pull/6279#discussion_r946916475


##
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/FetchSmb.java:
##
@@ -0,0 +1,201 @@
+/*
+ * 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.smb;
+
+import static java.util.Arrays.asList;
+import static 
org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_EL_VALIDATOR;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+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.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.PropertyDescriptor.Builder;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.schema.access.SchemaNotFoundException;
+import org.apache.nifi.serialization.MalformedRecordException;
+import org.apache.nifi.serialization.RecordReader;
+import org.apache.nifi.serialization.RecordReaderFactory;
+import org.apache.nifi.serialization.record.Record;
+import org.apache.nifi.services.smb.SmbClientProviderService;
+import org.apache.nifi.services.smb.SmbClientService;
+import org.apache.nifi.services.smb.SmbException;
+
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@Tags({"samba, smb, cifs, files", "fetch"})
+@CapabilityDescription("Fetches files from a SMB Share. Designed to be used in 
tandem with ListSmb.")
+@SeeAlso({ListSmb.class, PutSmbFile.class, GetSmbFile.class})
+@WritesAttributes({
+@WritesAttribute(attribute = FetchSmb.ERROR_CODE_ATTRIBUTE, 
description = "The error code returned by SMB when the fetch of a file fails"),
+@WritesAttribute(attribute = FetchSmb.ERROR_MESSAGE_ATTRIBUTE, 
description = "The error message returned by SMB when the fetch of a file 
fails")
+})
+public class FetchSmb extends AbstractProcessor {
+
+public static final String ERROR_CODE_ATTRIBUTE = "error.code";
+public static final String ERROR_MESSAGE_ATTRIBUTE = "error.message";
+
+public static final PropertyDescriptor FILE_ID = new PropertyDescriptor
+.Builder().name("file-id")
+.displayName("File ID")
+.description("The identifier of the file to fetch.")
+.required(true)
+.defaultValue("${identifier}")
+
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
+.addValidator(NON_EMPTY_EL_VALIDATOR)
+.build();
+
+public static final PropertyDescriptor SMB_CLIENT_PROVIDER_SERVICE = new 
Builder()
+.name("smb-client-provider-service")
+.displayName("SMB Client Provider Service")
+.description("Specifies the SMB client provider to use for 
creating SMB connections.")
+.required(true)
+.identifiesControllerService(SmbClientProviderService.class)
+.build();
+
+public static final Relationship REL_SUCCESS =
+new Relationship.Builder()
+.name("success")
+.description("A flowfile will be routed here for each 
successfully fetched File.")
+.build();
+public static final Relationship REL_FAILURE =
+new Relationship.Builder().name("failure")
+.description(
+"A flowfile will be routed here for each File for 
which fetch was attempted but fa

[jira] [Updated] (NIFI-9518) Update mysql-binlog-connector-java library to maintained fork

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-9518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-9518:
---
Status: Patch Available  (was: Open)

> Update mysql-binlog-connector-java library to maintained fork
> -
>
> Key: NIFI-9518
> URL: https://issues.apache.org/jira/browse/NIFI-9518
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.15.1
>Reporter: Anton Koval
>Assignee: David Handermann
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> I noticed that a processor CaptureChangeMySQL uses library 
> ([https://github.com/shyiko/mysql-binlog-connector-java]), which is no longer 
> maintained. It's recommend migrating to 
> [https://github.com/osheroff/mysql-binlog-connector-java] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-9518) Update mysql-binlog-connector-java library to maintained version

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-9518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-9518:
---
Component/s: Extensions

> Update mysql-binlog-connector-java library to maintained version
> 
>
> Key: NIFI-9518
> URL: https://issues.apache.org/jira/browse/NIFI-9518
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: 1.15.1
>Reporter: Anton Koval
>Assignee: David Handermann
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> I noticed that a processor CaptureChangeMySQL uses library 
> ([https://github.com/shyiko/mysql-binlog-connector-java]), which is no longer 
> maintained. It's recommend migrating to 
> [https://github.com/osheroff/mysql-binlog-connector-java] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-9518) Update mysql-binlog-connector-java library to maintained version

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-9518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-9518:
---
Summary: Update mysql-binlog-connector-java library to maintained version  
(was: Update mysql-binlog-connector-java library to maintained fork)

> Update mysql-binlog-connector-java library to maintained version
> 
>
> Key: NIFI-9518
> URL: https://issues.apache.org/jira/browse/NIFI-9518
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.15.1
>Reporter: Anton Koval
>Assignee: David Handermann
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> I noticed that a processor CaptureChangeMySQL uses library 
> ([https://github.com/shyiko/mysql-binlog-connector-java]), which is no longer 
> maintained. It's recommend migrating to 
> [https://github.com/osheroff/mysql-binlog-connector-java] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] exceptionfactory opened a new pull request, #6302: NIFI-9518 Upgrade mysql-binlog-connector-java from 0.20.1 to 0.26.1

2022-08-16 Thread GitBox


exceptionfactory opened a new pull request, #6302:
URL: https://github.com/apache/nifi/pull/6302

   # Summary
   
   [NIFI-9518](https://issues.apache.org/jira/browse/NIFI-9518) Upgrades 
`mysql-binlog-connector-java` from 0.20.1 to 0.26.1 and changes the Maven group 
to the maintained version.
   
   The original version with the 
[com.github.shyiko](https://github.com/shyiko/mysql-binlog-connector-java) 
group is no longer maintained. The current version is maintained in a separate 
fork and is published in the 
[com.zendesk](https://github.com/osheroff/mysql-binlog-connector-java) group. 
The updated version maintains compatibility with earlier versions and resolves 
several serialization and network connection handling issues.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-0`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [X] Build completed using `mvn clean install -P contrib-check`
 - [X] JDK 8
 - [ ] JDK 11
 - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Resolved] (MINIFICPP-1680) Add support and tests for advanced MQTT features

2022-08-16 Thread Jira


 [ 
https://issues.apache.org/jira/browse/MINIFICPP-1680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ádám Markovics resolved MINIFICPP-1680.
---
Resolution: Done

> Add support and tests for advanced MQTT features
> 
>
> Key: MINIFICPP-1680
> URL: https://issues.apache.org/jira/browse/MINIFICPP-1680
> Project: Apache NiFi MiNiFi C++
>  Issue Type: Improvement
>Reporter: Ádám Markovics
>Assignee: Ádám Markovics
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Such as wildcards, durable sessions, QoS, retained message, last will, ping.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6279: NIFI-10230 added FetchSmb

2022-08-16 Thread GitBox


exceptionfactory commented on code in PR #6279:
URL: https://github.com/apache/nifi/pull/6279#discussion_r946904340


##
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/FetchSmb.java:
##
@@ -0,0 +1,201 @@
+/*
+ * 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.smb;
+
+import static java.util.Arrays.asList;
+import static 
org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_EL_VALIDATOR;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+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.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.PropertyDescriptor.Builder;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.schema.access.SchemaNotFoundException;
+import org.apache.nifi.serialization.MalformedRecordException;
+import org.apache.nifi.serialization.RecordReader;
+import org.apache.nifi.serialization.RecordReaderFactory;
+import org.apache.nifi.serialization.record.Record;
+import org.apache.nifi.services.smb.SmbClientProviderService;
+import org.apache.nifi.services.smb.SmbClientService;
+import org.apache.nifi.services.smb.SmbException;
+
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@Tags({"samba, smb, cifs, files", "fetch"})
+@CapabilityDescription("Fetches files from a SMB Share. Designed to be used in 
tandem with ListSmb.")
+@SeeAlso({ListSmb.class, PutSmbFile.class, GetSmbFile.class})
+@WritesAttributes({
+@WritesAttribute(attribute = FetchSmb.ERROR_CODE_ATTRIBUTE, 
description = "The error code returned by SMB when the fetch of a file fails"),
+@WritesAttribute(attribute = FetchSmb.ERROR_MESSAGE_ATTRIBUTE, 
description = "The error message returned by SMB when the fetch of a file 
fails")
+})
+public class FetchSmb extends AbstractProcessor {
+
+public static final String ERROR_CODE_ATTRIBUTE = "error.code";
+public static final String ERROR_MESSAGE_ATTRIBUTE = "error.message";
+
+public static final PropertyDescriptor FILE_ID = new PropertyDescriptor
+.Builder().name("file-id")
+.displayName("File ID")
+.description("The identifier of the file to fetch.")

Review Comment:
   I agree with your suggestions @turcsanyip, as it aligns better with other 
Fetch Processors.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] turcsanyip commented on a diff in pull request #6279: NIFI-10230 added FetchSmb

2022-08-16 Thread GitBox


turcsanyip commented on code in PR #6279:
URL: https://github.com/apache/nifi/pull/6279#discussion_r946897664


##
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/FetchSmb.java:
##
@@ -0,0 +1,201 @@
+/*
+ * 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.smb;
+
+import static java.util.Arrays.asList;
+import static 
org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_EL_VALIDATOR;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+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.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.PropertyDescriptor.Builder;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.schema.access.SchemaNotFoundException;
+import org.apache.nifi.serialization.MalformedRecordException;
+import org.apache.nifi.serialization.RecordReader;
+import org.apache.nifi.serialization.RecordReaderFactory;
+import org.apache.nifi.serialization.record.Record;
+import org.apache.nifi.services.smb.SmbClientProviderService;
+import org.apache.nifi.services.smb.SmbClientService;
+import org.apache.nifi.services.smb.SmbException;
+
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@Tags({"samba, smb, cifs, files", "fetch"})
+@CapabilityDescription("Fetches files from a SMB Share. Designed to be used in 
tandem with ListSmb.")
+@SeeAlso({ListSmb.class, PutSmbFile.class, GetSmbFile.class})
+@WritesAttributes({
+@WritesAttribute(attribute = FetchSmb.ERROR_CODE_ATTRIBUTE, 
description = "The error code returned by SMB when the fetch of a file fails"),
+@WritesAttribute(attribute = FetchSmb.ERROR_MESSAGE_ATTRIBUTE, 
description = "The error message returned by SMB when the fetch of a file 
fails")
+})
+public class FetchSmb extends AbstractProcessor {
+
+public static final String ERROR_CODE_ATTRIBUTE = "error.code";
+public static final String ERROR_MESSAGE_ATTRIBUTE = "error.message";
+
+public static final PropertyDescriptor FILE_ID = new PropertyDescriptor
+.Builder().name("file-id")
+.displayName("File ID")
+.description("The identifier of the file to fetch.")

Review Comment:
   @exceptionfactory @kulikg I would not use "identifier" in the UI at all 
because it is quite technical and not really straightforward what it means in 
case of an SMB file.
   My suggestions:
   - display name: `Remote File` (like in case of List[S]FTP)
   - default value: `${path}/${filename}` (the leading slash / double slashes 
may need to be removed from the evaluated value)
   - remove `identifier` in ListSmb too
   
   Also +1 for the suggested description.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez closed pull request #1389: MINIFICPP-1907 Add description to monadic operation wrappers

2022-08-16 Thread GitBox


lordgamez closed pull request #1389: MINIFICPP-1907 Add description to monadic 
operation wrappers
URL: https://github.com/apache/nifi-minifi-cpp/pull/1389


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez closed pull request #1386: MINIFICPP-1905 - Enumerate only relevant subdir contents

2022-08-16 Thread GitBox


lordgamez closed pull request #1386: MINIFICPP-1905 - Enumerate only relevant 
subdir contents
URL: https://github.com/apache/nifi-minifi-cpp/pull/1386


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez closed pull request #1363: MINIFICPP-1680 Add support and tests for advanced MQTT features

2022-08-16 Thread GitBox


lordgamez closed pull request #1363: MINIFICPP-1680 Add support and tests for 
advanced MQTT features
URL: https://github.com/apache/nifi-minifi-cpp/pull/1363


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

2022-08-16 Thread GitBox


szaszm commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946885266


##
libminifi/src/FlowController.cpp:
##
@@ -558,19 +552,20 @@ std::vector 
FlowController::getAllProcessorControllers(
   return controllerVec;
 }
 
-state::StateController* FlowController::getProcessorController(const 
std::string& name, const 
std::function(core::Processor&)>& 
controllerFactory) {
-  auto* processor = root_->findProcessorByName(name);
-  if (processor == nullptr) {
-logger_->log_error("Could not get processor controller for requested name 
\"%s\", because processor was not found either", name);
-return nullptr;
-  }
-
-  // reference to the existing or newly created controller
-  auto& foundController = processor_to_controller_[processor->getUUID()];
-  if (!foundController) {
-foundController = controllerFactory(*processor);
-  }
-  return foundController.get();
+state::StateController* FlowController::getProcessorController(const 
std::string& id_or_name, const 
std::function(core::Processor&)>& 
controllerFactory) {

Review Comment:
   This was an oversight, fixed in 
[4d699a7](https://github.com/apache/nifi-minifi-cpp/pull/1388/commits/4d699a7c00834fe02e7775c6e362a5cc96447c62).
 



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (NIFI-10358) Apply SSL Properties to JDBC Connection in CaptureChangeMySQL

2022-08-16 Thread David Handermann (Jira)
David Handermann created NIFI-10358:
---

 Summary: Apply SSL Properties to JDBC Connection in 
CaptureChangeMySQL
 Key: NIFI-10358
 URL: https://issues.apache.org/jira/browse/NIFI-10358
 Project: Apache NiFi
  Issue Type: Improvement
  Components: Extensions
Reporter: David Handermann
Assignee: David Handermann


The {{CaptureChangeMySQL}} Processor supports TLS for Binary Log connections 
using the {{SSL Mode}} and {{SSL Context Service}} properties, but these 
settings do not apply to the JDBC enrichment connection.

Without apply the SSL properties to the JDBC connection, {{CaptureChangeMySQL}} 
depends on the default MySQL JDBC Connector configuration to negotiate TLS 
settings. MySQL JDBC Connector versions prior to 8.0.28 enable deprecated TLS 
versions 1.0 and 1.1, but Java 8 Update 292 and following disable TLS 1.0 and 
1.1 in the default java.security configuration. As a result of this behavior, 
{{CaptureChangeMySQL}} can fail to establish a JDBC connection when running on 
a newer version of Java and an older version of the MySQL JDBC Connector. It is 
possible to work around the problem by upgrading to MySQL JDBC Connector 8.0.28 
and following, which selects TLS 1.2 as the default protocol version. Although 
this resolves TLS protocol negotiation issues, it does not support 
customization of the TLS keystore and truststore properties, which may be 
necessary for some MySQL installations.

Configuring the JDBC connection properties based on the {{SSL Mode}} and {{SSL 
Context Service}} properties should provide a more intuitive and flexible 
configuration approach.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

2022-08-16 Thread GitBox


szaszm commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946876053


##
extensions/http-curl/tests/HTTPHandlers.h:
##
@@ -590,7 +590,7 @@ class HeartbeatHandler : public ServerAwareHandler {
   case minifi::c2::Operation::STOP: {
 auto operands = getOperandsOfProperties(operation_node);
 assert(operands.find("c2") != operands.end());
-assert(operands.find("FlowController") != operands.end());
+// FlowController is also present, but this handler has no way of 
knowing its UUID to test it

Review Comment:
   This doesn't work, because there are tests that don't verify all components.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Assigned] (NIFI-9518) Update mysql-binlog-connector-java library to maintained fork

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-9518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann reassigned NIFI-9518:
--

Assignee: David Handermann

> Update mysql-binlog-connector-java library to maintained fork
> -
>
> Key: NIFI-9518
> URL: https://issues.apache.org/jira/browse/NIFI-9518
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.15.1
>Reporter: Anton Koval
>Assignee: David Handermann
>Priority: Major
>
> I noticed that a processor CaptureChangeMySQL uses library 
> ([https://github.com/shyiko/mysql-binlog-connector-java]), which is no longer 
> maintained. It's recommend migrating to 
> [https://github.com/osheroff/mysql-binlog-connector-java] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (MINIFICPP-1909) GenerateFlowFile outputs garbage after certain C2/controller updates

2022-08-16 Thread Jira


 [ 
https://issues.apache.org/jira/browse/MINIFICPP-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gábor Gyimesi reassigned MINIFICPP-1909:


Assignee: Gábor Gyimesi

> GenerateFlowFile outputs garbage after certain C2/controller updates
> 
>
> Key: MINIFICPP-1909
> URL: https://issues.apache.org/jira/browse/MINIFICPP-1909
> Project: Apache NiFi MiNiFi C++
>  Issue Type: Bug
>Reporter: Marton Szasz
>Assignee: Gábor Gyimesi
>Priority: Major
>
> I've seen GenerateFlowFile used with:
>  * Batch Size: '1'
>  * Custom Text: abc
>  * Data Format: Text
>  * File Size: 1 kB
>  * Unique FlowFiles: 'false'
> The output was connected to LogAttribute, with payload logging. Both timer 
> driven, every 1 sec. GenerateFlowFile was updated to binary format, and later 
> back to text. After this sequence, the log kept showing randomly either the 
> correct custom text, or random binary garbage. It should only show the custom 
> text after the last update and maybe one extra trigger to account for a 
> possibly queued flow file.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (MINIFICPP-1909) GenerateFlowFile outputs garbage after certain C2/controller updates

2022-08-16 Thread Marton Szasz (Jira)
Marton Szasz created MINIFICPP-1909:
---

 Summary: GenerateFlowFile outputs garbage after certain 
C2/controller updates
 Key: MINIFICPP-1909
 URL: https://issues.apache.org/jira/browse/MINIFICPP-1909
 Project: Apache NiFi MiNiFi C++
  Issue Type: Bug
Reporter: Marton Szasz


I've seen GenerateFlowFile used with:
 * Batch Size: '1'
 * Custom Text: abc
 * Data Format: Text
 * File Size: 1 kB
 * Unique FlowFiles: 'false'

The output was connected to LogAttribute, with payload logging. Both timer 
driven, every 1 sec. GenerateFlowFile was updated to binary format, and later 
back to text. After this sequence, the log kept showing randomly either the 
correct custom text, or random binary garbage. It should only show the custom 
text after the last update and maybe one extra trigger to account for a 
possibly queued flow file.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6265: NIFI-10234 Implement PutIoTDB

2022-08-16 Thread GitBox


exceptionfactory commented on code in PR #6265:
URL: https://github.com/apache/nifi/pull/6265#discussion_r946753075


##
nifi-nar-bundles/nifi-iotdb-bundle/nifi-iotdb-processors/src/main/java/org/apache/nifi/processors/PutIoTDB.java:
##
@@ -0,0 +1,267 @@
+/*
+ * 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;
+
+import java.io.InputStream;
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Set;
+import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.nifi.processors.model.IoTDBSchema;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.write.record.Tablet;
+import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnUnscheduled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+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.model.ValidationResult;
+import org.apache.nifi.serialization.RecordReader;
+import org.apache.nifi.serialization.RecordReaderFactory;
+import org.apache.nifi.serialization.record.Record;
+
+@Tags({"iotdb", "insert", "tablet"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@CapabilityDescription(
+"This is a record aware processor that reads the content of the 
incoming FlowFile as individual records using the "
++ "configured 'Record Reader' and writes them to Apache IoTDB 
using native interface.")
+public class PutIoTDB extends AbstractIoTDB {
+
+static final PropertyDescriptor RECORD_READER_FACTORY =
+new PropertyDescriptor.Builder()
+.name("Record Reader")
+.description(
+"Specifies the type of Record Reader controller 
service to use for parsing the incoming data "
++ "and determining the schema")
+.identifiesControllerService(RecordReaderFactory.class)
+.required(true)
+.build();
+
+static final PropertyDescriptor SCHEMA =
+new PropertyDescriptor.Builder()
+.name("Schema")
+.description(
+"The schema that IoTDB needs doesn't support good 
by NiFi.\n"
++ "Therefore, you can define the schema 
here.\n"
++ "Besides, you can set encoding type and 
compression type by this method.\n"
++ "If you don't set this property, the 
inferred schema will be used.\n")
+
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
+.required(false)
+.build();
+
+static final PropertyDescriptor ALIGNED =
+new PropertyDescriptor.Builder()
+.name("Aligned")
+.description("Whether to use the Apache IoTDB Aligned 
Timeseries interface")
+.allowableValues("true", "false")
+.addValidator(StandardValidators.BOOLEAN_VALIDATOR)
+.defaultValue("false")
+
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
+.required(false)
+.build();
+
+static final PropertyDescriptor MAX_ROW_NUMBER =
+new PropertyDescriptor.Builder()
+.name("Max Row Number")
+.description(
+   

[GitHub] [nifi-minifi-cpp] fgerlits commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

2022-08-16 Thread GitBox


fgerlits commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946564214


##
extensions/http-curl/tests/HTTPHandlers.h:
##
@@ -590,7 +590,7 @@ class HeartbeatHandler : public ServerAwareHandler {
   case minifi::c2::Operation::STOP: {
 auto operands = getOperandsOfProperties(operation_node);
 assert(operands.find("c2") != operands.end());
-assert(operands.find("FlowController") != operands.end());
+// FlowController is also present, but this handler has no way of 
knowing its UUID to test it

Review Comment:
   can we assert that `operands.size() == verify_components.size() + 2` (with a 
comment about `FlowController`)?



##
libminifi/src/FlowController.cpp:
##
@@ -558,19 +552,20 @@ std::vector 
FlowController::getAllProcessorControllers(
   return controllerVec;
 }
 
-state::StateController* FlowController::getProcessorController(const 
std::string& name, const 
std::function(core::Processor&)>& 
controllerFactory) {
-  auto* processor = root_->findProcessorByName(name);
-  if (processor == nullptr) {
-logger_->log_error("Could not get processor controller for requested name 
\"%s\", because processor was not found either", name);
-return nullptr;
-  }
-
-  // reference to the existing or newly created controller
-  auto& foundController = processor_to_controller_[processor->getUUID()];
-  if (!foundController) {
-foundController = controllerFactory(*processor);
-  }
-  return foundController.get();
+state::StateController* FlowController::getProcessorController(const 
std::string& id_or_name, const 
std::function(core::Processor&)>& 
controllerFactory) {

Review Comment:
   you added a `gsl::not_null` to the return type of the `controllerFactory` 
functor at other places, but not here; why?



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Updated] (NIFI-10340) Registry Assembly Build Error with targz profile enabled

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-10340:

Summary: Registry Assembly Build Error with targz profile enabled  (was: 
Build error happen with targz profile)

> Registry Assembly Build Error with targz profile enabled
> 
>
> Key: NIFI-10340
> URL: https://issues.apache.org/jira/browse/NIFI-10340
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: NiFi Registry
>Affects Versions: 1.17.0
>Reporter: Zoltán Kornél Török
>Assignee: Zoltán Kornél Török
>Priority: Major
> Fix For: 1.18.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> If you build nifi with the following command:
> {code}
> mvn -P targz clean  install -DskipTests
> {code}
> It will throw the following error:
> {code}
> [ERROR] Failed to execute goal on project nifi-registry-assembly: Could not 
> resolve dependencies for project 
> org.apache.nifi.registry:nifi-registry-assembly:pom:1.18.0-SNAPSHOT: Could 
> not find artifact 
> org.apache.nifi.registry:nifi-registry-aws-assembly:zip:bin:1.18.0-SNAPSHOT 
> in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
> [ERROR] 
> {code}
> The code need a little adjustment in nifi-registry-assembly to work properly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-10340) Build error happen with targz profile

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-10340:

Component/s: NiFi Registry

> Build error happen with targz profile
> -
>
> Key: NIFI-10340
> URL: https://issues.apache.org/jira/browse/NIFI-10340
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: NiFi Registry
>Affects Versions: 1.17.0
>Reporter: Zoltán Kornél Török
>Assignee: Zoltán Kornél Török
>Priority: Major
> Fix For: 1.18.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> If you build nifi with the following command:
> {code}
> mvn -P targz clean  install -DskipTests
> {code}
> It will throw the following error:
> {code}
> [ERROR] Failed to execute goal on project nifi-registry-assembly: Could not 
> resolve dependencies for project 
> org.apache.nifi.registry:nifi-registry-assembly:pom:1.18.0-SNAPSHOT: Could 
> not find artifact 
> org.apache.nifi.registry:nifi-registry-aws-assembly:zip:bin:1.18.0-SNAPSHOT 
> in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
> [ERROR] 
> {code}
> The code need a little adjustment in nifi-registry-assembly to work properly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (NIFI-10340) Build error happen with targz profile

2022-08-16 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann resolved NIFI-10340.
-
Fix Version/s: 1.18.0
   Resolution: Fixed

> Build error happen with targz profile
> -
>
> Key: NIFI-10340
> URL: https://issues.apache.org/jira/browse/NIFI-10340
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.17.0
>Reporter: Zoltán Kornél Török
>Assignee: Zoltán Kornél Török
>Priority: Major
> Fix For: 1.18.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> If you build nifi with the following command:
> {code}
> mvn -P targz clean  install -DskipTests
> {code}
> It will throw the following error:
> {code}
> [ERROR] Failed to execute goal on project nifi-registry-assembly: Could not 
> resolve dependencies for project 
> org.apache.nifi.registry:nifi-registry-assembly:pom:1.18.0-SNAPSHOT: Could 
> not find artifact 
> org.apache.nifi.registry:nifi-registry-aws-assembly:zip:bin:1.18.0-SNAPSHOT 
> in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
> [ERROR] 
> {code}
> The code need a little adjustment in nifi-registry-assembly to work properly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-10340) Build error happen with targz profile

2022-08-16 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-10340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580293#comment-17580293
 ] 

ASF subversion and git services commented on NIFI-10340:


Commit 32310584887626b5f8ed73129e8ca0bc9f25c03e in nifi's branch 
refs/heads/main from Zoltan Kornel Torok
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=3231058488 ]

NIFI-10340 Corrected Registry assembly extension builds with tar.gz

This closes #6289

Signed-off-by: David Handermann 


> Build error happen with targz profile
> -
>
> Key: NIFI-10340
> URL: https://issues.apache.org/jira/browse/NIFI-10340
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 1.17.0
>Reporter: Zoltán Kornél Török
>Assignee: Zoltán Kornél Török
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> If you build nifi with the following command:
> {code}
> mvn -P targz clean  install -DskipTests
> {code}
> It will throw the following error:
> {code}
> [ERROR] Failed to execute goal on project nifi-registry-assembly: Could not 
> resolve dependencies for project 
> org.apache.nifi.registry:nifi-registry-assembly:pom:1.18.0-SNAPSHOT: Could 
> not find artifact 
> org.apache.nifi.registry:nifi-registry-aws-assembly:zip:bin:1.18.0-SNAPSHOT 
> in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
> [ERROR] 
> {code}
> The code need a little adjustment in nifi-registry-assembly to work properly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] exceptionfactory closed pull request #6289: NIFI-10340: fix build error, when use targz profile

2022-08-16 Thread GitBox


exceptionfactory closed pull request #6289: NIFI-10340: fix build error, when 
use targz profile
URL: https://github.com/apache/nifi/pull/6289


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] fgerlits commented on pull request #1390: MINIFICPP-1908 - Set manifest description for script processors

2022-08-16 Thread GitBox


fgerlits commented on PR #1390:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1390#issuecomment-1216490786

   Do we have any tests for this?  If not, it would be good to add some, or to 
check the descriptions in existing manifest tests.  If possible, Python 
processors should be checked, too.


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a diff in pull request #1383: MINIFICPP-1875 HTTPClient should be reusable

2022-08-16 Thread GitBox


lordgamez commented on code in PR #1383:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1383#discussion_r946619201


##
libminifi/include/utils/BaseHTTPClient.h:
##
@@ -51,38 +39,30 @@ struct HTTPProxy {
   int port = 0;
 };
 
-struct HTTPUploadCallback {
-  HTTPUploadCallback() {
-stop = false;
-ptr = nullptr;
-pos = 0;
-  }
-  std::mutex mutex;
-  std::atomic stop;
-  ByteInputCallback *ptr;
-  size_t pos;
+class HTTPUploadCallback : public ByteInputCallback {
+ public:
+  template
+  explicit HTTPUploadCallback(Args&& ... args) : 
ByteInputCallback(std::forward(args)...) {}
 
   size_t getPos() {
-std::lock_guard lock(mutex);
 return pos;
   }

Review Comment:
   After removing the lock is this strictly needed anymore? The position member 
is public and could be used as it is. Same for HTTPReadCallback



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] adamdebreceni opened a new pull request, #1390: MINIFICPP-1908 - Set manifest description for script processors

2022-08-16 Thread GitBox


adamdebreceni opened a new pull request, #1390:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1390

   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP- where  is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
   
   - [ ] Has your PR been rebased against the latest commit within the target 
branch (typically main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which 
it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI 
results for build issues and submit an update to your PR as soon as possible.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (NIFI-10357) FetchParquet Cannot inherit Schema By Empty Data

2022-08-16 Thread Hadiiiiiiiii (Jira)
Hadi created NIFI-10357:
---

 Summary: FetchParquet Cannot inherit Schema By Empty Data
 Key: NIFI-10357
 URL: https://issues.apache.org/jira/browse/NIFI-10357
 Project: Apache NiFi
  Issue Type: Bug
Affects Versions: 1.16.3
Reporter: Hadi
 Attachments: image-2022-08-16-18-13-25-670.png

!image-2022-08-16-18-13-25-670.png!

 

when file only have footer, but have no data, will throw this error



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1383: MINIFICPP-1875 HTTPClient should be reusable

2022-08-16 Thread GitBox


martinzink commented on code in PR #1383:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1383#discussion_r946588904


##
libminifi/include/utils/BaseHTTPClient.h:
##
@@ -51,38 +39,43 @@ struct HTTPProxy {
   int port = 0;
 };
 
-struct HTTPUploadCallback {
-  HTTPUploadCallback() {
-stop = false;
-ptr = nullptr;
-pos = 0;
-  }
-  std::mutex mutex;
-  std::atomic stop;
-  ByteInputCallback *ptr;
-  size_t pos;
+class HTTPUploadCallback {
+ public:
+  explicit HTTPUploadCallback(ByteInputCallback* byte_input_callback) : 
ptr(std::move(byte_input_callback)) {}
 
   size_t getPos() {
 std::lock_guard lock(mutex);
 return pos;

Review Comment:
   good idea, reworked them in 
https://github.com/apache/nifi-minifi-cpp/pull/1383/commits/4263282eb39be5757f303a61bb0d5380be157d66



##
libminifi/include/utils/BaseHTTPClient.h:
##
@@ -51,38 +39,43 @@ struct HTTPProxy {
   int port = 0;
 };
 
-struct HTTPUploadCallback {

Review Comment:
   good idea, reworked them in 
https://github.com/apache/nifi-minifi-cpp/pull/1383/commits/4263282eb39be5757f303a61bb0d5380be157d66



##
extensions/http-curl/client/HTTPStream.cpp:
##
@@ -26,55 +26,56 @@
 #include "io/validation.h"
 #include "utils/gsl.h"
 
-namespace org {
-namespace apache {
-namespace nifi {
-namespace minifi {
-namespace io {
+namespace org::apache::nifi::minifi::extensions::curl {
 
-HttpStream::HttpStream(std::shared_ptr client)
+HttpStream::HttpStream(std::shared_ptr client)
 : http_client_(std::move(client)),
   written(0),
-  // given the nature of the stream we don't want to slow libCURL, we will 
produce
-  // a warning instead allowing us to adjust it server side or through the 
local configuration.
-  http_read_callback_(66560, true),
+// given the nature of the stream we don't want to slow libCURL, we will 
produce
+// a warning instead allowing us to adjust it server side or through the 
local configuration.
   started_(false) {
   // submit early on
 }
 
 void HttpStream::close() {
-  http_callback_.close();
-  http_read_callback_.close();
+  if (auto read_callback = http_client_->getReadCallback())
+read_callback->getPtr()->close();
+  if (auto upload_callback = http_client_->getUploadCallback())
+upload_callback->getPtr()->close();
 }
 
 void HttpStream::seek(size_t /*offset*/) {
   // seek is an unnecessary part of this implementation
   throw std::logic_error{"HttpStream::seek is unimplemented"};
 }
 
-size_t HttpStream::tell() const  {
+size_t HttpStream::tell() const {
   // tell is an unnecessary part of this implementation
   throw std::logic_error{"HttpStream::tell is unimplemented"};
 }
 
 // data stream overrides
 
-size_t HttpStream::write(const uint8_t *value, size_t size) {
+size_t HttpStream::write(const uint8_t* value, size_t size) {
   if (size == 0) return 0;
   if (IsNullOrEmpty(value)) {
-return STREAM_ERROR;
+return io::STREAM_ERROR;
   }
   if (!started_) {
 std::lock_guard lock(mutex_);
 if (!started_) {
-  callback_.ptr = &http_callback_;
-  callback_.pos = 0;
-  http_client_->setUploadCallback(&callback_);
+  auto callback = std::make_unique(new 
HttpStreamingCallback());
+  callback->pos = 0;
+  http_client_->setUploadCallback(std::move(callback));
   http_client_future_ = std::async(std::launch::async, submit_client, 
http_client_);
   started_ = true;
 }
   }
-  http_callback_.process(value, size);
+  auto http_callback = 
dynamic_cast(gsl::as_nullable(http_client_->getUploadCallback()->getPtr()));
+  if (http_callback)

Review Comment:
   good idea, merged them in 
https://github.com/apache/nifi-minifi-cpp/commit/4263282eb39be5757f303a61bb0d5380be157d66#diff-4e08bc45485eac46e59652e031a79a51dca96dc3a08fa5bf6ee8d2b5603bda6eR74



##
extensions/http-curl/client/HTTPStream.cpp:
##
@@ -26,55 +26,56 @@
 #include "io/validation.h"
 #include "utils/gsl.h"
 
-namespace org {
-namespace apache {
-namespace nifi {
-namespace minifi {
-namespace io {
+namespace org::apache::nifi::minifi::extensions::curl {
 
-HttpStream::HttpStream(std::shared_ptr client)
+HttpStream::HttpStream(std::shared_ptr client)
 : http_client_(std::move(client)),
   written(0),
-  // given the nature of the stream we don't want to slow libCURL, we will 
produce
-  // a warning instead allowing us to adjust it server side or through the 
local configuration.
-  http_read_callback_(66560, true),
+// given the nature of the stream we don't want to slow libCURL, we will 
produce
+// a warning instead allowing us to adjust it server side or through the 
local configuration.
   started_(false) {
   // submit early on
 }
 
 void HttpStream::close() {
-  http_callback_.close();
-  http_read_callback_.close();
+  if (auto read_callback = http_client_->getReadCallback())
+read_callback->getPtr()->close();
+  if (auto upload_callback = http_client_->getUpl

[jira] [Created] (MINIFICPP-1908) Fix python processor info in the manifest

2022-08-16 Thread Adam Debreceni (Jira)
Adam Debreceni created MINIFICPP-1908:
-

 Summary: Fix python processor info in the manifest
 Key: MINIFICPP-1908
 URL: https://issues.apache.org/jira/browse/MINIFICPP-1908
 Project: Apache NiFi MiNiFi C++
  Issue Type: Bug
Reporter: Adam Debreceni
Assignee: Adam Debreceni


The description of python processors is malformed in the manifest.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi-minifi-cpp] lordgamez commented on a diff in pull request #1360: MINIFICPP-1853 Enable multiple metrics from the same processor type

2022-08-16 Thread GitBox


lordgamez commented on code in PR #1360:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1360#discussion_r946494835


##
extensions/http-curl/tests/C2DescribeMetricsTest.cpp:
##
@@ -0,0 +1,156 @@
+/**
+ *
+ * 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.
+ */
+
+#undef NDEBUG
+#include 
+
+#include "TestBase.h"
+#include "HTTPIntegrationBase.h"
+#include "HTTPHandlers.h"
+#include "processors/TailFile.h"
+#include "state/ProcessorController.h"
+#include "utils/file/FileUtils.h"
+#include "utils/TestUtils.h"
+#include "processors/GetTCP.h"
+#include "utils/StringUtils.h"
+#include "utils/file/PathUtils.h"
+
+using namespace std::literals::chrono_literals;
+
+namespace org::apache::nifi::minifi::test {
+
+class VerifyEmptyC2Metric : public VerifyC2Base {
+ public:
+  explicit VerifyEmptyC2Metric(const std::atomic_bool& metrics_found) : 
metrics_found_(metrics_found) {
+  }
+
+  void testSetup() override {
+LogTestController::getInstance().setTrace();
+LogTestController::getInstance().setTrace();
+LogTestController::getInstance().setDebug();
+LogTestController::getInstance().setDebug();
+LogTestController::getInstance().setOff();
+VerifyC2Base::testSetup();
+  }
+
+  void runAssertions() override {
+using org::apache::nifi::minifi::utils::verifyEventHappenedInPollTime;
+assert(verifyEventHappenedInPollTime(40s, [&] { return 
metrics_found_.load(); }, 1s));
+  }
+
+ private:
+  const std::atomic_bool& metrics_found_;
+};
+
+class MetricsHandler: public HeartbeatHandler {
+ public:
+  explicit MetricsHandler(std::atomic_bool& metrics_found, 
std::shared_ptr configuration)
+: HeartbeatHandler(std::move(configuration)),
+  metrics_found_(metrics_found) {
+  }
+
+  void handleHeartbeat(const rapidjson::Document&, struct mg_connection* conn) 
override {
+switch (state_) {
+  case TestState::DESCRIBE_SPECIFIC_METRIC: {
+sendHeartbeatResponse("DESCRIBE", "metrics", "889347", conn, 
{{"metricsClass", "GetFileMetrics"}});
+break;
+  }
+  case TestState::DESCRIBE_ALL_METRICS: {
+sendHeartbeatResponse("DESCRIBE", "metrics", "889347", conn);
+break;
+  }
+  default:
+throw std::runtime_error("Unhandled test state");
+}
+  }
+
+  void handleAcknowledge(const rapidjson::Document& root) override {
+switch (state_) {
+  case TestState::DESCRIBE_SPECIFIC_METRIC: {
+verifySpecificMetrics(root);
+break;
+  }
+  case TestState::DESCRIBE_ALL_METRICS: {
+verifyAllMetrics(root);
+break;
+  }
+  default:
+throw std::runtime_error("Unhandled test state");
+}
+  }
+
+ private:
+  enum class TestState {
+DESCRIBE_SPECIFIC_METRIC,
+DESCRIBE_ALL_METRICS
+  };
+
+  static void sendEmptyHeartbeatResponse(struct mg_connection* conn) {
+mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: 
text/plain\r\nContent-Length: 0\r\nConnection: close\r\n\r\n");
+  }
+
+  void verifySpecificMetrics(const rapidjson::Document& root) {
+auto getfile_metrics_verified =
+  !root.HasMember("metrics") &&
+  root.HasMember("GetFileMetrics") &&
+  root["GetFileMetrics"].HasMember("471deef6-2a6e-4a7d-912a-81cc17e3a206") 
&&
+  root["GetFileMetrics"].HasMember("471deef6-2a6e-4a7d-912a-81cc17e3a207");

Review Comment:
   Good idead, updated in 1a8cb7944dced4cb1b7df52abcbbffe84ff25e4d



##
extensions/http-curl/tests/C2MetricsTest.cpp:
##
@@ -169,8 +169,9 @@ class MetricsHandler: public HeartbeatHandler {
 
   static bool verifyProcessorMetrics(const rapidjson::Value& 
processor_metrics) {
 return processor_metrics.HasMember("GetTCPMetrics") &&
-  processor_metrics["GetTCPMetrics"].HasMember("OnTriggerInvocations") &&
-  processor_metrics["GetTCPMetrics"]["OnTriggerInvocations"].GetUint() > 0;
+  
processor_metrics["GetTCPMetrics"].HasMember("2438e3c8-015a-1000-79ca-83af40ec1991")
 &&
+  
processor_metrics["GetTCPMetrics"]["2438e3c8-015a-1000-79ca-83af40ec1991"].HasMember("OnTriggerInvocations")
 &&
+  
processor_metrics["GetTCPMetrics"]["2438e3c8-015a-1000-79ca-83af40ec1991"]["OnTriggerInvocations"].GetUint()
 > 0;

Review Comment:
   Updated in 1a8cb7944dce

[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

2022-08-16 Thread GitBox


szaszm commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946473092


##
libminifi/test/integration/StateTransactionalityTests.cpp:
##
@@ -72,8 +72,7 @@ class StatefulIntegrationTest : public IntegrationBase {
 // set hooks
 const auto processController = 
dynamic_cast(&component);
 assert(processController != nullptr);
-stateful_processor_ = 
dynamic_cast(processController->getProcessor());
-assert(stateful_processor_ != nullptr);

Review Comment:
   ~The return type of getProcessor is a reference now, it's always present. ~
   
   Well, I missed the fact that `dynamic_cast` can still return null. Will 
revert.



##
libminifi/test/integration/StateTransactionalityTests.cpp:
##
@@ -72,8 +72,7 @@ class StatefulIntegrationTest : public IntegrationBase {
 // set hooks
 const auto processController = 
dynamic_cast(&component);
 assert(processController != nullptr);
-stateful_processor_ = 
dynamic_cast(processController->getProcessor());
-assert(stateful_processor_ != nullptr);

Review Comment:
   ~The return type of getProcessor is a reference now, it's always present.~
   
   Well, I missed the fact that `dynamic_cast` can still return null. Will 
revert.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

2022-08-16 Thread GitBox


szaszm commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946473092


##
libminifi/test/integration/StateTransactionalityTests.cpp:
##
@@ -72,8 +72,7 @@ class StatefulIntegrationTest : public IntegrationBase {
 // set hooks
 const auto processController = 
dynamic_cast(&component);
 assert(processController != nullptr);
-stateful_processor_ = 
dynamic_cast(processController->getProcessor());
-assert(stateful_processor_ != nullptr);

Review Comment:
   The return type of getProcessor is a reference now, it's always present. 



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Resolved] (NIFI-10343) OIDC identity provider may provide "null" as error message

2022-08-16 Thread Pierre Villard (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre Villard resolved NIFI-10343.
---
Fix Version/s: 1.18.0
   Resolution: Fixed

> OIDC identity provider may provide "null" as error message
> --
>
> Key: NIFI-10343
> URL: https://issues.apache.org/jira/browse/NIFI-10343
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Malthe Borch
>Assignee: Malthe Borch
>Priority: Major
> Fix For: 1.18.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We've observed an error message "An error occurred while invoking the Token 
> endpoint: null" which seems to stem from the code pulling the error 
> description which may be null.
> Instead, it should provide both the description and the code – and possibly 
> the HTTP status code as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (NIFI-10343) OIDC identity provider may provide "null" as error message

2022-08-16 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-10343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580124#comment-17580124
 ] 

ASF subversion and git services commented on NIFI-10343:


Commit 1b4d66a726eb32839cf35c57234ff0e28f21157c in nifi's branch 
refs/heads/main from Malthe Borch
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=1b4d66a726 ]

NIFI-10343 Add error code to exception message

The error object may not have a description, but should have a code.

Signed-off-by: Pierre Villard 

This closes #6288.


> OIDC identity provider may provide "null" as error message
> --
>
> Key: NIFI-10343
> URL: https://issues.apache.org/jira/browse/NIFI-10343
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Malthe Borch
>Priority: Major
>
> We've observed an error message "An error occurred while invoking the Token 
> endpoint: null" which seems to stem from the code pulling the error 
> description which may be null.
> Instead, it should provide both the description and the code – and possibly 
> the HTTP status code as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (NIFI-10343) OIDC identity provider may provide "null" as error message

2022-08-16 Thread Pierre Villard (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-10343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre Villard reassigned NIFI-10343:
-

Assignee: Malthe Borch

> OIDC identity provider may provide "null" as error message
> --
>
> Key: NIFI-10343
> URL: https://issues.apache.org/jira/browse/NIFI-10343
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Malthe Borch
>Assignee: Malthe Borch
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We've observed an error message "An error occurred while invoking the Token 
> endpoint: null" which seems to stem from the code pulling the error 
> description which may be null.
> Instead, it should provide both the description and the code – and possibly 
> the HTTP status code as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [nifi] asfgit closed pull request #6288: NIFI-10343 Add error code to exception message

2022-08-16 Thread GitBox


asfgit closed pull request #6288: NIFI-10343 Add error code to exception message
URL: https://github.com/apache/nifi/pull/6288


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

2022-08-16 Thread GitBox


adamdebreceni commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946417796


##
libminifi/test/integration/StateTransactionalityTests.cpp:
##
@@ -72,8 +72,7 @@ class StatefulIntegrationTest : public IntegrationBase {
 // set hooks
 const auto processController = 
dynamic_cast(&component);
 assert(processController != nullptr);
-stateful_processor_ = 
dynamic_cast(processController->getProcessor());
-assert(stateful_processor_ != nullptr);

Review Comment:
   why isn't this assert needed anymore?



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org