Skip to content

NIFI-6332 - Add Cache Control property to PutS3Object processor#4422

Closed
kent-nguyen wants to merge 3 commits intoapache:mainfrom
kent-nguyen:6332_cache_control_puts3
Closed

NIFI-6332 - Add Cache Control property to PutS3Object processor#4422
kent-nguyen wants to merge 3 commits intoapache:mainfrom
kent-nguyen:6332_cache_control_puts3

Conversation

@kent-nguyen
Copy link
Contributor

Add new property 'Cache Control' to allow user to
set the cache-control http header on the S3 object.

This property is not required, and has no default value.

The implementation is similar to the Content-Type property,
except that this property does not allow Expression Language.

Add new property 'Cache Control' to allow user to
set the cache-control http header on the S3 object.

This property is not required, and has no default value.

The implementation is similar to the Content-Type property,
except that this property does not allow Expression Language.
Copy link
Contributor

@turcsanyip turcsanyip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kent-nguyen Thanks for the contribution. I manually tested it with a simple flow and it works properly. Also ran the integration test successfully.

Is there a specific reason why expression language is not supported by this new Cache Control property?

Also left an inline comment about improving the description of the property. Please check it.

public static final PropertyDescriptor CACHE_CONTROL = new PropertyDescriptor.Builder()
.name("Cache Control")
.displayName("Cache Control")
.description("Sets the Cache-Control HTTP header. Multiple directives are comma-separated.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a similar explanation as in case of Content Type:
"Sets the Cache-Control HTTP header indicating the caching directives of the associated object." (or similar)

Copy link
Contributor Author

@kent-nguyen kent-nguyen Jul 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @turcsanyip Thank you for checking my PR. It's great to hear you ran the tests on it. I had carefully tested it on my local too.

In contrast to the Content Type property, which can get the MIME string from the flow file itself, the flow file metadata wouldn't normally be relevant for the Cache Control property. I felt this was similar in nature to properties like Storage Class and Server Side Encryption, which are on set on the processor and do not support expression language.

I have updated the description as your suggestion. Thank you again.

Copy link
Contributor

@turcsanyip turcsanyip Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kent-nguyen The generic approach is to add EL support with Variable Registry scope (ExpressionLanguageScope.VARIABLE_REGISTRY) at least and to support Flow File attributes (ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) when it is reasonable.
Storage Class property also has the option "Reference parameter..." (actually it is provided by the framework because it is a selectable property with a drop-down list, but in fact it is similar to setting Variable Registry scoped EL support from code).

As far as I see, you are not assigned the Contributor role yet. Could you please request for "Jira contributor access" on the mailing list dev@nifi.apache.org?
Then please assign the Jira ticket to yourself.

@kent-nguyen kent-nguyen force-pushed the 6332_cache_control_puts3 branch from ce7e6df to ab454b3 Compare July 24, 2020 01:58
@kent-nguyen
Copy link
Contributor Author

Apologies for the force push, realise now that wasn't a good idea. Was trying to trigger CI again since it looks to have encountered a transient error, but I'll ignore that in future.

Copy link
Contributor

@turcsanyip turcsanyip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM
Merging to main.

@kent-nguyen Please reference the JIRA ticket number in the commit message next time.
I'll add it during the merge.

@asfgit asfgit closed this in 0cff540 Jul 30, 2020
ets pushed a commit to ets/nifi that referenced this pull request Oct 2, 2020
Add new property 'Cache Control' to allow user to
set the cache-control http header on the S3 object.

This property is not required, and has no default value.

The implementation is similar to the Content-Type property,
except that this property does not allow Expression Language.

Update property description

Add support EL for cache-control property

This closes apache#4422.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
driesva pushed a commit to driesva/nifi that referenced this pull request Mar 19, 2021
Add new property 'Cache Control' to allow user to
set the cache-control http header on the S3 object.

This property is not required, and has no default value.

The implementation is similar to the Content-Type property,
except that this property does not allow Expression Language.

Update property description

Add support EL for cache-control property

This closes apache#4422.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
krisztina-zsihovszki pushed a commit to krisztina-zsihovszki/nifi that referenced this pull request Jun 28, 2022
Add new property 'Cache Control' to allow user to
set the cache-control http header on the S3 object.

This property is not required, and has no default value.

The implementation is similar to the Content-Type property,
except that this property does not allow Expression Language.

Update property description

Add support EL for cache-control property

This closes apache#4422.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants