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


##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonRecordSetWriter.java:
##########
@@ -123,13 +123,25 @@ public class JsonRecordSetWriter extends 
DateTimeTextRecordSetWriter implements
             .allowableValues("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
             .dependsOn(COMPRESSION_FORMAT, COMPRESSION_FORMAT_GZIP)
             .build();
+    public static final PropertyDescriptor REUSE_INPUT_SERIALIZATION = new 
PropertyDescriptor.Builder()
+            .name("Use Input Serialization")
+            .description("""
+                    When set to true (default), the writer may emit the 
upstream reader's original JSON bytes verbatim when it can do so safely, as a \

Review Comment:
   ```suggestion
                       When enabled, the writer may emit the input reader's 
original JSON bytes verbatim when it can do so safely, as a \
   ```



##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonRecordSetWriter.java:
##########
@@ -123,13 +123,25 @@ public class JsonRecordSetWriter extends 
DateTimeTextRecordSetWriter implements
             .allowableValues("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
             .dependsOn(COMPRESSION_FORMAT, COMPRESSION_FORMAT_GZIP)
             .build();
+    public static final PropertyDescriptor REUSE_INPUT_SERIALIZATION = new 
PropertyDescriptor.Builder()
+            .name("Use Input Serialization")
+            .description("""
+                    When set to true (default), the writer may emit the 
upstream reader's original JSON bytes verbatim when it can do so safely, as a \
+                    throughput optimization. In that case, the Timestamp 
Format, Date Format, Time Format, and Suppress Null Values properties may not 
be \
+                    applied to those records. Set this to false to force 
re-serialization so that these properties are honored uniformly for every 
record.""")
+            .expressionLanguageSupported(ExpressionLanguageScope.NONE)
+            .allowableValues("true", "false")
+            .defaultValue("true")

Review Comment:
   Recommend using the `Boolean.TRUE.toString()` and `Boolean.FALSE.toString()` 
to avoid confusion on values.



##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonRecordSetWriter.java:
##########
@@ -123,13 +123,25 @@ public class JsonRecordSetWriter extends 
DateTimeTextRecordSetWriter implements
             .allowableValues("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
             .dependsOn(COMPRESSION_FORMAT, COMPRESSION_FORMAT_GZIP)
             .build();
+    public static final PropertyDescriptor REUSE_INPUT_SERIALIZATION = new 
PropertyDescriptor.Builder()
+            .name("Use Input Serialization")

Review Comment:
   In general, the variable name should match the property name, as 
`USE_INPUT_SERIALIZATION`.
   
   On further consideration, `Use Input Serialization` does not seem very 
intuitive on initial read. Another question is whether this should be a 
`Boolean`, or an enum.
   
   For Boolean properties, ending the name with `Enabled` is often helpful to 
clarify behavior. What do you think about `Optimized Input Handling Enabled`. 
Another option might be `Serialized JSON Input Handling` with `ENABLED` and 
`DISABLED` as options.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to