You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2021/03/17 22:07:20 UTC

[nifi] branch support/nifi-1.13 updated (284c0b0 -> f0644b7)

This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a change to branch support/nifi-1.13
in repository https://gitbox.apache.org/repos/asf/nifi.git.


    from 284c0b0  NIFI-8257-RC1 prepare for next development iteration
     new dda97a2  NIFI-8316: Pass empty collections instead of null when calling write(ConfigurableComponent component)
     new eb0442c  NIFI-8297: Report incompatible value if it doesn't fit in an Integer
     new f0644b7  NIFI-8324 Fix NGINX X-ProxiedEntitiesChain examples in Admin Guide

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../documentation/AbstractDocumentationWriter.java    | 19 ++++++++++---------
 .../nifi/serialization/record/util/DataTypeUtils.java |  8 ++++++++
 .../nifi/serialization/record/TestDataTypeUtils.java  | 16 ++++++++++++++++
 nifi-docs/src/main/asciidoc/administration-guide.adoc |  6 +++---
 4 files changed, 37 insertions(+), 12 deletions(-)


[nifi] 03/03: NIFI-8324 Fix NGINX X-ProxiedEntitiesChain examples in Admin Guide

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.13
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit f0644b7febc339d362bc92cc5536bcf19fbb71ce
Author: Joey Frazee <jf...@apache.org>
AuthorDate: Mon Mar 15 13:48:50 2021 -0700

    NIFI-8324 Fix NGINX X-ProxiedEntitiesChain examples in Admin Guide
    
    This closes #4897
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 nifi-docs/src/main/asciidoc/administration-guide.adoc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nifi-docs/src/main/asciidoc/administration-guide.adoc b/nifi-docs/src/main/asciidoc/administration-guide.adoc
index 5751c57..0096d95 100644
--- a/nifi-docs/src/main/asciidoc/administration-guide.adoc
+++ b/nifi-docs/src/main/asciidoc/administration-guide.adoc
@@ -3249,7 +3249,7 @@ http {
             proxy_set_header X-ProxyHost nginx.example.com;
             proxy_set_header X-ProxyPort 17590;
             proxy_set_header X-ProxyContextPath /;
-            proxy_set_header X-ProxiedEntitiesChain $ssl_client_s_dn;
+            proxy_set_header X-ProxiedEntitiesChain <$ssl_client_s_dn>;
         }
     }
 }
@@ -3374,7 +3374,7 @@ http {
             proxy_set_header X-ProxyHost $1;
             proxy_set_header X-ProxyPort 443;
             proxy_set_header X-ProxyContextPath /;
-            proxy_set_header X-ProxiedEntitiesChain $ssl_client_s_dn;
+            proxy_set_header X-ProxiedEntitiesChain <$ssl_client_s_dn>;
         }
     }
 }
@@ -3860,4 +3860,4 @@ Now, we must place our custom processor nar in the configured directory. The con
 
 Ensure that the file has appropriate permissions for the nifi user and group.
 
-Refresh the browser page and the custom processor should now be available when adding a new Processor to your flow.
\ No newline at end of file
+Refresh the browser page and the custom processor should now be available when adding a new Processor to your flow.


[nifi] 02/03: NIFI-8297: Report incompatible value if it doesn't fit in an Integer

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.13
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit eb0442cbe497313ca5402d981bf8b4e85bac3f09
Author: Matthew Burgess <ma...@apache.org>
AuthorDate: Wed Mar 10 12:32:06 2021 -0500

    NIFI-8297: Report incompatible value if it doesn't fit in an Integer
    
    Signed-off-by: Pierre Villard <pi...@gmail.com>
    
    This closes #4886.
---
 .../nifi/serialization/record/util/DataTypeUtils.java    |  8 ++++++++
 .../nifi/serialization/record/TestDataTypeUtils.java     | 16 ++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
index 61e50ff..ede3475 100644
--- a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
+++ b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
@@ -1598,6 +1598,14 @@ public class DataTypeUtils {
     }
 
     public static boolean isIntegerTypeCompatible(final Object value) {
+        if (value instanceof Number) {
+            try {
+                Math.toIntExact(((Number) value).longValue());
+                return true;
+            } catch (ArithmeticException ae) {
+                return false;
+            }
+        }
         return isNumberTypeCompatible(value, s -> isIntegral(s, Integer.MIN_VALUE, Integer.MAX_VALUE));
     }
 
diff --git a/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java b/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
index c89e656..a493609 100644
--- a/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
+++ b/nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestDataTypeUtils.java
@@ -430,6 +430,22 @@ public class TestDataTypeUtils {
     }
 
     @Test
+    public void testIsCompatibleDataTypeInteger() {
+        final DataType dataType = RecordFieldType.INT.getDataType();
+        assertTrue(DataTypeUtils.isCompatibleDataType(new Integer("1234567"), dataType));
+        assertTrue(DataTypeUtils.isCompatibleDataType("1234567", dataType));
+        assertFalse(DataTypeUtils.isCompatibleDataType(new BigInteger("12345678901234567890"), dataType));
+        assertFalse(DataTypeUtils.isCompatibleDataType(1234567890123456789L, dataType));
+        assertTrue(DataTypeUtils.isCompatibleDataType(1, dataType));
+        assertTrue(DataTypeUtils.isCompatibleDataType((short) 1, dataType));
+        assertFalse(DataTypeUtils.isCompatibleDataType("12345678901234567890", dataType));
+        assertTrue(DataTypeUtils.isCompatibleDataType(3.1f, dataType));
+        assertTrue(DataTypeUtils.isCompatibleDataType(3.0, dataType));
+        assertFalse(DataTypeUtils.isCompatibleDataType("1234567XYZ", dataType));
+        assertFalse(DataTypeUtils.isCompatibleDataType(new Long[]{1L, 2L}, dataType));
+    }
+
+    @Test
     public void testIsCompatibleDataTypeArrayDifferentElementTypes() {
         Object[] array = new Object[]{"2", 1};
         assertTrue(DataTypeUtils.isCompatibleDataType(array, RecordFieldType.ARRAY.getArrayDataType(RecordFieldType.INT.getDataType())));


[nifi] 01/03: NIFI-8316: Pass empty collections instead of null when calling write(ConfigurableComponent component)

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.13
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit dda97a20bcad3f2f7d3f0d48d7824ba6699fdd48
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Thu Mar 11 17:03:44 2021 -0500

    NIFI-8316: Pass empty collections instead of null when calling write(ConfigurableComponent component)
    
    Signed-off-by: Pierre Villard <pi...@gmail.com>
    
    This closes #4891.
---
 .../documentation/AbstractDocumentationWriter.java    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java b/nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
index 2c24f5c..2276090 100644
--- a/nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
+++ b/nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
@@ -16,14 +16,6 @@
  */
 package org.apache.nifi.documentation;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
 import org.apache.nifi.annotation.behavior.DynamicProperties;
 import org.apache.nifi.annotation.behavior.DynamicProperty;
 import org.apache.nifi.annotation.behavior.DynamicRelationship;
@@ -50,6 +42,15 @@ import org.apache.nifi.processor.Relationship;
 import org.apache.nifi.reporting.InitializationException;
 import org.apache.nifi.reporting.ReportingTask;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * Base class for DocumentationWriter that simplifies iterating over all information for a component, creating a separate method
  * for each, to ensure that implementations properly override all methods and therefore properly account for all information about
@@ -95,7 +96,7 @@ public abstract class AbstractDocumentationWriter implements ExtensionDocumentat
 
     @Override
     public final void write(final ConfigurableComponent component) throws IOException {
-        write(component, null, null);
+        write(component, Collections.emptyList(), Collections.emptyMap());
     }
 
     @Override