You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "joewitt (via GitHub)" <gi...@apache.org> on 2023/04/07 23:03:04 UTC

[GitHub] [nifi] joewitt opened a new pull request, #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

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

   <!-- 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. -->
   
   # Summary
   
   [NIFI-00000](https://issues.apache.org/jira/browse/NIFI-00000)
   
   # 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-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### 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 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-unsubscribe@nifi.apache.org

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


[GitHub] [nifi] pvillard31 commented on pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #7139:
URL: https://github.com/apache/nifi/pull/7139#issuecomment-1502054316

   Tested the PR and confirmed the expected behavior. Merging. Thanks @joewitt 


-- 
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-unsubscribe@nifi.apache.org

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


[GitHub] [nifi] asfgit closed pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject
URL: https://github.com/apache/nifi/pull/7139


-- 
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-unsubscribe@nifi.apache.org

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


[GitHub] [nifi] joewitt commented on a diff in pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

Posted by "joewitt (via GitHub)" <gi...@apache.org>.
joewitt commented on code in PR #7139:
URL: https://github.com/apache/nifi/pull/7139#discussion_r1161860345


##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")
+            .displayName("Allow GZIP Compression")

Review Comment:
   Yeah good point - I chose 'allow' because the spec from googles api uses this terminology which makes me think they could still decide to change the behavior so it more like a 'signal' which I think was the word they use.  But we'll just be explicit.



-- 
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-unsubscribe@nifi.apache.org

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


[GitHub] [nifi] pvillard31 commented on pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #7139:
URL: https://github.com/apache/nifi/pull/7139#issuecomment-1501980214

   Reviewing...


-- 
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-unsubscribe@nifi.apache.org

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


[GitHub] [nifi] joewitt commented on a diff in pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

Posted by "joewitt (via GitHub)" <gi...@apache.org>.
joewitt commented on code in PR #7139:
URL: https://github.com/apache/nifi/pull/7139#discussion_r1161859546


##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")
+            .displayName("Allow GZIP Compression")
+            .description("Signals to the GCS Blob Writer whether GZIP compression during transfer is desired. " +
+                    "False means dont gzip and can boost performance in many cases.")
+            .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
+            .defaultValue("False")
+            .allowableValues("True", "False")
+            .defaultValue("True")

Review Comment:
   haha dang it - good catch.  Will resolve.



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")
+            .displayName("Allow GZIP Compression")
+            .description("Signals to the GCS Blob Writer whether GZIP compression during transfer is desired. " +
+                    "False means dont gzip and can boost performance in many cases.")
+            .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
+            .defaultValue("False")
+            .allowableValues("True", "False")
+            .defaultValue("True")

Review Comment:
   yep will do



-- 
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-unsubscribe@nifi.apache.org

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


[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7139: NIFI-11408 enable user to disable gzip compression with PutGCSObject

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #7139:
URL: https://github.com/apache/nifi/pull/7139#discussion_r1161852135


##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")
+            .displayName("Allow GZIP Compression")
+            .description("Signals to the GCS Blob Writer whether GZIP compression during transfer is desired. " +
+                    "False means dont gzip and can boost performance in many cases.")
+            .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
+            .defaultValue("False")
+            .allowableValues("True", "False")
+            .defaultValue("True")

Review Comment:
   The `defaultValue()` is being called twice, with the effective value being set to `True`. This should be corrected to the preferred setting.



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")

Review Comment:
   ```suggestion
               .Builder().name("gzip.compression.enabled")
   ```



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/test/java/org/apache/nifi/processors/gcp/storage/PutGCSObjectTest.java:
##########
@@ -180,7 +180,7 @@ public void testSuccessfulPutOperation() throws Exception {
         runner.setProperty(PutGCSObject.ENCRYPTION_KEY, ENCRYPTION_KEY);
         runner.setProperty(PutGCSObject.OVERWRITE, String.valueOf(OVERWRITE));
         runner.setProperty(PutGCSObject.CONTENT_DISPOSITION_TYPE, CONTENT_DISPOSITION_TYPE);
-
+        runner.setProperty(PutGCSObject.GZIPCONTENT, "False");

Review Comment:
   ```suggestion
           runner.setProperty(PutGCSObject.GZIPCONTENT, Boolean.FALSE.toString());
   ```



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")
+            .displayName("Allow GZIP Compression")

Review Comment:
   Recommend adjusting the wording to use `Enabled` instead of `Allow` so the behavior is clear.
   ```suggestion
               .displayName("GZIP Compression Enabled")
   ```



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/PutGCSObject.java:
##########
@@ -194,6 +194,16 @@ public class PutGCSObject extends AbstractGCSProcessor {
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor GZIPCONTENT = new PropertyDescriptor
+            .Builder().name("gzip.content")
+            .displayName("Allow GZIP Compression")
+            .description("Signals to the GCS Blob Writer whether GZIP compression during transfer is desired. " +
+                    "False means dont gzip and can boost performance in many cases.")
+            .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
+            .defaultValue("False")
+            .allowableValues("True", "False")
+            .defaultValue("True")

Review Comment:
   Although various Processors are not consistent, other GCS Processors use the lowercase values for Boolean settings. This also aligns with Java Boolean.toString().
   ```suggestion
               .allowableValues(Boolean.TRUE.toString(), Boolean.FALSE.toString())
               .defaultValue(Boolean.TRUE.toString())
   ```



-- 
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-unsubscribe@nifi.apache.org

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