NIFI-16159 Add support for FileResourceService in PutFile - #11495
Open
shubhluck wants to merge 1 commit into
Open
NIFI-16159 Add support for FileResourceService in PutFile#11495shubhluck wants to merge 1 commit into
shubhluck wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NIFI-16159
Add support for
FileResourceServiceinPutFile, matching theResource Transfer Source/File Resource Servicepattern already available inPutS3Object(NIFI-12642),PutGCSObject(NIFI-12643), andPutHDFS(NIFI-12801).PutFilecurrently writes only the incoming FlowFile's content to the destination directory. Users who want to stage a file already on the local filesystem (or reachable via a customFileResourceServiceimplementation) have to first pull it into a FlowFile withFetchFile/GetFile, which is wasteful for large local files.Changes
Resource Transfer SourceandFile Resource Serviceproperty descriptors toPutFile, reusingResourceTransferPropertiesfromnifi-resource-transfer.Resource Transfer Source = File Resource Service, obtain aFileResourceviaResourceTransferUtils.getFileResource(...)and stream itsInputStreamto the.<filename>temp file withStandardCopyOption.REPLACE_EXISTING(preserving the overwrite semantics of the originalsession.exportTo(...)call), then proceed with the existing rename / permissions / owner / group / lastModified logic.Resource Transfer Source = FlowFile Content(default) the behavior is byte-identical to today.nifi-resource-transferandnifi-file-resource-service-api(compile) andnifi-file-resource-service(test) tonifi-standard-processors/pom.xml.TestPutFile#testPutFileFromLocalFilecovering theFileResourceServicepath usingStandardFileResourceService.Backward compatibility
Resource Transfer Sourcedefaults toFlowFile Content, so existing flows are unaffected.File Resource Serviceonly appears in the UI when the source is set toFile Resource Service(declared viadependsOn).Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation